[Pkg-owncloud-commits] [owncloud-client] 51/115: Use QStandardPaths for linux if building with qt>=5

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Aug 29 22:03:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 7b114e2caee0930644155618001464a61633da70
Author: Sandro Knauß <mail at sandroknauss.de>
Date:   Sat Aug 16 03:11:19 2014 +0200

    Use QStandardPaths for linux if building with qt>=5
---
 src/mirall/utility_unix.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mirall/utility_unix.cpp b/src/mirall/utility_unix.cpp
index df90ed3..a73e003 100644
--- a/src/mirall/utility_unix.cpp
+++ b/src/mirall/utility_unix.cpp
@@ -12,6 +12,10 @@
  * for more details.
  */
 
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+    #include <QStandardPaths>
+#endif
+
 static void setupFavLink_private(const QString &folder) {
     // Nautilus: add to ~/.gtk-bookmarks
     QFile gtkBookmarks(QDir::homePath()+QLatin1String("/.gtk-bookmarks"));
@@ -28,14 +32,17 @@ static void setupFavLink_private(const QString &folder) {
 
 // returns the autostart directory the linux way
 // and respects the XDG_CONFIG_HOME env variable
-// can be replaces for qt5 with QStandardPaths
 QString getUserAutostartDir_private()
 {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+    QString config = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
+#else
     QString config = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));
 
     if (config.isEmpty()) {
         config = QDir::homePath()+QLatin1String("/.config");
     }
+#endif
     config += QLatin1String("/autostart/");
     return config;
 }
@@ -46,7 +53,6 @@ bool hasLaunchOnStartup_private(const QString &appName)
     return QFile::exists(desktopFileLocation);
 }
 
-
 void setLaunchOnStartup_private(const QString &appName, const QString& guiName, bool enable)
 {
     QString userAutoStartPath = getUserAutostartDir_private();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list