Bug 1482782 - Part 2: Move directory service atoms into nsGkAtoms. r=njn
authorCameron McCormack <cam@mcc.id.au>
Wed, 15 Aug 2018 15:46:00 +1000
changeset 431600 7ef73ff1649501f237c2df7d588ad8f9f544bed8
parent 431599 6c488a5eb81d3e2e41ba0913b2610facf6df465b
child 431601 57507aba8ffd33917ad48c52b29a0fe2dad3f7a1
push id106497
push usercmccormack@mozilla.com
push dateWed, 15 Aug 2018 07:46:59 +0000
treeherdermozilla-inbound@e6a44943b177 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1482782
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1482782 - Part 2: Move directory service atoms into nsGkAtoms. r=njn Summary: Depends On D3280 Reviewers: njn! Tags: #secure-revision Bug #: 1482782 Differential Revision: https://phabricator.services.mozilla.com/D3281
xpcom/ds/StaticAtoms.py
xpcom/io/moz.build
xpcom/io/nsDirectoryService.cpp
xpcom/io/nsDirectoryService.h
xpcom/io/nsDirectoryServiceAtomList.h
xpcom/io/nsDirectoryServiceDefs.h
--- a/xpcom/ds/StaticAtoms.py
+++ b/xpcom/ds/StaticAtoms.py
@@ -2206,16 +2206,42 @@ STATIC_ATOMS = [
     Atom("RDF", "RDF"),
     Atom("Description", "Description"),
     Atom("Bag", "Bag"),
     Atom("Seq", "Seq"),
     Atom("Alt", "Alt"),
     # Atom("kLiAtom", "li"),  # "li" is present above
     # Atom("kXMLNSAtom", "xmlns"),  # "xmlns" is present above
     Atom("parseType", "parseType"),
+
+    # Directory service
+    Atom("DirectoryService_CurrentProcess", "XCurProcD"),
+    Atom("DirectoryService_GRE_Directory", "GreD"),
+    Atom("DirectoryService_GRE_BinDirectory", "GreBinD"),
+    Atom("DirectoryService_OS_TemporaryDirectory", "TmpD"),
+    Atom("DirectoryService_OS_CurrentProcessDirectory", "CurProcD"),
+    Atom("DirectoryService_OS_CurrentWorkingDirectory", "CurWorkD"),
+    # Atom("DirectoryService_OS_HomeDirectory", "Home"),  # "Home" is present above
+    Atom("DirectoryService_OS_DesktopDirectory", "Desk"),
+    Atom("DirectoryService_InitCurrentProcess_dummy", "MozBinD"),
+    Atom("DirectoryService_SystemDirectory", "SysD"),
+    Atom("DirectoryService_UserLibDirectory", "ULibDir"),
+    Atom("DirectoryService_DefaultDownloadDirectory", "DfltDwnld"),
+    Atom("DirectoryService_LocalApplicationsDirectory", "LocApp"),
+    Atom("DirectoryService_UserPreferencesDirectory", "UsrPrfs"),
+    Atom("DirectoryService_PictureDocumentsDirectory", "Pct"),
+    Atom("DirectoryService_WindowsDirectory", "WinD"),
+    Atom("DirectoryService_WindowsProgramFiles", "ProgF"),
+    Atom("DirectoryService_Programs", "Progs"),
+    Atom("DirectoryService_Favorites", "Favs"),
+    Atom("DirectoryService_Appdata", "AppData"),
+    Atom("DirectoryService_LocalAppdata", "LocalAppData"),
+    Atom("DirectoryService_LocalAppdataLow", "LocalAppDataLow"),
+    Atom("DirectoryService_LowIntegrityTempBase", "LowTmpDBase"),
+    Atom("DirectoryService_WinCookiesDirectory", "CookD"),
 ] + HTML_PARSER_ATOMS
 
 
 def verify():
     idents = set()
     strings = set()
     failed = False
     for atom in STATIC_ATOMS:
