From d517438282f248abf7bdb2286214ba965ba7ab32 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 21 Jul 1999 21:16:21 +0000 Subject: [PATCH] on news migration on UNIX, heed the news.directory pref. thanks to tenthumbs@cybernex.net for reminding me about this. --- mailnews/base/src/nsMsgAccountManager.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mailnews/base/src/nsMsgAccountManager.cpp b/mailnews/base/src/nsMsgAccountManager.cpp index e6c8934de37..95f7a1f796a 100644 --- a/mailnews/base/src/nsMsgAccountManager.cpp +++ b/mailnews/base/src/nsMsgAccountManager.cpp @@ -1492,15 +1492,29 @@ nsMsgAccountManager::MigrateNewsAccounts(nsIMsgIdentity *identity, PRInt32 baseA inputStream.close(); #else + char *news_directory_value = nsnull; + nsFileSpec dirWithTheNewsrcFiles; + rv = m_prefs->CopyCharPref("news.directory", &news_directory_value); + if (NS_SUCCEEDED(rv)) { + dirWithTheNewsrcFiles = news_directory_value; + PR_FREEIF(news_directory_value); + news_directory_value = nsnull; + } + else { + // if that fails, use the home directory + #ifdef XP_UNIX - nsSpecialSystemDirectory dirWithTheNewsrcFiles(nsSpecialSystemDirectory::Unix_HomeDirectory); + nsSpecialSystemDirectory homeDir(nsSpecialSystemDirectory::Unix_HomeDirectory); #elif XP_BEOS - nsSpecialSystemDirectory dirWithTheNewsrcFiles(nsSpecialSystemDirectory::BeOS_HomeDirectory); + nsSpecialSystemDirectory homeDir(nsSpecialSystemDirectory::BeOS_HomeDirectory); #else #error where_are_your_newsrc_files #endif /* XP_UNIX, XP_BEOS */ + dirWithTheNewsrcFiles = homeDir; + } + for (nsDirectoryIterator i(dirWithTheNewsrcFiles); i.Exists(); i++) { nsFileSpec possibleRcFile = i.Spec();