Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


I was puzzled by the name and the new one is much clearer. Also add
proper documentation to that function as to what it does and what the
params mean. All callers have been adapted to the new name.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
---
 sfx2/source/appl/shutdownicon.cxx |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 1ff2164..3d8e4b6 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -771,12 +771,20 @@ bool ShutdownIcon::IsQuickstarterInstalled()
 // ---------------------------------------------------------------------------
 
 #if defined (ENABLE_QUICKSTART_APPLET) && defined (UNX)
-static OUString getDotAutostart( bool bCreate = false )
+/**
+* Return the XDG autostart directory.
+* http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html
+* Available in Unix and with Quickstart enabled.
+* @param bCreate Create the directory if it does not exist yet.
+* @return OUString containing the autostart directory path.
+*/
+static OUString getAutostartDir( bool bCreate = false )
 {
     OUString aShortcut;
     const char *pConfigHome;
     if( (pConfigHome = getenv("XDG_CONFIG_HOME") ) )
-        aShortcut = OStringToOUString( OString( pConfigHome ), RTL_TEXTENCODING_UTF8 );
+        aShortcut = OStringToOUString( OString( pConfigHome ), 
+                                       RTL_TEXTENCODING_UTF8 );
     else
     {
         OUString aHomeURL;
@@ -816,7 +824,7 @@ rtl::OUString ShutdownIcon::getShortcutName()
     aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
     aShortcut += aShortcutName;
 #else // UNX
-    OUString aShortcut = getDotAutostart();
+    OUString aShortcut = getAutostartDir();
     aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/qstart.desktop" ) );
 #endif // UNX
     return aShortcut;
@@ -857,7 +865,7 @@ void ShutdownIcon::SetAutostart( bool bActivate )
 #ifdef WNT
         EnableAutostartW32( aShortcut );
 #else // UNX
-        getDotAutostart( true );
+        getAutostartDir( true );
 
         OUString aPath( RTL_CONSTASCII_USTRINGPARAM("${BRAND_BASE_DIR}/share/xdg/qstart.desktop" ) 
);
         Bootstrap::expandMacros( aPath );
-- 
1.7.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.