(215094) Make profile migrator build and somewhat run on Linux

This commit is contained in:
ben%bengoodger.com 2004-02-29 00:48:11 +00:00
Родитель 760040ffcb
Коммит cbbf75bb26
8 изменённых файлов: 43 добавлений и 5 удалений

Просмотреть файл

@ -50,7 +50,7 @@ var MigrationWizard = {
var contractID = kProfileMigratorContractIDPrefix + suffix;
var migrator = Components.classes[contractID].createInstance(kIMig);
if (!migrator.sourceExists)
group.childNodes[i].setAttribute("disabled", "true");
group.childNodes[i].disabled = true;
}
group.selectedItem = this._source == "" ? group.firstChild : document.getElementById(this._source);

Просмотреть файл

@ -72,9 +72,11 @@
<radio id="seamonkey" label="&importFromSeamonkey.label;" accesskey="&importFromSeamonkey.accesskey;"/>
<radio id="dogbert" label="&importFromNetscape4.label;" accesskey="&importFromNetscape4.accesskey;"/>
<radio id="opera" label="&importFromOpera.label;" accesskey="&importFromOpera.accesskey;"/>
<!--
<radio id="konqueror" label="&importFromKonqueror.label;" accesskey="&importFromKonqueror.accesskey;"/>
<radio id="epiphany" label="&importFromEpiphany.label;" accesskey="&importFromEpiphany.accesskey;"/>
<radio id="galeon" label="&importFromGaleon.label;" accesskey="&importFromGaleon.accesskey;"/>
-->
#endif
#endif
#ifdef XP_WIN

Просмотреть файл

@ -19,8 +19,8 @@
<!ENTITY importFromOmniWeb.accesskey "W">
<!ENTITY importFromICab.label "iCab">
<!ENTITY importFromICab.accesskey "i">
<!ENTITY importFromKonquerror.label "Konqueror">
<!ENTITY importFromKonquerror.accesskey "K">
<!ENTITY importFromKonqueror.label "Konqueror">
<!ENTITY importFromKonqueror.accesskey "K">
<!ENTITY importFromEpiphany.label "Epiphany">
<!ENTITY importFromEpiphany.accesskey "E">
<!ENTITY importFromGaleon.label "Galeon">

Просмотреть файл

@ -70,4 +70,5 @@ typedef struct {
PRBool replaceOnly;
} MIGRATIONDATA;
#endif
#endif

Просмотреть файл

@ -218,6 +218,8 @@ nsDogbertProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
nsresult rv = NS_NewISupportsArray(getter_AddRefs(mProfiles));
if (NS_FAILED(rv)) return rv;
// XXXben - this is a little risky.. let's make this actually go and use the
// 4.x registry instead...
// Our profile manager stores information about the set of Dogbert Profiles we have.
nsCOMPtr<nsIProfileInternal> pmi(do_CreateInstance("@mozilla.org/profile/manager;1"));
PRUnichar** profileNames = nsnull;

Просмотреть файл

@ -81,6 +81,11 @@ static NS_DEFINE_CID(kGlobalHistoryCID, NS_GLOBALHISTORY_CID);
#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("Opera 6 Preferences")
#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("Opera Global History")
#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Bookmarks")
#elif defined (XP_UNIX)
#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING(".opera")
#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini")
#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat")
#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr")
#endif
#define OPERA_COOKIES_FILE_NAME NS_LITERAL_STRING("cookies4.dat")
@ -185,7 +190,7 @@ nsOperaProfileMigrator::GetSourceHasMultipleProfiles(PRBool* aResult)
nsCOMPtr<nsISupportsArray> profiles;
GetSourceProfiles(getter_AddRefs(profiles));
#ifndef XP_MACOSX
#ifdef XP_WIN
if (profiles) {
PRUint32 count;
profiles->Count(&count);
@ -243,6 +248,19 @@ nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
PRBool exists;
file->Exists(&exists);
if (exists) {
nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
mProfiles->AppendElement(string);
}
#elif defined (XP_UNIX)
fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
file->Append(OPERA_PREFERENCES_FOLDER_NAME);
PRBool exists;
file->Exists(&exists);
if (exists) {
nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
@ -1252,6 +1270,10 @@ nsOperaProfileMigrator::GetOperaProfile(const PRUnichar* aProfile, nsILocalFile*
fileLocator->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
file->Append(NS_LITERAL_STRING("Preferences"));
file->Append(OPERA_PREFERENCES_FOLDER_NAME);
#elif defined (XP_UNIX)
fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
file->Append(OPERA_PREFERENCES_FOLDER_NAME);
#endif

Просмотреть файл

@ -271,8 +271,14 @@ nsPhoenixProfileMigrator::FillProfileDataFromPhoenixRegistry()
phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix"));
phoenixRegistry->Append(NS_LITERAL_STRING("Application Registry"));
#elif defined(XP_UNIX)
fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));
phoenixRegistry->Append(NS_LITERAL_STRING(".phoenix"));
phoenixRegistry->Append(NS_LITERAL_STRING("appreg"));
#endif
return GetProfileDataFromRegistry(phoenixRegistry, mProfileNames, mProfileLocations);
}

Просмотреть файл

@ -261,6 +261,11 @@ nsSeamonkeyProfileMigrator::FillProfileDataFromSeamonkeyRegistry()
seamonkeyRegistry->Append(NS_LITERAL_STRING("Mozilla"));
seamonkeyRegistry->Append(NS_LITERAL_STRING("Application Registry"));
#elif defined(XP_UNIX)
fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(seamonkeyRegistry));
seamonkeyRegistry->Append(NS_LITERAL_STRING(".mozilla"));
seamonkeyRegistry->Append(NS_LITERAL_STRING("appreg"));
#endif
return GetProfileDataFromRegistry(seamonkeyRegistry, mProfileNames, mProfileLocations);