Bug 1402750 - Replace Append(NS_LITERAL_STRING("")) with AppendLiteral(u""). r=aceman
authorJorg K <jorgk@jorgk.com>
Wed, 27 Sep 2017 01:02:10 +0200
changeset 22214 591d9466d703c542d08a213dbe247caf47d2e59f
parent 22213 8f431a95645cdf312393eac5f0a2ad5a57839706
child 22215 c22438736507c0261e2a9e995cdfd4fe0e544d41
push id13555
push usermozilla@jorgk.com
push dateTue, 26 Sep 2017 23:03:28 +0000
treeherdercomm-central@3f2554599137 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1402750
Bug 1402750 - Replace Append(NS_LITERAL_STRING("")) with AppendLiteral(u""). r=aceman
mail/components/search/nsMailWinSearchHelper.cpp
mailnews/base/public/msgCore.h
mailnews/base/src/nsMessengerWinIntegration.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/imap/src/nsImapMailFolder.cpp
--- a/mail/components/search/nsMailWinSearchHelper.cpp
+++ b/mail/components/search/nsMailWinSearchHelper.cpp
@@ -86,17 +86,17 @@ NS_IMETHODIMP nsMailWinSearchHelper::Get
 
     nsString subdirPath;
     rv = subdir->GetPath(subdirPath);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Form a URL as required by the crawl scope manager
     nsString subdirURL(NS_LITERAL_STRING("file:///"));
     subdirURL.Append(subdirPath);
-    subdirURL.Append(NS_LITERAL_STRING("\\"));
+    subdirURL.Append('\\');
 
     BOOL included;
     if (FAILED(crawlScopeManager->IncludedInCrawlScope(subdirURL.get(), &included)))
       return NS_ERROR_FAILURE;
 
     // If even one of the folders isn't there, we return false
     if (!included)
       return NS_OK;
--- a/mailnews/base/public/msgCore.h
+++ b/mailnews/base/public/msgCore.h
@@ -19,22 +19,23 @@ class nsIMsgFolder;
 
 // include common interfaces such as the service manager and the repository....
 #include "nsIServiceManager.h"
 #include "nsIComponentManager.h"
 
 /*
  * The suffix we use for the mail summary file.
  */
-#define SUMMARY_SUFFIX ".msf"
+#define SUMMARY_SUFFIX u".msf"
 
 /*
  * The suffix we use for folder subdirectories.
  */
-#define FOLDER_SUFFIX ".sbd"
+#define FOLDER_SUFFIX u".sbd"
+#define FOLDER_SUFFIX8 ".sbd"
 
 /*
  * These are folder property strings, which are used in several places.
 
  */
 // Most recently used (opened, moved to, got new messages)
 #define MRU_TIME_PROPERTY "MRUTime"
 // Most recently moved to, for recent folders list in move menu
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -46,22 +46,22 @@
 #include "nsMsgUtils.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Services.h"
 #include "nsIMutableArray.h"
 #include "nsArrayUtils.h"
 
 #include "nsToolkitCompsCID.h"
 #include <stdlib.h>
-#define PROFILE_COMMANDLINE_ARG " -profile "
+#define PROFILE_COMMANDLINE_ARG u" -profile "
 
 #define NOTIFICATIONCLASSNAME "MailBiffNotificationMessageWindow"
 #define UNREADMAILNODEKEY u"Software\\Microsoft\\Windows\\CurrentVersion\\UnreadMail\\"
-#define DOUBLE_QUOTE "\""
-#define MAIL_COMMANDLINE_ARG " -mail"
+#define DOUBLE_QUOTE '"'
+#define MAIL_COMMANDLINE_ARG u" -mail"
 #define IDI_MAILBIFF 32576
 #define UNREAD_UPDATE_INTERVAL	(20 * 1000)	// 20 seconds
 #define ALERT_CHROME_URL "chrome://messenger/content/newmailalert.xul"
 #define NEW_MAIL_ALERT_ICON "chrome://messenger/skin/icons/new-mail-alert.png"
 #define SHOW_ALERT_PREF     "mail.biff.show_alert"
 #define SHOW_TRAY_ICON_PREF "mail.biff.show_tray_icon"
 #define SHOW_BALLOON_PREF   "mail.biff.show_balloon"
 #define SHOW_NEW_ALERT_PREF "mail.biff.show_new_alert"
