[Libreoffice-commits] .: 2 commits - sfx2/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Oct 20 05:42:33 PDT 2010
sfx2/source/appl/shutdownicon.cxx | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
New commits:
commit 9dd2ec7d5ad8c3707151eb8e72895c3ab6ec6484
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 20 13:27:20 2010 +0100
WaE, ignore return value from symlink
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index e2e719f..5d74075 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -879,8 +879,9 @@ void ShutdownIcon::SetAutostart( bool bActivate )
osl_getThreadTextEncoding() );
if ((0 != symlink(aDesktopFileUnx, aShortcutUnx)) && (errno == EEXIST))
{
- unlink(aShortcutUnx);
- symlink(aDesktopFileUnx, aShortcutUnx);
+ unlink(aShortcutUnx);
+ int ret = symlink(aDesktopFileUnx, aShortcutUnx);
+ (void)ret; //deliberately ignore return value, it's non-critical if it fails
}
ShutdownIcon *pIcon = ShutdownIcon::createInstance();
commit 428d9243d26b6aef1320b67ca0327ff80ff9bf0b
Author: Sebastian Spaeth <Sebastian at SSpaeth.de>
Date: Wed Oct 20 13:21:26 2010 +0100
document what this is
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 1ff2164..e2e719f 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 );
More information about the Libreoffice-commits
mailing list