Bug 420459 Move mailnews-specific profe code. r=benjamin,Neil,sr=dmose,a1.9=beltzner
authorbugzilla@standard8.plus.com
Mon, 17 Mar 2008 12:05:24 -0700
changeset 13189 9bed0cf5248e7d02ecf37ebb214f7705aa6acf9e
parent 13188 0f5bfa374f0a2c54e7b54704cc1bb9c7895f7ca8
child 13190 3adda797ab437e6e485d8f20ac4498df038d1aef
push idunknown
push userunknown
push dateunknown
reviewersbenjamin, Neil, dmose
bugs420459
milestone1.9b5pre
Bug 420459 Move mailnews-specific profe code. r=benjamin,Neil,sr=dmose,a1.9=beltzner
profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp
toolkit/xre/nsXREDirProvider.cpp
xpcom/io/nsAppDirectoryServiceDefs.h
--- a/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp
+++ b/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp
@@ -57,20 +57,16 @@
 #define USER_CHROME_DIR_50_NAME      NS_LITERAL_CSTRING("chrome")
 #define LOCAL_STORE_FILE_50_NAME     NS_LITERAL_CSTRING("localstore.rdf")
 #define HISTORY_FILE_50_NAME         NS_LITERAL_CSTRING("history.dat")
 #define PANELS_FILE_50_NAME          NS_LITERAL_CSTRING("panels.rdf")
 #define MIME_TYPES_FILE_50_NAME      NS_LITERAL_CSTRING("mimeTypes.rdf")
 #define BOOKMARKS_FILE_50_NAME       NS_LITERAL_CSTRING("bookmarks.html")
 #define DOWNLOADS_FILE_50_NAME       NS_LITERAL_CSTRING("downloads.rdf")
 #define SEARCH_FILE_50_NAME          NS_LITERAL_CSTRING("search.rdf" )
-#define MAIL_DIR_50_NAME             NS_LITERAL_CSTRING("Mail")
-#define IMAP_MAIL_DIR_50_NAME        NS_LITERAL_CSTRING("ImapMail")
-#define NEWS_DIR_50_NAME             NS_LITERAL_CSTRING("News")
-#define MSG_FOLDER_CACHE_DIR_50_NAME NS_LITERAL_CSTRING("panacea.dat")
 #define STORAGE_FILE_50_NAME         NS_LITERAL_CSTRING("storage.sdb")
 
 //*****************************************************************************
 // nsProfileDirServiceProvider::nsProfileDirServiceProvider
 //*****************************************************************************
 
 nsProfileDirServiceProvider::nsProfileDirServiceProvider(PRBool aNotifyObservers) :
 #ifdef MOZ_PROFILELOCKING