--- a/xpcom/io/moz.build
+++ b/xpcom/io/moz.build
@@ -60,17 +60,16 @@ else:
 
 XPIDL_MODULE = 'xpcom_io'
 
 EXPORTS += [
     'FileDescriptorFile.h',
     'nsAnonymousTemporaryFile.h',
     'nsAppDirectoryServiceDefs.h',
     'nsDirectoryService.h',
-    'nsDirectoryServiceAtomList.h',
     'nsDirectoryServiceDefs.h',
     'nsDirectoryServiceUtils.h',
     'nsEscape.h',
     'nsLinebreakConverter.h',
     'nsLocalFile.h',
     'nsMultiplexInputStream.h',
     'nsNativeCharsetUtils.h',
     'nsScriptableInputStream.h',
--- a/xpcom/io/nsDirectoryService.cpp
+++ b/xpcom/io/nsDirectoryService.cpp
@@ -89,63 +89,31 @@ nsDirectoryService::Create(nsISupports* 
 
   if (!gService) {
     return NS_ERROR_NOT_INITIALIZED;
   }
 
   return gService->QueryInterface(aIID, aResult);
 }
 
-namespace mozilla {
-namespace detail {
-
-MOZ_PUSH_DISABLE_INTEGRAL_CONSTANT_OVERFLOW_WARNING
-extern constexpr DirectoryAtoms gDirectoryAtoms = {
-  #define DIR_ATOM(name_, value_) NS_STATIC_ATOM_INIT_STRING(value_)
-  #include "nsDirectoryServiceAtomList.h"
-  #undef DIR_ATOM
-  {
-    #define DIR_ATOM(name_, value_) \
-      NS_STATIC_ATOM_INIT_ATOM(nsStaticAtom, DirectoryAtoms, name_, value_)
-    #include "nsDirectoryServiceAtomList.h"
-    #undef DIR_ATOM
-  }
-};
-MOZ_POP_DISABLE_INTEGRAL_CONSTANT_OVERFLOW_WARNING
-
-} // namespace detail
-} // namespace mozilla
-
-const nsStaticAtom* const nsDirectoryService::sAtoms =
-  mozilla::detail::gDirectoryAtoms.mAtoms;
-
-#define DIR_ATOM(name_, value_) \
-  NS_STATIC_ATOM_DEFN_PTR( \
-    nsStaticAtom, mozilla::detail::DirectoryAtoms, \
-    mozilla::detail::gDirectoryAtoms, nsDirectoryService, name_)
-#include "nsDirectoryServiceAtomList.h"
-#undef DIR_ATOM
-
 NS_IMETHODIMP
 nsDirectoryService::Init()
 {
   MOZ_ASSERT_UNREACHABLE("nsDirectoryService::Init() for internal use only!");
   return NS_OK;
 }
 
 void
 nsDirectoryService::RealInit()
 {
   NS_ASSERTION(!gService,
                "nsDirectoryService::RealInit Mustn't initialize twice!");
 
   gService = new nsDirectoryService();
 
-  NS_RegisterStaticAtoms(sAtoms, sAtomsLen);
-
   // Let the list hold the only reference to the provider.
   nsAppFileLocationProvider* defaultProvider = new nsAppFileLocationProvider;
   gService->mProviders.AppendElement(defaultProvider);
 }
 
 nsDirectoryService::~nsDirectoryService()
 {
 }
@@ -414,101 +382,96 @@ nsDirectoryService::GetFile(const char* 
   nsCOMPtr<nsIFile> localFile;
   nsresult rv = NS_ERROR_FAILURE;
 
   *aResult = nullptr;
   *aPersistent = true;
 
   RefPtr<nsAtom> inAtom = NS_Atomize(aProp);
 
-  // Check that nsGkAtoms::Home matches the value that sOS_HomeDirectory would
-  // have if it wasn't commented out to avoid static atom duplication.
-  MOZ_ASSERT(
-    NS_strcmp(nsGkAtoms::Home->GetUTF16String(), u"" NS_OS_HOME_DIR) == 0);
-
   // check to see if it is one of our defaults
 
-  if (inAtom == nsDirectoryService::sCurrentProcess ||
-      inAtom == nsDirectoryService::sOS_CurrentProcessDirectory) {
+  if (inAtom == nsGkAtoms::DirectoryService_CurrentProcess ||
+      inAtom == nsGkAtoms::DirectoryService_OS_CurrentProcessDirectory) {
     rv = GetCurrentProcessDirectory(getter_AddRefs(localFile));
   }
 
   // Unless otherwise set, the core pieces of the GRE exist
   // in the current process directory.
-  else if (inAtom == nsDirectoryService::sGRE_Directory ||
-           inAtom == nsDirectoryService::sGRE_BinDirectory) {
+  else if (inAtom == nsGkAtoms::DirectoryService_GRE_Directory ||
+           inAtom == nsGkAtoms::DirectoryService_GRE_BinDirectory) {
     rv = GetCurrentProcessDirectory(getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sOS_TemporaryDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_OS_TemporaryDirectory) {
     rv = GetSpecialSystemDirectory(OS_TemporaryDirectory, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sOS_CurrentProcessDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_OS_CurrentProcessDirectory) {
     rv = GetSpecialSystemDirectory(OS_CurrentProcessDirectory, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sOS_CurrentWorkingDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_OS_CurrentWorkingDirectory) {
     rv = GetSpecialSystemDirectory(OS_CurrentWorkingDirectory, getter_AddRefs(localFile));
   }
 
 #if defined(MOZ_WIDGET_COCOA)
-  else if (inAtom == nsDirectoryService::sDirectory) {
+  else if (inAtom == nsGkAtoms::DirectoryService_SystemDirectory) {
     rv = GetOSXFolderType(kClassicDomain, kSystemFolderType, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sUserLibDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_UserLibDirectory) {
     rv = GetOSXFolderType(kUserDomain, kDomainLibraryFolderType, getter_AddRefs(localFile));
   } else if (inAtom == nsGkAtoms::Home) {
     rv = GetOSXFolderType(kUserDomain, kDomainTopLevelFolderType, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sDefaultDownloadDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_DefaultDownloadDirectory) {
     rv = GetOSXFolderType(kUserDomain, kDownloadsFolderType,
                           getter_AddRefs(localFile));
     if (NS_FAILED(rv)) {
       rv = GetOSXFolderType(kUserDomain, kDesktopFolderType,
                             getter_AddRefs(localFile));
     }
-  } else if (inAtom == nsDirectoryService::sOS_DesktopDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_OS_DesktopDirectory) {
     rv = GetOSXFolderType(kUserDomain, kDesktopFolderType, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sLocalApplicationsDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_LocalApplicationsDirectory) {
     rv = GetOSXFolderType(kLocalDomain, kApplicationsFolderType, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sUserPreferencesDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_UserPreferencesDirectory) {
     rv = GetOSXFolderType(kUserDomain, kPreferencesFolderType, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sPictureDocumentsDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_PictureDocumentsDirectory) {
     rv = GetOSXFolderType(kUserDomain, kPictureDocumentsFolderType, getter_AddRefs(localFile));
   }
 #elif defined (XP_WIN)
-  else if (inAtom == nsDirectoryService::sSystemDirectory) {
+  else if (inAtom == nsGkAtoms::DirectoryService_SystemDirectory) {
     rv = GetSpecialSystemDirectory(Win_SystemDirectory, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sWindowsDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_WindowsDirectory) {
     rv = GetSpecialSystemDirectory(Win_WindowsDirectory, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sWindowsProgramFiles) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_WindowsProgramFiles) {
     rv = GetSpecialSystemDirectory(Win_ProgramFiles, getter_AddRefs(localFile));
   } else if (inAtom == nsGkAtoms::Home) {
     rv = GetSpecialSystemDirectory(Win_HomeDirectory, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sPrograms) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_Programs) {
     rv = GetSpecialSystemDirectory(Win_Programs, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sFavorites) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_Favorites) {
     rv = GetSpecialSystemDirectory(Win_Favorites, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sOS_DesktopDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_OS_DesktopDirectory) {
     rv = GetSpecialSystemDirectory(Win_Desktopdirectory, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sAppdata) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_Appdata) {
     rv = GetSpecialSystemDirectory(Win_Appdata, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sLocalAppdata) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_LocalAppdata) {
     rv = GetSpecialSystemDirectory(Win_LocalAppdata, getter_AddRefs(localFile));
 #if defined(MOZ_CONTENT_SANDBOX)
-  } else if (inAtom == nsDirectoryService::sLocalAppdataLow) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_LocalAppdataLow) {
     rv = GetSpecialSystemDirectory(Win_LocalAppdataLow, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sLowIntegrityTempBase) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_LowIntegrityTempBase) {
     rv = GetLowIntegrityTempBase(getter_AddRefs(localFile));
 #endif
-  } else if (inAtom == nsDirectoryService::sWinCookiesDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_WinCookiesDirectory) {
     rv = GetSpecialSystemDirectory(Win_Cookies, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sDefaultDownloadDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_DefaultDownloadDirectory) {
     rv = GetSpecialSystemDirectory(Win_Downloads, getter_AddRefs(localFile));
   }
 #elif defined (XP_UNIX)
   else if (inAtom == nsGkAtoms::Home) {
     rv = GetSpecialSystemDirectory(Unix_HomeDirectory, getter_AddRefs(localFile));
-  } else if (inAtom == nsDirectoryService::sOS_DesktopDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_OS_DesktopDirectory) {
     rv = GetSpecialSystemDirectory(Unix_XDG_Desktop, getter_AddRefs(localFile));
     *aPersistent = false;
-  } else if (inAtom == nsDirectoryService::sDefaultDownloadDirectory) {
+  } else if (inAtom == nsGkAtoms::DirectoryService_DefaultDownloadDirectory) {
     rv = GetSpecialSystemDirectory(Unix_XDG_Download, getter_AddRefs(localFile));
     *aPersistent = false;
   }
 #endif
 
   if (NS_FAILED(rv)) {
     return rv;
   }
--- a/xpcom/io/nsDirectoryService.h
+++ b/xpcom/io/nsDirectoryService.h
@@ -5,49 +5,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDirectoryService_h___
 #define nsDirectoryService_h___
 
 #include "nsIDirectoryService.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIFile.h"
-#include "nsAtom.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsStaticAtom.h"
 #include "nsTArray.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/StaticPtr.h"
 
 #define NS_XPCOM_INIT_CURRENT_PROCESS_DIR       "MozBinD"   // Can be used to set NS_XPCOM_CURRENT_PROCESS_DIR
                                                             // CANNOT be used to GET a location
 #define NS_DIRECTORY_SERVICE_CID  {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
 
-namespace mozilla {
-namespace detail {
-
-struct DirectoryAtoms
-{
-  #define DIR_ATOM(name_, value_) NS_STATIC_ATOM_DECL_STRING(name_, value_)
-  #include "nsDirectoryServiceAtomList.h"
-  #undef DIR_ATOM
-
-  enum class Atoms {
-    #define DIR_ATOM(name_, value_) NS_STATIC_ATOM_ENUM(name_)
-    #include "nsDirectoryServiceAtomList.h"
-    #undef DIR_ATOM
-    AtomsCount
-  };
-
-  const nsStaticAtom mAtoms[static_cast<size_t>(Atoms::AtomsCount)];
-};
-
-} // namespace detail
-} // namespace mozilla
-
 class nsDirectoryService final
   : public nsIDirectoryService
   , public nsIProperties
   , public nsIDirectoryServiceProvider2
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
@@ -71,20 +47,11 @@ public:
 
 private:
   ~nsDirectoryService();
 
   nsresult GetCurrentProcessDirectory(nsIFile** aFile);
 
   nsInterfaceHashtable<nsCStringHashKey, nsIFile> mHashtable;
   nsTArray<nsCOMPtr<nsIDirectoryServiceProvider>> mProviders;
-
-  static const nsStaticAtom* const sAtoms;
-  static constexpr size_t sAtomsLen =
-    static_cast<size_t>(mozilla::detail::DirectoryAtoms::Atoms::AtomsCount);
-
-public:
-  #define DIR_ATOM(name_, value_) NS_STATIC_ATOM_DECL_PTR(nsStaticAtom, name_)
-  #include "nsDirectoryServiceAtomList.h"
-  #undef DIR_ATOM
 };
 
 #endif
deleted file mode 100644
--- a/xpcom/io/nsDirectoryServiceAtomList.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-DIR_ATOM(sCurrentProcess, NS_XPCOM_CURRENT_PROCESS_DIR)
-DIR_ATOM(sGRE_Directory, NS_GRE_DIR)
-DIR_ATOM(sGRE_BinDirectory, NS_GRE_BIN_DIR)
-DIR_ATOM(sOS_TemporaryDirectory, NS_OS_TEMP_DIR)
-DIR_ATOM(sOS_CurrentProcessDirectory, NS_OS_CURRENT_PROCESS_DIR)
-DIR_ATOM(sOS_CurrentWorkingDirectory, NS_OS_CURRENT_WORKING_DIR)
-// This one is commented out because nsGkAtoms::Home also exists, and we don't
-// allow duplicate static atoms.
-//DIR_ATOM(sOS_HomeDirectory, NS_OS_HOME_DIR)
-DIR_ATOM(sOS_DesktopDirectory, NS_OS_DESKTOP_DIR)
-DIR_ATOM(sInitCurrentProcess_dummy, NS_XPCOM_INIT_CURRENT_PROCESS_DIR)
-#if defined (MOZ_WIDGET_COCOA)
-DIR_ATOM(sDirectory, NS_OS_SYSTEM_DIR)
-DIR_ATOM(sUserLibDirectory, NS_MAC_USER_LIB_DIR)
-DIR_ATOM(sDefaultDownloadDirectory, NS_OSX_DEFAULT_DOWNLOAD_DIR)
-DIR_ATOM(sLocalApplicationsDirectory, NS_OSX_LOCAL_APPLICATIONS_DIR)
-DIR_ATOM(sUserPreferencesDirectory, NS_OSX_USER_PREFERENCES_DIR)
-DIR_ATOM(sPictureDocumentsDirectory, NS_OSX_PICTURE_DOCUMENTS_DIR)
-#elif defined (XP_WIN)
-DIR_ATOM(sSystemDirectory, NS_OS_SYSTEM_DIR)
-DIR_ATOM(sWindowsDirectory, NS_WIN_WINDOWS_DIR)
-DIR_ATOM(sWindowsProgramFiles, NS_WIN_PROGRAM_FILES_DIR)
-DIR_ATOM(sPrograms, NS_WIN_PROGRAMS_DIR)
-DIR_ATOM(sFavorites, NS_WIN_FAVORITES_DIR)
-DIR_ATOM(sAppdata, NS_WIN_APPDATA_DIR)
-DIR_ATOM(sLocalAppdata, NS_WIN_LOCAL_APPDATA_DIR)
-#if defined(MOZ_CONTENT_SANDBOX)
-DIR_ATOM(sLocalAppdataLow, NS_WIN_LOCAL_APPDATA_LOW_DIR)
-DIR_ATOM(sLowIntegrityTempBase, NS_WIN_LOW_INTEGRITY_TEMP_BASE)
-#endif
-DIR_ATOM(sWinCookiesDirectory, NS_WIN_COOKIES_DIR)
-DIR_ATOM(sDefaultDownloadDirectory, NS_WIN_DEFAULT_DOWNLOAD_DIR)
-#elif defined (XP_UNIX)
-DIR_ATOM(sDefaultDownloadDirectory, NS_UNIX_DEFAULT_DOWNLOAD_DIR)
-#endif
--- a/xpcom/io/nsDirectoryServiceDefs.h
+++ b/xpcom/io/nsDirectoryServiceDefs.h
@@ -9,27 +9,27 @@
  * nsIDirectoryService. These dirs are always available even if no
  * nsIDirectoryServiceProviders have been registered with the service.
  * Application level keys are defined in nsAppDirectoryServiceDefs.h.
  *
  * Keys whose definition ends in "DIR" or "FILE" return a single nsIFile (or
  * subclass). Keys whose definition ends in "LIST" return an nsISimpleEnumerator
  * which enumerates a list of file objects.
  *
- * Defines listed in this file are FROZEN.  This list may grow.
+ * Defines listed in this file are FROZEN.  This list may grow.  Each unique
+ * string in this file should have a corresponding atom defined in
+ * StaticAtoms.py (search for "DirectoryService"), regardless of whether it
+ * is defined here due to conditional compilation.
  */
 
 #ifndef nsDirectoryServiceDefs_h___
 #define nsDirectoryServiceDefs_h___
 
 /* General OS specific locations */
 
-// If this value ever changes, the special handling of the
-// nsDirectoryService::sOS_HomeDirectory static atom -- i.e. the use of
-// nsGkAtoms::Home in its place -- must be removed.
 #define NS_OS_HOME_DIR                          "Home"
 
 #define NS_OS_TEMP_DIR                          "TmpD"
 #define NS_OS_CURRENT_WORKING_DIR               "CurWorkD"
 /* Files stored in this directory will appear on the user's desktop,
  * if there is one, otherwise it's just the same as "Home"
  */
 #define NS_OS_DESKTOP_DIR                       "Desk"