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

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

?? nsdogbertprofilemigrator.cpp

?? 現在很火的郵件客戶端軟件thunderbird的源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/* -*- 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 Scott MacGregor * Portions created by the Initial Developer are Copyright (C) 2004 * the Initial Developer. All Rights Reserved. * * Contributor(s): *  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 ***** */// this file is mostly a copy of nsPrefMigration.cpp...old nsFileSpec warts and all#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 "nsDogbertProfileMigrator.h"#include "nsIRelativeFilePref.h"#include "nsAppDirectoryServiceDefs.h"#include "nsVoidArray.h"#include "prprf.h"#include "prmem.h"#include "prio.h"#include "prenv.h"#include "NSReg.h"// lots of includes required for the nsPrefMigration.cpp code that we copied:#include "nsICharsetConverterManager.h"#include "nsIPlatformCharset.h"#include "nsIPref.h"#include "nsIFileSpec.h"#include "nsFileSpec.h"#include "nsFileStream.h"static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);#define MIGRATION_PROPERTIES_URL "chrome://messenger/locale/migration/migration.properties"#ifndef MAXPATHLEN#ifdef _MAX_PATH#define MAXPATHLEN _MAX_PATH#elif defined(CCHMAXPATH)#define MAXPATHLEN CCHMAXPATH#else#define MAXPATHLEN 1024#endif#endif#if defined(XP_UNIX) && !defined(XP_MACOSX)#define PREF_FILE_NAME_IN_4x      "preferences.js"#define IMAP_MAIL_FILTER_FILE_NAME_IN_4x "mailrule"#define POP_MAIL_FILTER_FILE_NAME_IN_4x "mailrule"#define MAIL_SUMMARY_SUFFIX_IN_4x ".summary"#define NEWS_SUMMARY_SUFFIX_IN_4x ".snm"#define NEWSRC_PREFIX_IN_4x ".newsrc-"#define SNEWSRC_PREFIX_IN_4x ".snewsrc-"#define POPSTATE_FILE_IN_4x "popstate"#define PSM_CERT7_DB "cert7.db"#define PSM_KEY3_DB "key3.db"#define PSM_SECMODULE_DB "secmodule.db"#define HOME_ENVIRONMENT_VARIABLE         "HOME"#define PROFILE_HOME_ENVIRONMENT_VARIABLE "PROFILE_HOME"#define DEFAULT_UNIX_PROFILE_NAME         "default"#elif defined(XP_MAC) || defined(XP_MACOSX)#define OLDREG_NAME               "Netscape Registry"#define OLDREG_DIR                NS_MAC_PREFS_DIR#define PREF_FILE_NAME_IN_4x      "Netscape Preferences"#define MAC_RULES_FILE_ENDING_STRING_IN_4X " Rules"#define IMAP_MAIL_FILTER_FILE_NAME_IN_4x "<hostname> Rules"#define POP_MAIL_FILTER_FILE_NAME_IN_4x "Filter Rules"#define MAIL_SUMMARY_SUFFIX_IN_4x ".snm"#define NEWS_SUMMARY_SUFFIX_IN_4x ".snm"#define POPSTATE_FILE_IN_4x "Pop State"#define SECURITY_PATH "Security"#define PSM_CERT7_DB "Certificates7"#define PSM_KEY3_DB "Key Database3"#define PSM_SECMODULE_DB "Security Modules"#else /* XP_WIN || XP_OS2 */#define PREF_FILE_NAME_IN_4x      "prefs.js"#define IMAP_MAIL_FILTER_FILE_NAME_IN_4x "rules.dat"#define POP_MAIL_FILTER_FILE_NAME_IN_4x "rules.dat"#define MAIL_SUMMARY_SUFFIX_IN_4x ".snm"#define NEWS_SUMMARY_SUFFIX_IN_4x ".snm"#define OLDREG_NAME               "nsreg.dat"#ifdef XP_WIN#define OLDREG_DIR                NS_WIN_WINDOWS_DIR#else#define OLDREG_DIR                NS_OS2_DIR#endif// purposely not defined, since it was in the right place// and with the right name in 4.x//#define POPSTATE_FILE_IN_4x "popstate.dat"#define PSM_CERT7_DB "cert7.db"#define PSM_KEY3_DB "key3.db"#define PSM_SECMODULE_DB "secmod.db"#endif /* XP_UNIX */#define SUMMARY_SUFFIX_IN_5x ".msf"#define IMAP_MAIL_FILTER_FILE_NAME_IN_5x "rules.dat"#define POP_MAIL_FILTER_FILE_NAME_IN_5x "rules.dat"#define POPSTATE_FILE_IN_5x	"popstate.dat"// only UNIX had movemail in 4.x#if defined(XP_UNIX) && !defined(XP_MACOSX)#define HAVE_MOVEMAIL 1#endif /* XP_UNIX */#define PREMIGRATION_PREFIX "premigration."#define ADDRBOOK_FILE_EXTENSION_IN_4X  ".na2"#define PREF_FILE_HEADER_STRING "# Mozilla User Preferences    " #define MAX_PREF_LEN 1024// this is for the hidden preference setting in mozilla/modules/libpref/src/init/mailnews.js// pref("mail.migration.copyMailFiles", true);//// see bugzilla bug 80035 (http://bugzilla.mozilla.org/show_bug.cgi?id=80035)//// the default value for this setting is true which means when migrating from// Netscape 4.x, mozilla will copy all the contents of Local Folders and Imap// Folder to the newly created subfolders of migrated mozilla profile// when this value is set to false, mozilla will not copy these contents and// still share them with Netscape 4.x//// Advantages of forbidding copy operation://     reduce the disk usage//     quick migration// Disadvantage of forbidding copy operation://     without perfect lock mechamism, there is possibility of data corruption//     when Netscape 4.x and mozilla run at the same time and access the same//     mail file at the same time#define PREF_MIGRATION_MODE_FOR_MAIL "mail.migration.copyMailFiles"#define PREF_MAIL_DIRECTORY "mail.directory"#define PREF_NEWS_DIRECTORY "news.directory"#define PREF_MAIL_IMAP_ROOT_DIR "mail.imap.root_dir"#define PREF_NETWORK_HOSTS_POP_SERVER "network.hosts.pop_server"#define PREF_4X_NETWORK_HOSTS_IMAP_SERVER "network.hosts.imap_servers"  #define PREF_MAIL_SERVER_TYPE	"mail.server_type"#define PREF_BROWSER_CACHE_DIRECTORY "browser.cache.directory"#define POP_4X_MAIL_TYPE 0#define IMAP_4X_MAIL_TYPE 1#ifdef HAVE_MOVEMAIL#define MOVEMAIL_4X_MAIL_TYPE 2#define NEW_MOVEMAIL_DIR_NAME "movemail"#endif /* HAVE_MOVEMAIL */#if defined(XP_UNIX) && !defined(XP_MACOSX)/* a 4.x profile on UNIX is rooted at something like * "/u/sspitzer/.netscape" * profile + OLD_MAIL_DIR_NAME = "/u/sspitzer/.netscape/../nsmail" = "/u/sspitzer/nsmail" * profile + OLD_NEWS_DIR_NAME = "/u/sspitzer/.netscape/xover-cache" * profile + OLD_IMAPMAIL_DIR_NAME = "/u/sspitzer/.netscape/../ns_imap" = "/u/sspitzer/ns_imap" * which is as good as we're going to get for defaults on UNIX. */#define OLD_MAIL_DIR_NAME "/../nsmail"#define OLD_NEWS_DIR_NAME "/xover-cache"#define OLD_IMAPMAIL_DIR_NAME "/../ns_imap"#else#define OLD_MAIL_DIR_NAME "Mail"#define OLD_NEWS_DIR_NAME "News"#define OLD_IMAPMAIL_DIR_NAME "ImapMail"#endif /* XP_UNIX */#define NEW_MAIL_DIR_NAME "Mail"#define NEW_NEWS_DIR_NAME "News"#define NEW_IMAPMAIL_DIR_NAME "ImapMail"#define NEW_LOCAL_MAIL_DIR_NAME "Local Folders"#define NEW_DIR_SUFFIX "5"#define PREF_FILE_NAME_IN_5x "prefs.js"static PRBool nsCStringEndsWith(nsCString& name, const char *ending);#ifdef NEED_TO_COPY_AND_RENAME_NEWSRC_FILESstatic PRBool nsCStringStartsWith(nsCString& name, const char *starting);#endif///////////////////////////////////////////////////////////////////////////////// nsDogbertProfileMigratorstruct PrefBranchStruct {  char*         prefName;  PRInt32       type;  union {    char*       stringValue;    PRInt32     intValue;    PRBool      boolValue;    PRUnichar*  wstringValue;  };};NS_IMPL_ISUPPORTS2(nsDogbertProfileMigrator, nsIMailProfileMigrator, nsITimerCallback)nsDogbertProfileMigrator::nsDogbertProfileMigrator(){  mObserverService = do_GetService("@mozilla.org/observer-service;1");  mMaxProgress = LL_ZERO;  mCurrentProgress = LL_ZERO;}nsDogbertProfileMigrator::~nsDogbertProfileMigrator(){           }///////////////////////////////////////////////////////////////////////////////// nsITimerCallbackNS_IMETHODIMPnsDogbertProfileMigrator::Notify(nsITimer *timer){  CopyNextFolder();  return NS_OK;}void nsDogbertProfileMigrator::CopyNextFolder() {  if (mFileCopyTransactionIndex < mFileCopyTransactions->Count())  {    PRUint32 percentage = 0;    fileTransactionEntry* fileTransaction = (fileTransactionEntry*) mFileCopyTransactions->SafeElementAt(mFileCopyTransactionIndex++);    if (fileTransaction) // copy the file    {      fileTransaction->srcFile->CopyTo(fileTransaction->destFile, fileTransaction->newName);      // 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 nsDogbertProfileMigrator::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_IMETHODIMPnsDogbertProfileMigrator::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);  rv = CopyPreferences();  return rv;}NS_IMETHODIMPnsDogbertProfileMigrator::GetMigrateData(const PRUnichar* aProfile,                                            PRBool aReplace,                                            PRUint16* aResult){  // 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_IMETHODIMPnsDogbertProfileMigrator::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_IMETHODIMPnsDogbertProfileMigrator::GetSourceHasMultipleProfiles(PRBool* aResult){  nsCOMPtr<nsISupportsArray> profiles;  GetSourceProfiles(getter_AddRefs(profiles));  if (profiles) {    PRUint32 count;    profiles->Count(&count);    *aResult = count > 1;  }  else    *aResult = PR_FALSE;  return NS_OK;}#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_MACOSX)NS_IMETHODIMPnsDogbertProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult){  if (!mProfiles) {    nsresult rv;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影免费一区| 不卡免费追剧大全电视剧网站| 国内一区二区视频| 一本在线高清不卡dvd| 欧美一二三区在线| 亚洲精品中文在线| 国产福利精品一区| 欧美挠脚心视频网站| 国产精品久久三| 蜜臀av性久久久久蜜臀av麻豆| jvid福利写真一区二区三区| 欧美成人艳星乳罩| 午夜精品视频在线观看| 99精品久久免费看蜜臀剧情介绍| 欧美α欧美αv大片| 亚洲一区二区视频| 菠萝蜜视频在线观看一区| 亚洲精品在线电影| 日韩制服丝袜先锋影音| 一本色道**综合亚洲精品蜜桃冫| 国产精品蜜臀av| 经典三级在线一区| 日韩视频一区二区三区 | 欧美精品一区二区在线观看| 亚洲色图在线视频| 成人精品免费视频| 国产视频一区在线观看| 免费高清成人在线| 日韩一区二区三| 蜜臀va亚洲va欧美va天堂| 91精品欧美综合在线观看最新| 亚洲在线观看免费视频| 欧美亚洲日本一区| 一区二区三区加勒比av| 91蜜桃在线观看| 亚洲国产精品99久久久久久久久 | 亚洲国产综合视频在线观看| 一本大道综合伊人精品热热| 综合网在线视频| 91麻豆蜜桃一区二区三区| 亚洲色图在线视频| 91国产视频在线观看| 亚洲成人av资源| 在线不卡的av| 久久精品久久综合| 久久久精品欧美丰满| 成人免费高清视频| 亚洲欧美日本韩国| 欧美精品日韩一区| 精一区二区三区| 中文字幕精品一区| 色婷婷av一区二区三区大白胸| 洋洋成人永久网站入口| 欧美日韩精品免费观看视频 | 国产成人精品亚洲777人妖| 国产区在线观看成人精品| 欧美日韩国产高清一区二区| 性久久久久久久久| 精品国产乱码91久久久久久网站| 国产高清精品网站| 亚洲欧美激情在线| 91精品国产乱码| 国产精华液一区二区三区| 亚洲特级片在线| 欧美精品精品一区| 国产精品99久久久久久似苏梦涵| 成人欧美一区二区三区视频网页 | 亚洲丰满少妇videoshd| 日韩免费高清视频| av综合在线播放| 午夜精品爽啪视频| 国产精品久久久久影院| 欧美日韩国产美女| 成人午夜大片免费观看| 亚州成人在线电影| 欧美国产日本韩| 欧美精品久久一区| www.色精品| 另类专区欧美蜜桃臀第一页| 亚洲日本在线视频观看| 日韩一区二区免费视频| 91在线高清观看| 国精产品一区一区三区mba桃花 | 久久综合久久综合久久| 欧美怡红院视频| 成人高清视频在线观看| 日韩国产欧美在线播放| 亚洲欧美日韩久久| 久久久久久久久久久电影| 欧美人妇做爰xxxⅹ性高电影| 成人午夜在线免费| 伦理电影国产精品| 亚洲国产成人av| 中文字幕在线观看一区二区| 精品国产露脸精彩对白| 欧美一区二区网站| 色吧成人激情小说| gogo大胆日本视频一区| 韩国一区二区三区| 另类小说综合欧美亚洲| 亚洲国产精品久久艾草纯爱| 亚洲精品中文字幕乱码三区| 国产精品视频一区二区三区不卡| 精品剧情v国产在线观看在线| 欧美二区三区91| 久久精品人人爽人人爽| 欧美另类变人与禽xxxxx| 色偷偷成人一区二区三区91| 床上的激情91.| 国产精品1024| 成人高清视频在线观看| 成人免费视频一区| 风间由美性色一区二区三区| 国产精一品亚洲二区在线视频| 久久精品99国产精品日本| 免费人成在线不卡| 视频在线观看一区二区三区| 午夜不卡在线视频| 日韩精品久久久久久| 日本欧美在线观看| 麻豆久久久久久久| 久草热8精品视频在线观看| 久久国产福利国产秒拍| 久久99这里只有精品| 国产一区二区电影| 国产九色sp调教91| 99久久精品免费| 在线影视一区二区三区| 欧美日韩二区三区| 日韩一区二区精品| 久久免费国产精品| 中文字幕在线不卡一区二区三区| 中文字幕一区二区三区在线播放 | 91麻豆精品视频| 亚洲欧美另类久久久精品| 亚洲免费大片在线观看| 亚洲国产aⅴ天堂久久| 日韩精品三区四区| 国产精品原创巨作av| 床上的激情91.| 欧美日韩中文一区| 日韩免费电影一区| 国产精品色噜噜| 亚洲成人福利片| 久久精品国产一区二区| 国产99久久久国产精品潘金网站| 99国产精品久久| 91精品国产综合久久久久| 久久一区二区三区国产精品| 国产精品乱码人人做人人爱| 亚洲福利一区二区| 国产在线精品视频| 色综合中文字幕| 日韩一区二区电影在线| 国产精品乱人伦| 日韩电影在线观看电影| 国产mv日韩mv欧美| 777亚洲妇女| 国产精品成人午夜| 免费高清在线一区| 91麻豆免费视频| 久久精品免费在线观看| 亚洲超碰97人人做人人爱| 国产精品一级片在线观看| 91福利视频久久久久| 久久久久久久久蜜桃| 亚洲午夜久久久久久久久久久 | 人人狠狠综合久久亚洲| www.亚洲精品| 久久亚洲免费视频| 一区二区免费看| 成人av在线资源| 精品国产人成亚洲区| 亚洲一区二区视频在线| 95精品视频在线| 国产午夜精品一区二区| 全国精品久久少妇| 日本高清视频一区二区| 国产免费观看久久| 久久精品国产99国产| 在线成人高清不卡| 一区二区三区免费在线观看| 成人av集中营| 久久先锋资源网| 另类人妖一区二区av| 欧洲国内综合视频| 中文字幕一区不卡| 国产成人精品一区二区三区四区| 精品欧美一区二区三区精品久久 | 激情综合网av| 日韩视频在线你懂得| 日韩高清一区二区| 欧美日韩国产一二三| 亚洲高清一区二区三区| 色噜噜夜夜夜综合网| 亚洲欧洲日韩在线| 成人h版在线观看| 国产精品视频九色porn| 国产91精品一区二区麻豆亚洲| 欧美精品一区男女天堂|