@@ -990,24 +990,24 @@ nsMessengerWinIntegration::UpdateRegistr
     return NS_OK;
 
   // commandliner has to be built in the form of statement
   // which can be open the mailer app to the default user account
   // For given profile 'foo', commandliner will be built as
   // ""<absolute path to application>" -p foo -mail" where absolute
   // path to application is extracted from mAppName
   nsAutoString commandLinerForAppLaunch;
-  commandLinerForAppLaunch.Assign(NS_LITERAL_STRING(DOUBLE_QUOTE));
+  commandLinerForAppLaunch.Assign(DOUBLE_QUOTE);
   commandLinerForAppLaunch.Append(mAppName);
-  commandLinerForAppLaunch.Append(NS_LITERAL_STRING(DOUBLE_QUOTE));
-  commandLinerForAppLaunch.Append(NS_LITERAL_STRING(PROFILE_COMMANDLINE_ARG));
-  commandLinerForAppLaunch.Append(NS_LITERAL_STRING(DOUBLE_QUOTE));
+  commandLinerForAppLaunch.Append(DOUBLE_QUOTE);
+  commandLinerForAppLaunch.AppendLiteral(PROFILE_COMMANDLINE_ARG);
+  commandLinerForAppLaunch.Append(DOUBLE_QUOTE);
   commandLinerForAppLaunch.Append(mProfilePath);
-  commandLinerForAppLaunch.Append(NS_LITERAL_STRING(DOUBLE_QUOTE));
-  commandLinerForAppLaunch.Append(NS_LITERAL_STRING(MAIL_COMMANDLINE_ARG));
+  commandLinerForAppLaunch.Append(DOUBLE_QUOTE);
+  commandLinerForAppLaunch.AppendLiteral(MAIL_COMMANDLINE_ARG);
 
   if (!commandLinerForAppLaunch.IsEmpty())
   {
     nsAutoString pBuffer;
 
     if (!mEmailPrefix.IsEmpty()) {
       pBuffer.Assign(mEmailPrefix);
       pBuffer.Append(NS_ConvertASCIItoUTF16(mEmail));
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -918,17 +918,17 @@ nsresult nsMsgDBFolder::CreateFileForDB(
   dbPath->Exists(&exists);
   if (exists)
   {
     rv = dbPath->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 00600);
     NS_ENSURE_SUCCESS(rv, rv);
     dbPath->GetLeafName(proposedDBName);
   }
   // now, take the ".msf" off
-  proposedDBName.SetLength(proposedDBName.Length() - NS_LITERAL_CSTRING(SUMMARY_SUFFIX).Length());
+  proposedDBName.SetLength(proposedDBName.Length() - NS_LITERAL_STRING(SUMMARY_SUFFIX).Length());
   dbPath->SetLeafName(proposedDBName);
 
   dbPath.forget(dbFile);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::GetMsgDatabase(nsIMsgDatabase** aMsgDatabase)
@@ -3906,17 +3906,17 @@ nsresult nsMsgDBFolder::CreateDirectoryF
   if (pathIsDirectory && !isServer)
   {
     nsAutoString leafName;
     path->GetLeafName(leafName);
     nsAutoString ext;
     int32_t idx = leafName.RFindChar('.');
     if (idx != -1)
       ext = Substring(leafName, idx);
-    if (!ext.EqualsLiteral(FOLDER_SUFFIX))
+    if (!ext.EqualsLiteral(FOLDER_SUFFIX8))  // No overload for char16_t available.
       pathIsDirectory = false;
   }
 
   if(!pathIsDirectory)
   {
     //If the current path isn't a directory, add directory separator
     //and test it out.
     rv = AddDirectorySeparator(path);
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -236,17 +236,17 @@ nsresult nsImapMailFolder::AddDirectoryS
   {
     // don't concat the full separator with .sbd
   }
   else
   {
     // see if there's a dir with the same name ending with .sbd
     nsAutoString leafName;
     path->GetLeafName(leafName);
-    leafName.Append(NS_LITERAL_STRING(FOLDER_SUFFIX));
+    leafName.AppendLiteral(FOLDER_SUFFIX);
     path->SetLeafName(leafName);
   }
 
   return NS_OK;
 }
 
 static bool
 nsShouldIgnoreFile(nsString& name)