@@ -296,36 +292,16 @@ nsProfileDirServiceProvider::GetFile(con
   else if (strcmp(prop, NS_APP_SEARCH_50_FILE) == 0) {
     rv = domainDir->Clone(getter_AddRefs(localFile));
     if (NS_SUCCEEDED(rv)) {
       rv = localFile->AppendNative(SEARCH_FILE_50_NAME);
       if (NS_SUCCEEDED(rv))
         rv = EnsureProfileFileExists(localFile, domainDir);
     }
   }
-  else if (strcmp(prop, NS_APP_MAIL_50_DIR) == 0) {
-    rv = domainDir->Clone(getter_AddRefs(localFile));
-    if (NS_SUCCEEDED(rv))
-      rv = localFile->AppendNative(MAIL_DIR_50_NAME);
-  }
-  else if (strcmp(prop, NS_APP_IMAP_MAIL_50_DIR) == 0) {
-    rv = domainDir->Clone(getter_AddRefs(localFile));
-    if (NS_SUCCEEDED(rv))
-      rv = localFile->AppendNative(IMAP_MAIL_DIR_50_NAME);
-  }
-  else if (strcmp(prop, NS_APP_NEWS_50_DIR) == 0) {
-    rv = domainDir->Clone(getter_AddRefs(localFile));
-    if (NS_SUCCEEDED(rv))
-      rv = localFile->AppendNative(NEWS_DIR_50_NAME);
-  }
-  else if (strcmp(prop, NS_APP_MESSENGER_FOLDER_CACHE_50_DIR) == 0) {
-    rv = domainDir->Clone(getter_AddRefs(localFile));
-    if (NS_SUCCEEDED(rv))
-      rv = localFile->AppendNative(MSG_FOLDER_CACHE_DIR_50_NAME);
-  }
   else if (strcmp(prop, NS_APP_STORAGE_50_FILE) == 0) {
     rv = domainDir->Clone(getter_AddRefs(localFile));
     if (NS_SUCCEEDED(rv))
       rv = localFile->AppendNative(STORAGE_FILE_50_NAME);
   }
 
   
   if (localFile && NS_SUCCEEDED(rv))
@@ -508,20 +484,16 @@ nsProfileDirServiceProvider::UndefineFil
   (void) directoryService->Undefine(NS_APP_USER_CHROME_DIR);
   (void) directoryService->Undefine(NS_APP_LOCALSTORE_50_FILE);
   (void) directoryService->Undefine(NS_APP_HISTORY_50_FILE);
   (void) directoryService->Undefine(NS_APP_USER_PANELS_50_FILE);
   (void) directoryService->Undefine(NS_APP_USER_MIMETYPES_50_FILE);
   (void) directoryService->Undefine(NS_APP_BOOKMARKS_50_FILE);
   (void) directoryService->Undefine(NS_APP_DOWNLOADS_50_FILE);
   (void) directoryService->Undefine(NS_APP_SEARCH_50_FILE);
-  (void) directoryService->Undefine(NS_APP_MAIL_50_DIR);
-  (void) directoryService->Undefine(NS_APP_IMAP_MAIL_50_DIR);
-  (void) directoryService->Undefine(NS_APP_NEWS_50_DIR);
-  (void) directoryService->Undefine(NS_APP_MESSENGER_FOLDER_CACHE_50_DIR);
 
   return NS_OK;
 }
 
 //*****************************************************************************
 // Global creation function
 //*****************************************************************************
 
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -372,29 +372,16 @@ nsXREDirProvider::GetFile(const char* aP
     else if (!strcmp(aProperty, NS_APP_DOWNLOADS_50_FILE)) {
       rv = file->AppendNative(NS_LITERAL_CSTRING("downloads.rdf"));
     }
     else if (!strcmp(aProperty, NS_APP_PREFS_OVERRIDE_DIR)) {
       rv = mProfileDir->Clone(getter_AddRefs(file));
       rv |= file->AppendNative(NS_LITERAL_CSTRING(PREF_OVERRIDE_DIRNAME));
       rv |= EnsureDirectoryExists(file);
     }
-    // XXXbsmedberg move these defines into application-specific providers.
-    else if (!strcmp(aProperty, NS_APP_MAIL_50_DIR)) {
-      rv = file->AppendNative(NS_LITERAL_CSTRING("Mail"));
-    }
-    else if (!strcmp(aProperty, NS_APP_IMAP_MAIL_50_DIR)) {
-      rv = file->AppendNative(NS_LITERAL_CSTRING("ImapMail"));
-    }
-    else if (!strcmp(aProperty, NS_APP_NEWS_50_DIR)) {
-      rv = file->AppendNative(NS_LITERAL_CSTRING("News"));
-    }
-    else if (!strcmp(aProperty, NS_APP_MESSENGER_FOLDER_CACHE_50_DIR)) {
-      rv = file->AppendNative(NS_LITERAL_CSTRING("panacea.dat"));
-    }
   }
   if (NS_FAILED(rv) || !file)
     return NS_ERROR_FAILURE;
 
   if (ensureFilePermissions) {
     PRBool fileToEnsureExists;
     PRBool isWritable;
     if (NS_SUCCEEDED(file->Exists(&fileToEnsureExists)) && fileToEnsureExists
--- a/xpcom/io/nsAppDirectoryServiceDefs.h
+++ b/xpcom/io/nsAppDirectoryServiceDefs.h
@@ -112,17 +112,12 @@
 #define NS_APP_CACHE_PARENT_DIR                 "cachePDir"
 
 #define NS_APP_BOOKMARKS_50_FILE                "BMarks"
 
 #define NS_APP_DOWNLOADS_50_FILE                "DLoads"
          
 #define NS_APP_SEARCH_50_FILE                   "SrchF"
          
-#define NS_APP_MAIL_50_DIR                      "MailD"
-#define NS_APP_IMAP_MAIL_50_DIR                 "IMapMD"
-#define NS_APP_NEWS_50_DIR                      "NewsD"
-#define NS_APP_MESSENGER_FOLDER_CACHE_50_DIR    "MFCaD"
-
 #define NS_APP_INSTALL_CLEANUP_DIR              "XPIClnupD"  //location of xpicleanup.dat xpicleanup.exe 
 
 #define NS_APP_STORAGE_50_FILE                  "UStor" // sqlite database used as mozStorage profile db
 #endif