亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nsseamonkeyprofilemigrator.cpp

?? 現在很火的郵件客戶端軟件thunderbird的源碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- *//* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is The Mail Profile Migrator. * * The Initial Developer of the Original Code is Ben Goodger. * Portions created by the Initial Developer are Copyright (C) 2004 * the Initial Developer. All Rights Reserved. * * Contributor(s): *  Ben Goodger <ben@bengoodger.com> *  Scott MacGregor <mscott@mozilla.org> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */#include "nsMailProfileMigratorUtils.h"#include "nsCRT.h"#include "nsDirectoryServiceDefs.h"#include "nsIObserverService.h"#include "nsIPasswordManagerInternal.h"#include "nsIPrefLocalizedString.h"#include "nsIPrefService.h"#include "nsIServiceManager.h"#include "nsISupportsArray.h"#include "nsISupportsPrimitives.h"#include "nsNetCID.h"#include "nsNetUtil.h"#include "nsSeamonkeyProfileMigrator.h"#include "nsIRelativeFilePref.h"#include "nsAppDirectoryServiceDefs.h"#include "prprf.h"#include "nsVoidArray.h"static PRUint32 StringHash(const char *ubuf);nsresult NS_MsgHashIfNecessary(nsCString &name);// Mail specific folder paths#define MAIL_DIR_50_NAME             NS_LITERAL_STRING("Mail")#define IMAP_MAIL_DIR_50_NAME        NS_LITERAL_STRING("ImapMail")#define NEWS_DIR_50_NAME             NS_LITERAL_STRING("News")///////////////////////////////////////////////////////////////////////////////// nsSeamonkeyProfileMigrator#define FILE_NAME_JUNKTRAINING    NS_LITERAL_STRING("training.dat")#define FILE_NAME_PERSONALDICTIONARY NS_LITERAL_STRING("persdict.dat")#define FILE_NAME_PERSONAL_ADDRESSBOOK NS_LITERAL_STRING("abook.mab")#define FILE_NAME_MAILVIEWS       NS_LITERAL_STRING("mailviews.dat")#define FILE_NAME_CERT8DB         NS_LITERAL_STRING("cert8.db")#define FILE_NAME_KEY3DB          NS_LITERAL_STRING("key3.db")#define FILE_NAME_SECMODDB        NS_LITERAL_STRING("secmod.db")#define FILE_NAME_MIMETYPES       NS_LITERAL_STRING("mimeTypes.rdf")#define FILE_NAME_PREFS           NS_LITERAL_STRING("prefs.js")#define FILE_NAME_USER_PREFS      NS_LITERAL_STRING("user.js")struct PrefBranchStruct {  char*         prefName;  PRInt32       type;  union {    char*       stringValue;    PRInt32     intValue;    PRBool      boolValue;    PRUnichar*  wstringValue;  };};NS_IMPL_ISUPPORTS2(nsSeamonkeyProfileMigrator, nsIMailProfileMigrator, nsITimerCallback)nsSeamonkeyProfileMigrator::nsSeamonkeyProfileMigrator(){  mObserverService = do_GetService("@mozilla.org/observer-service;1");  mMaxProgress = LL_ZERO;  mCurrentProgress = LL_ZERO;}nsSeamonkeyProfileMigrator::~nsSeamonkeyProfileMigrator(){           }///////////////////////////////////////////////////////////////////////////////// nsITimerCallbackNS_IMETHODIMPnsSeamonkeyProfileMigrator::Notify(nsITimer *timer){  CopyNextFolder();  return NS_OK;}void nsSeamonkeyProfileMigrator::CopyNextFolder() {  if (mFileCopyTransactionIndex < mFileCopyTransactions->Count())  {    PRUint32 percentage = 0;    fileTransactionEntry* fileTransaction = (fileTransactionEntry*) mFileCopyTransactions->SafeElementAt(mFileCopyTransactionIndex++);    if (fileTransaction) // copy the file    {      fileTransaction->srcFile->CopyTo(fileTransaction->destFile, EmptyString());      // add to our current progress      PRInt64 fileSize;      fileTransaction->srcFile->GetFileSize(&fileSize);      LL_ADD(mCurrentProgress, mCurrentProgress, fileSize);      PRInt64 percentDone;      LL_MUL(percentDone, mCurrentProgress, 100);      LL_DIV(percentDone, percentDone, mMaxProgress);            LL_L2UI(percentage, percentDone);      nsAutoString index;      index.AppendInt( percentage );       NOTIFY_OBSERVERS(MIGRATION_PROGRESS, index.get());    }    // fire a timer to handle the next one.     mFileIOTimer = do_CreateInstance("@mozilla.org/timer;1");    if (mFileIOTimer)      mFileIOTimer->InitWithCallback(NS_STATIC_CAST(nsITimerCallback *, this), percentage == 100 ? 500 : 0, nsITimer::TYPE_ONE_SHOT);  } else    EndCopyFolders();    return;}void nsSeamonkeyProfileMigrator::EndCopyFolders() {  // clear out the file transaction array  if (mFileCopyTransactions)  {    PRUint32 count = mFileCopyTransactions->Count();    for (PRUint32 i = 0; i < count; ++i)     {      fileTransactionEntry* fileTransaction = (fileTransactionEntry*) mFileCopyTransactions->ElementAt(i);      if (fileTransaction)      {        fileTransaction->srcFile = nsnull;        fileTransaction->destFile = nsnull;        delete fileTransaction;      }    }      mFileCopyTransactions->Clear();    delete mFileCopyTransactions;  }  // notify the UI that we are done with the migration process  nsAutoString index;  index.AppendInt(nsIMailProfileMigrator::MAILDATA);   NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get());  NOTIFY_OBSERVERS(MIGRATION_ENDED, nsnull);}///////////////////////////////////////////////////////////////////////////////// nsIMailProfileMigratorNS_IMETHODIMPnsSeamonkeyProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile){  nsresult rv = NS_OK;  PRBool aReplace = aStartup ? PR_TRUE : PR_FALSE;  if (!mTargetProfile) {    GetProfilePath(aStartup, mTargetProfile);    if (!mTargetProfile) return NS_ERROR_FAILURE;  }  if (!mSourceProfile)    GetSourceProfile(aProfile);  NOTIFY_OBSERVERS(MIGRATION_STARTED, nsnull);  COPY_DATA(CopyPreferences,  aReplace, nsIMailProfileMigrator::SETTINGS);  // fake notifications for things we've already imported as part of CopyPreferences  COPY_DATA(DummyCopyRoutine, aReplace, nsIMailProfileMigrator::ACCOUNT_SETTINGS);    COPY_DATA(DummyCopyRoutine, aReplace, nsIMailProfileMigrator::NEWSDATA);  // copy junk mail training file  COPY_DATA(CopyJunkTraining, aReplace, nsIMailProfileMigrator::JUNKTRAINING);  COPY_DATA(CopyPasswords,    aReplace, nsIMailProfileMigrator::PASSWORDS);  // the last thing to do is to actually copy over any mail folders we have marked for copying  // we want to do this last and it will be asynchronous so the UI doesn't freeze up while we perform   // this potentially very long operation.     nsAutoString index;  index.AppendInt(nsIMailProfileMigrator::MAILDATA);   NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());  // Generate the max progress value now that we know all of the files we need to copy  PRUint32 count = mFileCopyTransactions->Count();  for (PRUint32 i = 0; i < count; ++i)   {    fileTransactionEntry* fileTransaction = (fileTransactionEntry*) mFileCopyTransactions->ElementAt(i);    if (fileTransaction)    {      PRInt64 fileSize;       fileTransaction->srcFile->GetFileSize(&fileSize);      LL_ADD(mMaxProgress, mMaxProgress, fileSize);    }  }  CopyNextFolder();  return rv;}NS_IMETHODIMPnsSeamonkeyProfileMigrator::GetMigrateData(const PRUnichar* aProfile,                                            PRBool aReplace,                                            PRUint16* aResult){  *aResult = 0;  if (!mSourceProfile) {    GetSourceProfile(aProfile);    if (!mSourceProfile)      return NS_ERROR_FILE_NOT_FOUND;  }  MigrationData data[] = { { ToNewUnicode(FILE_NAME_PREFS),                             nsIMailProfileMigrator::SETTINGS,                             PR_TRUE },                           { ToNewUnicode(FILE_NAME_JUNKTRAINING),                             nsIMailProfileMigrator::JUNKTRAINING,                             PR_TRUE },                          };                                                                    // Frees file name strings allocated above.  GetMigrateDataFromArray(data, sizeof(data)/sizeof(MigrationData),                           aReplace, mSourceProfile, aResult);  // Now locate passwords  nsXPIDLCString signonsFileName;  GetSignonFileName(aReplace, getter_Copies(signonsFileName));  if (!signonsFileName.IsEmpty()) {    nsAutoString fileName; fileName.AssignWithConversion(signonsFileName);    nsCOMPtr<nsIFile> sourcePasswordsFile;    mSourceProfile->Clone(getter_AddRefs(sourcePasswordsFile));    sourcePasswordsFile->Append(fileName);        PRBool exists;    sourcePasswordsFile->Exists(&exists);    if (exists)      *aResult |= nsIMailProfileMigrator::PASSWORDS;  }  // add some extra migration fields for things we also migrate  *aResult |= nsIMailProfileMigrator::ACCOUNT_SETTINGS            | nsIMailProfileMigrator::MAILDATA            | nsIMailProfileMigrator::NEWSDATA           | nsIMailProfileMigrator::ADDRESSBOOK_DATA;  return NS_OK;}NS_IMETHODIMPnsSeamonkeyProfileMigrator::GetSourceExists(PRBool* aResult){  nsCOMPtr<nsISupportsArray> profiles;  GetSourceProfiles(getter_AddRefs(profiles));  if (profiles) {     PRUint32 count;    profiles->Count(&count);    *aResult = count > 0;  }  else    *aResult = PR_FALSE;  return NS_OK;}NS_IMETHODIMPnsSeamonkeyProfileMigrator::GetSourceHasMultipleProfiles(PRBool* aResult){  nsCOMPtr<nsISupportsArray> profiles;  GetSourceProfiles(getter_AddRefs(profiles));  if (profiles) {    PRUint32 count;    profiles->Count(&count);    *aResult = count > 1;  }  else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久嫩草精品久久久精品一| 中文在线一区二区| 不卡一二三区首页| 日韩综合在线视频| 综合久久久久久久| 26uuu国产电影一区二区| 欧美在线啊v一区| 处破女av一区二区| 激情综合亚洲精品| 日韩av不卡在线观看| 亚洲美女一区二区三区| 国产欧美日韩在线| 日韩一级免费一区| 欧美日韩一区视频| 色综合久久久久久久久久久| 国产精品一区二区不卡| 捆绑紧缚一区二区三区视频| 亚洲成人av中文| 亚洲欧洲精品天堂一级| 久久蜜桃av一区二区天堂| 欧美久久久久久蜜桃| 一本大道av一区二区在线播放| 国产一区二区0| 免费成人在线观看视频| 亚洲在线成人精品| 一区二区视频在线| 亚洲欧洲美洲综合色网| 国产欧美精品日韩区二区麻豆天美| 欧美一区二区三区免费视频| 欧美视频在线一区| 在线影视一区二区三区| 99国产精品久久久久| 国产成a人无v码亚洲福利| 国产一区二区三区四区在线观看 | 欧美一级精品在线| 欧美日韩国产三级| 欧美日韩国产高清一区二区| 色久综合一二码| 日本乱码高清不卡字幕| 色哟哟精品一区| 色综合天天综合在线视频| 不卡一区二区在线| av福利精品导航| 成人免费视频视频| 不卡av免费在线观看| 成人av在线电影| av不卡一区二区三区| 91在线看国产| 在线免费观看日本一区| 欧美男人的天堂一二区| 欧美军同video69gay| 欧美一区二区播放| 精品国产乱码久久久久久牛牛| 精品欧美一区二区三区精品久久 | 91精品国产91久久久久久最新毛片| 欧美性生活久久| 国产精品视频免费| 久久精品视频在线免费观看| 一本色道久久综合亚洲91| www.66久久| 色偷偷成人一区二区三区91| 国产成人免费在线观看| 欧美三级中文字幕在线观看| 欧美日韩一区三区| 欧美午夜一区二区三区| av成人免费在线观看| 国产一区二区三区在线看麻豆| 久久99精品视频| 99九九99九九九视频精品| 91久久精品一区二区三区| 亚洲成a天堂v人片| 久久精品国产精品青草| 欧美精品在线观看播放| 伦理电影国产精品| 中文字幕在线不卡一区二区三区 | 自拍偷拍亚洲激情| 97超碰欧美中文字幕| 亚洲一区二区在线播放相泽| 欧美视频你懂的| 亚洲一区二区三区在线播放| 国产乱人伦偷精品视频免下载 | 中文在线一区二区| 久久成人麻豆午夜电影| 欧美三级在线看| 亚洲444eee在线观看| 欧美三级电影在线看| 国产精品久久久久一区| 成人激情开心网| 欧美在线影院一区二区| 欧美tk—视频vk| 国产91丝袜在线播放| 久久精品亚洲精品国产欧美kt∨| 日本不卡一区二区三区| 日韩精品中文字幕在线不卡尤物| 久久久久国产精品厨房| 日本成人中文字幕| 91在线porny国产在线看| 欧美猛男超大videosgay| 一区二区三区色| 日本大香伊一区二区三区| 亚洲综合在线观看视频| 欧美xxxx在线观看| 极品美女销魂一区二区三区免费| 亚洲一二三区视频在线观看| 国产精品传媒在线| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美在线观看一二区| 一本久久精品一区二区| 成人午夜又粗又硬又大| 国产一区二区在线看| 一片黄亚洲嫩模| 91国内精品野花午夜精品| 国产精品福利影院| 欧美亚洲综合另类| 麻豆精品国产91久久久久久| 国产精品的网站| 欧美精品视频www在线观看| 极品少妇xxxx精品少妇| 亚洲天堂av一区| 日韩你懂的在线观看| 久久99精品久久久久久| 久久久不卡网国产精品二区| 成人黄色小视频| 欧美a一区二区| 亚洲国产日韩a在线播放| 日本人妖一区二区| 欧美一区二区三区日韩| 国产91高潮流白浆在线麻豆| 亚洲小说欧美激情另类| 国产精品美女视频| 国产喂奶挤奶一区二区三区| 26uuu国产日韩综合| 精品国产一区二区精华| 欧美国产精品v| 亚洲乱码国产乱码精品精可以看| 亚洲国产日韩一级| 日韩成人dvd| 成人av免费在线观看| 色综合久久99| 日本一区二区成人| 午夜精品在线看| 国产一区欧美日韩| 亚洲国产你懂的| 欧美不卡一区二区三区| 欧美这里有精品| 7777精品伊人久久久大香线蕉| 成人黄色免费短视频| 成人在线视频一区二区| 不卡的av在线播放| 91福利资源站| 日韩视频免费观看高清完整版在线观看| 不卡的电影网站| 成人美女视频在线看| 蜜桃在线一区二区三区| 日韩一级片在线观看| 久久福利视频一区二区| 久久久久99精品国产片| 成人avav影音| 一区二区三区中文字幕电影 | 亚洲美腿欧美偷拍| 欧美视频第二页| 美女被吸乳得到大胸91| 26uuu欧美日本| 亚洲午夜在线视频| 日韩高清中文字幕一区| 99久久99久久精品免费看蜜桃| 日本久久电影网| 成人精品视频一区二区三区| 97久久精品人人澡人人爽| 国产v综合v亚洲欧| 欧美三片在线视频观看| 国产精品午夜在线观看| 午夜亚洲福利老司机| 欧美xxxxxxxxx| 亚洲国产成人高清精品| 在线免费观看成人短视频| 亚洲精品一二三区| 欧美在线观看一区二区| 五月综合激情网| 欧美疯狂性受xxxxx喷水图片| 麻豆91免费观看| 国产精品久久久久久久午夜片| 91在线精品秘密一区二区| 亚洲欧美aⅴ...| 欧美日韩久久一区二区| 亚洲va欧美va人人爽午夜| 99精品久久只有精品| 久久午夜羞羞影院免费观看| 亚洲男同性视频| 国产大片一区二区| 欧美大片一区二区三区| 丝袜a∨在线一区二区三区不卡| 国产麻豆精品在线| 久久综合久久99| 国产成人午夜精品5599 | 久久蜜桃一区二区| 亚洲国产精品一区二区www在线| 91精品国产91久久久久久最新毛片 | 国产老妇另类xxxxx| 亚洲午夜av在线|