a bunch of changes, all reviewed by mscott.

fix some bugs with next, back, and cancel in the profile manager.
(#15223, #15271)
re-write all callers of nsProfile::GetCurrentProfileDir() to use the file locator.
(#15063)
more profile code clean up. (#15042)
rename the old 4.x history.dat file.  it's called history.dat in 5.0, but the file
formats are different.  (binary in 4.x, vs mork in 5.0)
This commit is contained in:
sspitzer%netscape.com 1999-10-05 04:12:58 +00:00
Родитель 9c950a3a20
Коммит 06c28b31e7
21 изменённых файлов: 249 добавлений и 437 удалений

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

@ -33,6 +33,8 @@
#include "nsIMsgBiffManager.h"
#include "nscore.h"
#include "nsIProfile.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#include "nsCRT.h" // for nsCRT::strtok
#include "prprf.h"
#include "nsINetSupportDialogService.h"
@ -68,9 +70,10 @@ static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
static NS_DEFINE_CID(kMsgBiffManagerCID, NS_MSGBIFFMANAGER_CID);
static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
static NS_DEFINE_CID(kCNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
static NS_DEFINE_CID(kStandardUrlCID, NS_STANDARDURL_CID);
static NS_DEFINE_CID(kSmtpServiceCID, NS_SMTPSERVICE_CID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
#define IMAP_SCHEMA "imap:/"
#define IMAP_SCHEMA_LENGTH 6
@ -1721,25 +1724,11 @@ nsMsgAccountManager::CreateLocalMailAccount(nsIMsgIdentity *identity)
}
if (NS_FAILED(rv)) {
nsFileSpec profileDir;
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
// we want <profile>/Mail
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = profile->GetCurrentProfileDir(&profileDir);
if (NS_FAILED(rv)) return rv;
dir = profileDir;
// we want <profile>/Mail, not <profile>
dir += NEW_MAIL_DIR_NAME;
// create <profile>/Mail if it doesn't exist
if (!dir.Exists()) {
dir.CreateDir();
}
rv = NS_NewFileSpecWithSpec(dir, getter_AddRefs(mailDir));
rv = locator->GetFileLocation(nsSpecialFileSpec::App_MailDirectory50, getter_AddRefs(mailDir));
if (NS_FAILED(rv)) return rv;
}
@ -1831,25 +1820,11 @@ nsMsgAccountManager::MigrateLocalMailAccount(nsIMsgIdentity *identity)
// if they used -installer, this pref will point to where their files got copied
rv = m_prefs->GetFilePref(PREF_MAIL_DIRECTORY, getter_AddRefs(mailDir));
if (NS_FAILED(rv)) {
nsFileSpec profileDir;
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
// we want <profile>/Mail
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = profile->GetCurrentProfileDir(&profileDir);
if (NS_FAILED(rv)) return rv;
dir = profileDir;
// we want <profile>/Mail, not <profile>
dir += NEW_MAIL_DIR_NAME;
// create <profile>/Mail if it doesn't exist
if (!dir.Exists()) {
dir.CreateDir();
}
rv = NS_NewFileSpecWithSpec(dir, getter_AddRefs(mailDir));
rv = locator->GetFileLocation(nsSpecialFileSpec::App_MailDirectory50, getter_AddRefs(mailDir));
if (NS_FAILED(rv)) return rv;
}
@ -1938,25 +1913,11 @@ nsMsgAccountManager::MigratePopAccount(nsIMsgIdentity *identity)
//
// if the "mail.directory" pref is set, use that.
if (NS_FAILED(rv)) {
nsFileSpec profileDir;
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = profile->GetCurrentProfileDir(&profileDir);
// we wan't <profile>/Mail
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
dir = profileDir;
// we wan't <profile>/Mail, not <profile>
dir += NEW_MAIL_DIR_NAME;
// create <profile>/Mail if it doesn't exist
if (!dir.Exists()) {
dir.CreateDir();
}
rv = NS_NewFileSpecWithSpec(dir, getter_AddRefs(mailDir));
rv = locator->GetFileLocation(nsSpecialFileSpec::App_MailDirectory50, getter_AddRefs(mailDir));
if (NS_FAILED(rv)) return rv;
}
@ -2096,14 +2057,7 @@ nsMsgAccountManager::MigrateImapAccount(nsIMsgIdentity *identity, const char *ho
account->AddIdentity(copied_identity);
// now upgrade all the prefs
nsFileSpec profileDir;
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
rv = profile->GetCurrentProfileDir(&profileDir);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
rv = MigrateOldImapPrefs(server, hostname);
if (NS_FAILED(rv)) return rv;
@ -2115,15 +2069,11 @@ nsMsgAccountManager::MigrateImapAccount(nsIMsgIdentity *identity, const char *ho
rv = m_prefs->GetFilePref(PREF_IMAP_DIRECTORY, getter_AddRefs(imapMailDir));
// if the "mail.imap.root_dir" pref is set, use that.
if (NS_FAILED(rv)) {
dir = profileDir;
// we want <profile>/ImapMail, not <profile>
dir += NEW_IMAPMAIL_DIR_NAME;
if (!dir.Exists()) {
dir.CreateDir();
}
// we want <profile>/ImapMail
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = NS_NewFileSpecWithSpec(dir, getter_AddRefs(imapMailDir));
rv = locator->GetFileLocation(nsSpecialFileSpec::App_ImapMailDirectory50, getter_AddRefs(imapMailDir));
if (NS_FAILED(rv)) return rv;
}
@ -2195,12 +2145,10 @@ nsMsgAccountManager::MigrateOldImapPrefs(nsIMsgIncomingServer *server, const cha
nsresult
nsMsgAccountManager::MigrateNewsAccounts(nsIMsgIdentity *identity)
{
nsresult rv;
nsCOMPtr <nsIFileSpec> news_dir;
nsresult rv;
nsCOMPtr <nsIFileSpec> newsDir;
nsFileSpec newsrcDir; // the directory that holds the newsrc files (and the fat file, if we are using one)
nsFileSpec newsHostsDir; // the directory that holds the host directory, and the summary files.
nsFileSpec profileDir;
// the host directories will be under <profile dir>/News or
// <"news.directory" pref>/News.
//
@ -2213,29 +2161,25 @@ nsMsgAccountManager::MigrateNewsAccounts(nsIMsgIdentity *identity)
// the newsrc files lived. we don't want that for the newsHostsDir.
#ifdef USE_NEWSRC_MAP_FILE
// if they used -installer, this pref will point to where their files got copied
rv = m_prefs->GetFilePref(PREF_NEWS_DIRECTORY, getter_AddRefs(news_dir));
rv = m_prefs->GetFilePref(PREF_NEWS_DIRECTORY, getter_AddRefs(newsDir));
if (NS_SUCCEEDED(rv)) {
rv = news_dir->GetFileSpec(&newsHostsDir);
rv = newsDir->GetFileSpec(&newsHostsDir);
}
#else
rv = NS_ERROR_FAILURE;
#endif /* USE_NEWSRC_MAP_FILE */
if (NS_FAILED(rv)) {
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
rv = profile->GetCurrentProfileDir(&profileDir);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
newsHostsDir = profileDir;
// we want <profile>/News, not <profile>
newsHostsDir += NEW_NEWS_DIR_NAME;
// create <profile>/News if it doesn't exist
if (!newsHostsDir.Exists()) {
newsHostsDir.CreateDir();
}
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = locator->GetFileLocation(nsSpecialFileSpec::App_NewsDirectory50, getter_AddRefs(newsDir));
if (NS_FAILED(rv)) return rv;
}
PRBool dirExists;
rv = newsDir->Exists(&dirExists);
if (!dirExists) {
newsDir->CreateDir();
}
#ifdef USE_NEWSRC_MAP_FILE
@ -2347,16 +2291,16 @@ nsMsgAccountManager::MigrateNewsAccounts(nsIMsgIdentity *identity)
inputStream.close();
#else /* USE_NEWSRC_MAP_FILE */
rv = m_prefs->GetFilePref(PREF_PREMIGRATION_NEWS_DIRECTORY, getter_AddRefs(news_dir));
rv = m_prefs->GetFilePref(PREF_PREMIGRATION_NEWS_DIRECTORY, getter_AddRefs(newsDir));
if (NS_FAILED(rv)) {
#ifdef DEBUG_ACCOUNTMANAGER
printf("%s was not set, attempting to use %s instead.\n",PREF_PREMIGRATION_NEWS_DIRECTORY,PREF_NEWS_DIRECTORY);
#endif
rv = m_prefs->GetFilePref(PREF_NEWS_DIRECTORY, getter_AddRefs(news_dir));
rv = m_prefs->GetFilePref(PREF_NEWS_DIRECTORY, getter_AddRefs(newsDir));
}
if (NS_SUCCEEDED(rv)) {
rv = news_dir->GetFileSpec(&newsrcDir);
rv = newsDir->GetFileSpec(&newsrcDir);
if (NS_FAILED(rv)) return rv;
}
else {

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

@ -25,14 +25,17 @@
#include "nsMsgBaseCID.h"
#include "nsCOMPtr.h"
#include "nsMsgFolderCache.h"
#include "nsIProfile.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#include "nsIMsgStatusFeedback.h"
NS_IMPL_ISUPPORTS(nsMsgMailSession, nsCOMTypeInfo<nsIMsgMailSession>::GetIID());
static NS_DEFINE_CID(kMsgAccountManagerCID, NS_MSGACCOUNTMANAGER_CID);
static NS_DEFINE_CID(kMsgFolderCacheCID, NS_MSGFOLDERCACHE_CID);
static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
//static NS_DEFINE_CID(kMsgIdentityCID, NS_MSGIDENTITY_CID);
//static NS_DEFINE_CID(kPop3IncomingServerCID, NS_POP3INCOMINGSERVER_CID);
//static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
@ -144,26 +147,14 @@ nsresult nsMsgMailSession::GetFolderCache(nsIMsgFolderCache* *aFolderCache)
if (NS_FAILED(rv))
return rv;
nsFileSpec profileDir;
nsCOMPtr <nsIFileSpec> cacheFile;
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
if (NS_FAILED(rv))
return 0;
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = profile->GetCurrentProfileDir(&profileDir);
if (NS_FAILED(rv))
return 0;
rv = locator->GetFileLocation(nsSpecialFileSpec::App_MessengerFolderCache50, getter_AddRefs(cacheFile));
if (NS_FAILED(rv)) return rv;
nsFileSpec folderCache(profileDir);
folderCache += "panacea.dat";
rv = NS_NewFileSpecWithSpec(folderCache, getter_AddRefs(cacheFile));
if (NS_FAILED(rv))
return rv;
m_msgFolderCache->Init(cacheFile);
m_msgFolderCache->Init(cacheFile);
}

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

@ -39,15 +39,18 @@
#include "nsIMsgStatusFeedback.h"
#include "nsIPref.h"
#include "nsIProfile.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#define PREF_MAIL_ROOT_IMAP "mail.root.imap"
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kImapUrlCID, NS_IMAPURL_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
static const char *sequenceString = "SEQUENCE";
static const char *uidString = "UID";
@ -2116,17 +2119,10 @@ nsImapService::GetDefaultLocalPath(nsIFileSpec ** aResult)
rv = prefs->GetFilePref(PREF_MAIL_ROOT_IMAP, aResult);
if (NS_SUCCEEDED(rv)) return rv;
NS_WITH_SERVICE(nsIProfile, profile, NS_PROFILE_PROGID, &rv);
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
nsFileSpec dir;
rv = profile->GetCurrentProfileDir(&dir);
if (NS_FAILED(rv)) return rv;
// we want <profile>/ImapMail not <profile>
dir += "ImapMail";
rv = NS_NewFileSpecWithSpec(dir, aResult);
rv = locator->GetFileLocation(nsSpecialFileSpec::App_ImapMailDirectory50, aResult);
if (NS_FAILED(rv)) return rv;
rv = SetDefaultLocalPath(*aResult);

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

@ -23,7 +23,6 @@
#include "nsIPop3IncomingServer.h"
#include "nsIMsgMailSession.h"
#include "nsIProfile.h"
#include "nsIPref.h"
#include "nsPop3URL.h"
@ -34,15 +33,19 @@
#include "nsXPIDLString.h"
#include "nsCOMPtr.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#define POP3_PORT 110 // The IANA port for Pop3
#define PREF_MAIL_ROOT_POP3 "mail.root.pop3"
#define PREF_MAIL_ROOT_NONE "mail.root.none"
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
static NS_DEFINE_CID(kPop3UrlCID, NS_POP3URL_CID);
static NS_DEFINE_CID(kMsgMailSessionCID, NS_MSGMAILSESSION_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
nsPop3Service::nsPop3Service()
{
@ -305,20 +308,13 @@ nsPop3Service::GetDefaultLocalPath(nsIFileSpec ** aResult)
rv = prefs->GetFilePref(PREF_MAIL_ROOT_POP3, aResult);
if (NS_SUCCEEDED(rv)) return rv;
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
nsFileSpec dir;
rv = profile->GetCurrentProfileDir(&dir);
if (NS_FAILED(rv)) return rv;
// we want <profile>/Mail, not <profile>
dir += "Mail";
rv = SetDefaultLocalPath(*aResult);
rv = locator->GetFileLocation(nsSpecialFileSpec::App_MailDirectory50, aResult);
if (NS_FAILED(rv)) return rv;
rv = NS_NewFileSpecWithSpec(dir, aResult);
rv = SetDefaultLocalPath(*aResult);
return rv;
}

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

@ -19,8 +19,9 @@
#include "nsNntpIncomingServer.h"
#include "nsXPIDLString.h"
#include "nsIPref.h"
#include "nsIProfile.h"
#include "prenv.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#ifdef DEBUG_seth
#define DO_HASHING_OF_HOSTNAME 1
@ -40,6 +41,8 @@
#endif /* XP_UNIX || XP_BEOS */
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
NS_IMPL_ISUPPORTS_INHERITED(nsNntpIncomingServer,
nsMsgIncomingServer,
@ -151,7 +154,6 @@ NS_IMETHODIMP
nsNntpIncomingServer::GetNewsrcRootPath(nsIFileSpec **aNewsrcRootPath)
{
nsresult rv;
nsFileSpec dir;
NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
@ -159,25 +161,23 @@ nsNntpIncomingServer::GetNewsrcRootPath(nsIFileSpec **aNewsrcRootPath)
rv = prefs->GetFilePref(PREF_MAIL_NEWSRC_ROOT, aNewsrcRootPath);
if (NS_SUCCEEDED(rv)) return rv;
#ifdef XP_UNIX
nsFileSpec dir;
// root the newsrc files to <profile>/News, except on UNIX
// on UNIX, set it to ~.
// this may change soon, and on UNIX, the default will also be <profile>/News
char *unixHomeDirectory = PR_GetEnv("HOME");
dir = unixHomeDirectory;
rv = NS_NewFileSpecWithSpec(dir, aNewsrcRootPath);
if (NS_FAILED(rv)) return rv;
#else
NS_WITH_SERVICE(nsIProfile, profile, NS_PROFILE_PROGID, &rv);
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = profile->GetCurrentProfileDir(&dir);
rv = locator->GetFileLocation(nsSpecialFileSpec::App_NewsDirectory50, aNewsrcRootPath);
if (NS_FAILED(rv)) return rv;
dir += NEW_NEWS_DIR_NAME;
#endif /* XP_UNIX */
rv = SetNewsrcRootPath(*aNewsrcRootPath);
if (NS_FAILED(rv)) return rv;
rv = NS_NewFileSpecWithSpec(dir, aNewsrcRootPath);
return rv;
}

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

@ -34,13 +34,13 @@
#include "nsIMessage.h"
#include "nsINetSupportDialogService.h"
#include "nsIPref.h"
#include "nsIProfile.h"
#include "nsCRT.h" // for nsCRT::strtok
#include "nsNntpService.h"
#include "nsIChannel.h"
#include "nsILoadGroup.h"
#include "nsCOMPtr.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#undef GetPort // XXX Windows!
#undef SetPort // XXX Windows!
@ -54,6 +54,8 @@ static NS_DEFINE_CID(kCNNTPNewsgroupCID, NS_NNTPNEWSGROUP_CID);
static NS_DEFINE_CID(kCNNTPNewsgroupPostCID, NS_NNTPNEWSGROUPPOST_CID);
static NS_DEFINE_CID(kCNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
static NS_DEFINE_CID(kCPrefServiceCID, NS_PREF_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
nsNntpService::nsNntpService()
{
@ -958,17 +960,10 @@ nsNntpService::GetDefaultLocalPath(nsIFileSpec ** aResult)
rv = prefs->GetFilePref(PREF_MAIL_ROOT_NNTP, aResult);
if (NS_SUCCEEDED(rv)) return rv;
NS_WITH_SERVICE(nsIProfile, profile, NS_PROFILE_PROGID, &rv);
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
nsFileSpec dir;
rv = profile->GetCurrentProfileDir(&dir);
if (NS_FAILED(rv)) return rv;
// we want <profile>/News, not <profile>
dir += "News";
rv = NS_NewFileSpecWithSpec(dir, aResult);
rv = locator->GetFileLocation(nsSpecialFileSpec::App_NewsDirectory50, aResult);
if (NS_FAILED(rv)) return rv;
rv = SetDefaultLocalPath(*aResult);

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

@ -38,6 +38,8 @@
#include "plstr.h"
#include "prprf.h"
#include "nsXPIDLString.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#include "nsProxiedService.h"
@ -51,8 +53,6 @@
#include "nsPrefMigrationFactory.h"
//#include "nsPMProgressDlg.h"
#define NEW_DIR_PERMISSIONS 00700
#define PREF_FILE_HEADER_STRING "# Mozilla User Preferences "
#if defined(XP_UNIX)
@ -61,18 +61,21 @@
#define SUMMARY_SUFFIX_IN_4x ".summary"
#define COOKIES_FILE_NAME_IN_4x "cookies"
#define BOOKMARKS_FILE_NAME_IN_4x "bookmarks.html"
#define HISTORY_FILE_NAME_IN_4x "history.dat"
#elif defined(XP_MAC)
#define IMAP_MAIL_FILTER_FILE_NAME_IN_4x "<hostname> Rules"
#define POP_MAIL_FILTER_FILE_NAME_IN_4x "Filter Rules"
#define SUMMARY_SUFFIX_IN_4x ".snm"
#define COOKIES_FILE_NAME_IN_4x "MagicCookie"
#define BOOKMARKS_FILE_NAME_IN_4x "Bookmarks.html"
#define HISTORY_FILE_NAME_IN_4x "Netscape History"
#else /* XP_PC */
#define IMAP_MAIL_FILTER_FILE_NAME_IN_4x "rules.dat"
#define POP_MAIL_FILTER_FILE_NAME_IN_4x "rules.dat"
#define SUMMARY_SUFFIX_IN_4x ".snm"
#define COOKIES_FILE_NAME_IN_4x "cookies.txt"
#define BOOKMARKS_FILE_NAME_IN_4x "bookmarks.htm"
#define HISTORY_FILE_NAME_IN_4x "history.dat"
#endif /* XP_UNIX */
#define SUMMARY_SUFFIX_IN_5x ".msf"
@ -80,6 +83,8 @@
#define IMAP_MAIL_FILTER_FILE_NAME_IN_5x "rules.dat"
#define POP_MAIL_FILTER_FILE_NAME_IN_5x "rules.dat"
#define BOOKMARKS_FILE_NAME_IN_5x "bookmarks.html"
#define HISTORY_FILE_NAME_IN_5x "history.dat"
#define RENAMED_OLD_HISTORY_FILE_NAME "old "HISTORY_FILE_NAME_IN_4x
#define PREMIGRATION_PREFIX "premigration"
#define PREF_MAIL_DIRECTORY "mail.directory"
@ -149,7 +154,8 @@ typedef struct
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
static NS_DEFINE_IID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID );
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_IID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID);
static NS_DEFINE_IID(kIPrefMigrationIID, NS_IPREFMIGRATION_IID);
static NS_DEFINE_IID(kPrefMigrationCID, NS_PREFMIGRATION_CID);
@ -159,8 +165,7 @@ static NS_DEFINE_CID(kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
static NS_DEFINE_CID(kCommonDialogsCID, NS_CommonDialog_CID);
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);
static NS_DEFINE_IID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
static PRInt32 gInstanceCnt = 0;
static PRInt32 gLockCnt = 0;
@ -1254,6 +1259,17 @@ nsPrefMigration::DoSpecialUpdates(nsIFileSpec * profilePath)
}
#endif /* IMAP_MAIL_FILTER_FILE_NAME_FORMAT_IN_4x */
// TODO remove any 4.x files that should not be left around
//
// examples: prefs, history
rv = profilePath->AppendRelativeUnixPath(HISTORY_FILE_NAME_IN_5x);
PRBool fileExists;
rv = profilePath->Exists(&fileExists);
if (NS_FAILED(rv)) return rv;
if (fileExists) {
profilePath->Rename(RENAMED_OLD_HISTORY_FILE_NAME);
}
return rv;
}

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

@ -24,11 +24,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = profile
EXPORTS = profileSwitch.h
XPIDLSRCS = nsIProfile.idl
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
include $(topsrcdir)/config/rules.mk

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

@ -20,8 +20,7 @@
MODULE=profile
DEPTH=..\..
EXPORTS= profileSwitch.h \
nsIAccount.h \
EXPORTS=nsIAccount.h \
dialshr.h \
resource.h \
$(NULL)

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

@ -36,8 +36,6 @@ interface nsIFileSpec;
#define NS_PROFILE_PROGID \
"component://netscape/profile/manager"
#define NS_USING_PROFILES 1
#define PREG_PREF "netcenter.register"
%}
@ -47,7 +45,6 @@ interface nsIFileSpec;
interface nsIProfile : nsISupports {
[noscript] void startupWithArgs(in nsICmdLineService cmdLine);
void startup(in string filename);
void shutdown();
[noscript] void getProfileDir(in string profileName,
in nsFileSpec profileDir);

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

@ -92,14 +92,10 @@ function onNext()
return;
}
//dump("***********onNext\n");
if (currentPageTag != "newProfile1_2") {
saveData();
var nextPageTag = testMap[currentPageTag].next;
var url = getUrlFromTag(nextPageTag);
displayPage(url);
}
saveData();
var nextPageTag = testMap[currentPageTag].next;
var url = getUrlFromTag(nextPageTag);
displayPage(url);
}
function onBack()
@ -108,12 +104,10 @@ function onBack()
return;
}
if (currentPageTag != "newProfile1_2") {
saveData();
previousPageTag = testMap[currentPageTag].previous;
var url = grtUrlFromTag(previousPageTag);
displayPage(url);
}
saveData();
previousPageTag = testMap[currentPageTag].previous;
var url = getUrlFromTag(previousPageTag);
displayPage(url);
}
function displayPage(content)
@ -128,10 +122,10 @@ function displayPage(content)
{
contentFrame.setAttribute("src", content);
}
//hack for onLoadHandler problem bug #15458
var tmpUrl = content.split(".");
var tag = tmpUrl[0];
wizardPageLoaded(tag);
//hack for onLoadHandler problem bug #15458
var tmpUrl = content.split(pagePostfix);
var tag = tmpUrl[0];
wizardPageLoaded(tag);
}
}
@ -263,7 +257,13 @@ function ExitApp()
appShell.Quit();
}
function cancelApp()
function onCancel()
{
dump("fix this.\n");
if (top.window.opener) {
// we came from the profile manager window...
window.close();
}
else {
ExitApp()
}
}

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

@ -26,7 +26,7 @@
<box align="horizontal">
<titledbutton id="back" value="&back.label;" onclick="onBack()" align="left" disabled="true" style="margin-top: 1em;"/>
<titledbutton id="next" value="&next.label;" onclick="onNext()" align="left" style="margin-top: 1em;"/>
<titledbutton id="cancel" value="&cancel.label;" onclick="cancelApp()" align="left" style=" margin-top: 1em;"/>
<titledbutton id="cancel" value="&cancel.label;" onclick="onCancel()" align="left" style=" margin-top: 1em;"/>
<titledbutton id="finish" value="&finish.label;" onclick="Finish(opener)" disabled="true" align="left" style=" margin-top: 1em;"/>
</box>

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

@ -7,8 +7,7 @@ profile = profile.QueryInterface(Components.interfaces.nsIProfile);
function openCreateProfile()
{
// Need to call CreateNewProfile xuls
var win = window.openDialog('chrome://profile/content/createProfileWizard.xul', 'CPW', 'chrome');
return win;
window.openDialog('chrome://profile/content/createProfileWizard.xul', 'CPW', 'chrome');
}
function CreateProfile()

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

@ -214,7 +214,6 @@ nsProfile::nsProfile()
nsProfile::~nsProfile()
{
printf("nsProfile::~nsProfile()\n");
}
/*
@ -280,11 +279,6 @@ nsProfile::OpenRegistry()
return rv;
}
NS_IMETHODIMP nsProfile::Shutdown()
{
return NS_OK;
}
NS_IMETHODIMP
nsProfile::StartupWithArgs(nsICmdLineService *cmdLineArgs)
{
@ -302,17 +296,23 @@ nsProfile::StartupWithArgs(nsICmdLineService *cmdLineArgs)
if (cmdLineArgs)
rv = ProcessArgs(cmdLineArgs, &profileDirSet, profileURLStr);
if (!profileDirSet)
if (!profileDirSet) {
rv = LoadDefaultProfileDir(profileURLStr);
if (NS_FAILED(rv)) {
CloseRegistry();
return rv;
}
}
// Closing the registry that was opened in Startup()
rv = CloseRegistry();
if (NS_FAILED(rv)) return rv;
#ifdef DEBUG_profile
printf("Profile Manager : Profile Wizard and Manager activites : End\n");
#endif
return rv;
return NS_OK;
}
@ -381,15 +381,19 @@ nsProfile::LoadDefaultProfileDir(nsCString & profileURLStr)
NS_SIZETOCONTENT, // height
getter_AddRefs(profWindow));
if (NS_FAILED(rv))
{
return rv;
}
if (NS_FAILED(rv)) return rv;
/*
* Start up the main event loop...
*/
rv = profAppShell->Run();
char *currentProfileStr = nsnull;
rv = GetCurrentProfile(&currentProfileStr);
if (NS_FAILED(rv) || !currentProfileStr) {
return NS_ERROR_FAILURE;
}
PR_DELETE(currentProfileStr);
}
if (pregPref && PL_strcmp(isPregInfoSet, REGISTRY_TRUE_STRING) != 0)

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

@ -35,10 +35,13 @@
#include "nsXPIDLString.h"
#include "plstr.h"
#include "rdf.h"
#include "nsCOMPtr.h"
#include "nsIProfile.h"
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
////////////////////////////////////////////////////////////////////////
@ -311,25 +314,23 @@ static NS_DEFINE_CID(kRDFXMLDataSourceCID, NS_RDFXMLDATASOURCE_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
nsresult rv;
// Look for localstore.rdf in the current profile
// directory. Bomb if we can't find it.
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
if (NS_FAILED(rv)) return rv;
nsFileSpec spec;
rv = profile->GetCurrentProfileDir(&spec);
nsCOMPtr <nsIFileSpec> localStoreSpec;
// Look for localstore.rdf in the current profile
// directory. Bomb if we can't find it.
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
// Make sure the profile directory _really exists_ before we try
// to create file in it.
if (! spec.Exists())
return NS_ERROR_UNEXPECTED;
rv = locator->GetFileLocation(nsSpecialFileSpec::App_LocalStore50, getter_AddRefs(localStoreSpec));
if (NS_FAILED(rv)) return rv;
rv = localStoreSpec->GetFileSpec(&spec);
if (NS_FAILED(rv)) return rv;
spec += "localstore.rdf";
if (! spec.Exists())
{
// XXX TODO: rewrite this to use the nsIFileSpec we already have.
if (! spec.Exists()) {
{
nsOutputFileStream os(spec);
@ -345,7 +346,7 @@ static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
// back a read-only directory. Whatever.
if (! spec.Exists())
return NS_ERROR_UNEXPECTED;
}
}
rv = nsComponentManager::CreateInstance(kRDFXMLDataSourceCID,
nsnull,

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

@ -82,7 +82,12 @@ class NS_APPSHELL nsSpecialFileSpec : public nsFileSpec
, App_Registry40 = App_FileBase + 20
, App_Registry50 = App_FileBase + 21
, App_LocalStore50 = App_FileBase + 30
, App_History50 = App_FileBase + 40
, App_MailDirectory50 = App_FileBase + 50
, App_ImapMailDirectory50 = App_FileBase + 60
, App_NewsDirectory50 = App_FileBase + 70
, App_MessengerFolderCache50 = App_FileBase + 80
};
//nsSpecialFileSpec();
nsSpecialFileSpec(Type aType);

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

@ -77,7 +77,6 @@ static PRBool GetProfileDirectory(nsFileSpec& outSpec)
// CreateDefaultProfileDirectorySpec() above.
//----------------------------------------------------------------------------------------
{
//static nsFileSpec* gProfileDir = nsnull;
// pointer so that we can detect whether it has been initialized
if (!gProfileDir)
{
@ -407,7 +406,11 @@ void nsSpecialFileSpec::operator = (Type aType)
}
#endif
case App_BookmarksFile50:
NS_NOTYETIMPLEMENTED("Write me!");
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "bookmarks.html";
break;
}
break;
case App_Registry40:
@ -430,6 +433,48 @@ void nsSpecialFileSpec::operator = (Type aType)
NS_NOTYETIMPLEMENTED("Write me!");
break;
case App_LocalStore50:
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "localstore.rdf";
break;
}
break;
case App_History50:
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "history.dat";
break;
}
break;
case App_MailDirectory50:
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "Mail";
break;
}
break;
case App_ImapMailDirectory50:
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "ImapMail";
break;
}
break;
case App_NewsDirectory50:
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "News";
break;
}
break;
case App_MessengerFolderCache50:
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "panacea.dat";
break;
}
break;
case App_DirectoryBase:
case App_FileBase:
default:
@ -510,9 +555,10 @@ NS_IMETHODIMP nsFileLocator::GetFileLocation(
NS_IMETHODIMP nsFileLocator::ForgetProfileDir()
//----------------------------------------------------------------------------------------
{
delete gProfileDir;
gProfileDir = nsnull;
if (gProfileDir) {
delete gProfileDir;
gProfileDir = nsnull;
}
return NS_OK;
}

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

@ -74,8 +74,6 @@ static NS_DEFINE_CID( kToolkitCoreCID, NS_TOOLKITCORE_CID );
// header file for profile manager
#include "nsIProfile.h"
// Uncomment this line to skip the profile code compilation
//#include "profileSwitch.h"
#if defined(XP_MAC)
@ -115,10 +113,7 @@ static NS_DEFINE_IID(kIWalletServiceIID, NS_IWALLETSERVICE_IID);
static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID);
#endif // NECKO
// defined for profileManager
#if defined(NS_USING_PROFILES)
static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
#endif // NS_USING_PROFILES
/*********************************************
AppCores
@ -537,15 +532,19 @@ static nsresult main1(int argc, char* argv[])
}
rv = appShell->Initialize( cmdLineArgs );
if ( NS_FAILED(rv) )
return rv;
if ( NS_FAILED(rv) ) return rv;
#ifdef DEBUG
printf("initialized appshell\n");
#endif
NS_WITH_SERVICE(nsIProfile, profileMgr, kProfileCID, &rv);
if (NS_SUCCEEDED(rv))
profileMgr->StartupWithArgs(cmdLineArgs);
if ( NS_FAILED(rv) ) return rv;
rv = profileMgr->StartupWithArgs(cmdLineArgs);
if (NS_FAILED(rv)) {
return rv;
}
if ( CheckAndRunPrefs(cmdLineArgs) )
return NS_OK;
@ -701,19 +700,6 @@ int main(int argc, char* argv[])
nsresult result = main1( argc, argv );
{
// Scoping this in a block to force the profile service to be
// released.
// this is supposed to happen automatically when XPCOM shuts down, but
// that doesn't always occur!
NS_WITH_SERVICE(nsIProfile, profileMgr, kProfileCID, &rv);
if (NS_SUCCEEDED(rv))
profileMgr->Shutdown();
// calling this explicitly will cut down on a large number of leaks we're
// seeing:
}
#ifdef DETECT_WEBSHELL_LEAKS
if ( unsigned long count = NS_TotalWebShellsInExistence() ) {
printf("XXX WARNING: Number of webshells being leaked: %d \n", count);

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

@ -1,151 +0,0 @@
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks for temp</TITLE>
<H1>Bookmarks for temp</H1>
<DL><p>
<DT><H3 ADD_DATE="916354466">Sample FTP URLs</H3>
<DL><p>
<DT><A HREF="ftp://ftp.netscape.com/" ADD_DATE="0" LAST_VISIT="0" LAST_MODIFIED="0">FTP: Netscape</A>
<DT><A HREF="ftp://xpnav.mcom.com/" ADD_DATE="0" LAST_VISIT="0" LAST_MODIFIED="0">FTP: XPNav</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Sample SmartFind queries</H3>
<DL><p>
<DT><A HREF="find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#Name&method=contains&text=Netscape" ADD_DATE="0" LAST_VISIT="0" LAST_MODIFIED="0">Find: Bookmark Names containing 'Netscape'</A>
<DT><A HREF="find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#Name&method=startswith&text=A" ADD_DATE="0" LAST_VISIT="0" LAST_MODIFIED="0">Find: Bookmark Names starting with 'A'</A>
<DT><A HREF="find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#Name&method=endswith&text=.com" ADD_DATE="0" LAST_VISIT="0" LAST_MODIFIED="0">Find: Bookmark Names ending with '.com'</A>
<DT><A HREF="find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#Name&method=contains&text=Mac" ADD_DATE="0" LAST_VISIT="0" LAST_MODIFIED="0">Find: Bookmark Names containing 'Mac'</A>
<DT><A HREF="find:datasource=rdf:bookmarks&match=http://home.netscape.com/NC-rdf#URL&method=contains&text=mac" ADD_DATE="0" LAST_VISIT="0" LAST_MODIFIED="0">Find: Bookmark URLs containing 'mac'</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Personal Toolbar Folder</H3>
<DL><p>
<DT><A HREF="http://www.mozilla.org" ADD_DATE="916354467" LAST_VISIT="0" LAST_MODIFIED="0">Mozilla.org</A>
<DT><A HREF="http://cvs-mirror.mozilla.org/webtools/tinderbox/showbuilds.cgi?tree=SeaMonkey&nocrap=1" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Tinderbox</A>
<DT><A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Bonsai</A>
<DT><A HREF="http://bugzilla.mozilla.org" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Bugzilla</A>
<DT><H3 ADD_DATE="916354466">Channels</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelautos.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Autos</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelbusiness.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Business</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelcomputingandinternet.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Computing and Internet</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchanneleducation.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Education</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelentertainment.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Entertainment</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelgames.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Games</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelhealth.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Health</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelkidsandfamily.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Kids and Family</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannellifestyles.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Lifestyles</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannellocal.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Local</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelnetscape.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Netscape</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelnews.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">News</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelpersonalfinance.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Personal Finance</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelrealestate.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Real Estate</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelshopping.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Shopping</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchannelsports.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Sports</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ptchanneltravel.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Travel</A>
</DL><p>
</DL><p>
<HR>
<DT><H3 ADD_DATE="916354466">Search</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/altavista.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Alta Vista</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/excite.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Excite</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/goto.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">GoTo.com</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/infoseek.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Infoseek</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/looksmart.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">LookSmart</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/lycos.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Lycos</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/netscapesearch.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Netscape Search</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Business and Finance</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/careercenter.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Career Center</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/cbsmarketwatch.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">CBS.MarketWatch</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/datekonline.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Datek Online</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/dbusiness.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">dbusiness.com</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/gartnergroup.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Gartner Group, Inc.</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/nextcard.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">NextCard Internet Visa</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/personalfinance.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Personal Finance</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/smallbusinesssource.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Small Business Source</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/virtualoffice.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Virtual Office by Netopia</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Computers and Internet</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/gartneratvantage.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">@vantage</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/computingchannel.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Computing Channel</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/netscapechannel.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Netscape Channel</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/onsalecomputer.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">ONSALE Computer Auctions</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/openstudio.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Open Studio</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/professionalconnections.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Professional Connections</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/smartupdate.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">SmartUpdate</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/toshiba.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Toshiba</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Directories</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/gtesuperpages.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">GTE SuperPages</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/memberdirectory.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Member Directory</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/yellowpages.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Netcenter Yellow Pages</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/people.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">People</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/thomasregister.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Thomas Register</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/webdirectory.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Web Directory</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/yellowpagesathand.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">YellowPages AtHand</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Entertainment and Lifestyle</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/entertainmentchannel.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Entertainment Channel</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/games.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Games</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/health.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Health</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/kidsandfamily.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Kids and Family</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/lifestylechannel.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Lifestyle Channel</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/theglobe.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">theglobe.com community</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/tvguide.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">TV Guide</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/women.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Women.com</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">News and Sports</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/abcnews.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">ABCNEWS.com</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/businessjournal.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Business Journal</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/cbssportsline.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">CBS SportsLine</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/inboxdirect.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">In-Box Direct</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/newschannel.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">News Channel</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/sportschannel.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Sports Channel</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Shopping and Classifieds</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/amazon.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Amazon.com</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/audiobookclub.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Audio Book Club</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/dealdeal.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">DealDeal.com Auctions</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/freeride.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">FreeRide</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/ftdflowers.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">FTD Flowers</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/musicboulevard.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Music Boulevard</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/netmarket.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">netMarket</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/realestate.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Real Estate</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/rentnet.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Rent.Net</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/softwaredepot.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Software Depot</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Travel and Leisure</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/leisureplanet.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Leisure Planet</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/local.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Local</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/renaissancecruises.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Renaissance Cruises</A>
<DT><A HREF="http://home.netscape.com/bookmark/4_06/travelocity.html" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Travelocity</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">Macintosh Resources</H3>
<DL><p>
<DT><A HREF="http://www.macosrumors.com/" SHORTCUTURL="rumors" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Mac OS Rumors</A>
<DT><A HREF="http://www.macsurfer.com" SHORTCUTURL="surfer" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">MacSurfer</A>
<DT><A HREF="http://www.macintouch.com/" SHORTCUTURL="macintouch" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Macintouch</A>
<DT><A HREF="http://macweek.zdnet.com/" SHORTCUTURL="macweek" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">MacWEEK</A>
<DT><A HREF="http://www.ogrady.com/" SHORTCUTURL="ogrady" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">O'Grady's Mac PowerPage</A>
</DL><p>
<DT><H3 ADD_DATE="916354466">AAA URLs with no redirection</H3>
<DL><p>
<DT><A HREF="http://home.netscape.com/" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Netscape</A>
<DT><A HREF="http://www.yahoo.com/" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">Yahoo</A>
<DT><A HREF="http://www.aol.com/" ADD_DATE="916354466" LAST_VISIT="0" LAST_MODIFIED="0">AOL</A>
</DL><p>
<HR>
<DT><H3 ADD_DATE="916354466">Personal Bookmarks</H3>
<DL><p>
</DL><p>
</DL><p>

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

@ -72,7 +72,10 @@
#include "nsIChannel.h"
#include "nsIHTTPChannel.h"
#include "nsHTTPEnums.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
#include "nsIInputStream.h"
#include "nsIBufferInputStream.h"
@ -95,7 +98,9 @@ static NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kRDFContainerCID, NS_RDFCONTAINER_CID);
static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
//static NS_DEFINE_CID(kNSCOMMONDIALOGSCID, NS_CommonDialog_CID);
//static NS_DEFINE_IID(kNSCOMMONDIALOGSIID, NS_ICOMMONDIALOGS_IID);
@ -107,7 +112,8 @@ static NS_DEFINE_IID(kIRDFResourceIID, NS_IRDFRESOURCE_IID);
static NS_DEFINE_IID(kIRDFLiteralIID, NS_IRDFLITERAL_IID);
static NS_DEFINE_IID(kIRDFIntIID, NS_IRDFINT_IID);
static NS_DEFINE_IID(kIRDFDateIID, NS_IRDFDATE_IID);
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
static const char kURINC_BookmarksRoot[] = "NC:BookmarksRoot"; // XXX?
static const char kURINC_IEFavoritesRoot[] = "NC:IEFavoritesRoot"; // XXX?
@ -3097,31 +3103,16 @@ nsBookmarksService::GetBookmarksFile(nsFileSpec* aResult)
// still deal reasonably (in the short term) when no
// bookmarks.html is installed in the profile directory.
do {
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
nsCOMPtr <nsIFileSpec> bookmarksFile;
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) break;
rv = profile->GetCurrentProfileDir(aResult);
rv = locator->GetFileLocation(nsSpecialFileSpec::App_BookmarksFile50, getter_AddRefs(bookmarksFile));
if (NS_FAILED(rv)) break;
*aResult += "bookmarks.html";
// Note: first try "bookmarks.html" and, if that doesn't exist,
// fallback to trying "bookmark.htm". Do this due to older
// versions of the browser where the name is different per
// platform.
if (! aResult->Exists())
{
// XXX should we NS_RELEASE(*aResult) ???
rv = profile->GetCurrentProfileDir(aResult);
if (NS_FAILED(rv)) break;
*aResult += "bookmark.htm";
if (! aResult->Exists())
{
rv = NS_ERROR_FAILURE;
}
}
rv = bookmarksFile->GetFileSpec(aResult);
if (NS_FAILED(rv)) break;
} while (0);
#ifdef DEBUG

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

@ -35,7 +35,6 @@
#include "nsIEnumerator.h"
#include "nsIGenericFactory.h"
#include "nsIGlobalHistory.h"
#include "nsIProfile.h"
#include "nsIRDFDataSource.h"
#include "nsIRDFService.h"
#include "nsIServiceManager.h"
@ -61,6 +60,9 @@
#include "nsIBrowsingProfile.h"
#endif
#include "nsIFileLocator.h"
#include "nsFileLocations.h"
////////////////////////////////////////////////////////////////////////
// Common CIDs
@ -68,7 +70,9 @@ static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kGenericFactoryCID, NS_GENERICFACTORY_CID);
static NS_DEFINE_CID(kGlobalHistoryCID, NS_GLOBALHISTORY_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
static NS_DEFINE_IID(kIFileLocatorIID, NS_IFILELOCATOR_IID);
#ifdef MOZ_BRPROF
static NS_DEFINE_CID(kBrowsingProfileCID, NS_BROWSINGPROFILE_CID);
@ -1285,20 +1289,17 @@ nsGlobalHistory::OpenDB()
{
nsresult rv;
NS_WITH_SERVICE(nsIProfile, profile, kProfileCID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr <nsIFileSpec> historyFile;
nsFileSpec dbfile;
rv = profile->GetCurrentProfileDir(&dbfile);
NS_WITH_SERVICE(nsIFileLocator, locator, kFileLocatorCID, &rv);
if (NS_FAILED(rv)) return rv;
// Urgh. No profile directory. Use tmp instead.
if (! dbfile.Exists()) {
// XXX Probably should warn user before doing this. Oh well.
dbfile = nsSpecialSystemDirectory(nsSpecialSystemDirectory::OS_TemporaryDirectory);
}
rv = locator->GetFileLocation(nsSpecialFileSpec::App_History50, getter_AddRefs(historyFile));
if (NS_FAILED(rv)) return rv;
dbfile += "history.dat";
rv = historyFile->GetFileSpec(&dbfile);
if (NS_FAILED(rv)) return rv;
// Leaving XPCOM, entering Mork. The IID is a lie; the component
// manager appears to be used solely to get dynamic loading of the