~feng-kylin/unity8/OpenUrlInIndicator

« back to all changes in this revision

Viewing changes to paths.h.in

  • Committer: Tarmac
  • Author(s): Nick Dedekind, Launchpad Translations on behalf of unity-team
  • Date: 2013-07-11 19:50:27 UTC
  • mfrom: (2.5.114 indicators-client)
  • Revision ID: tarmac-20130711195027-yheu3w2oc42c1h7s
Moved indicators-client code into unity8. Fixes: https://bugs.launchpad.net/bugs/1191132, https://bugs.launchpad.net/bugs/1191822.

Approved by PS Jenkins bot, Michał Sawicz, Nicolas d'Offay.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
// Qt
24
24
#include <QtCore/QCoreApplication>
25
25
#include <QtCore/QDir>
 
26
#include <QStandardPaths>
26
27
 
27
28
inline bool isRunningInstalled() {
28
29
    static bool installed = (QCoreApplication::applicationDirPath() ==
65
66
    return paths;
66
67
}
67
68
 
 
69
inline QStringList shellDataDirs() {
 
70
    QStringList dirs = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
 
71
    if (!isRunningInstalled()) {
 
72
        if (getenv("UNITY_TEST_ENV")==NULL) {
 
73
            dirs.prepend("@CMAKE_BINARY_DIR@/share");
 
74
        }
 
75
    }
 
76
    else {
 
77
        // append so by default we use xdg files.
 
78
        dirs.append(shellAppDirectory());
 
79
    }
 
80
    return dirs;
 
81
}
 
82
 
68
83
inline QString sourceDirectory() {
69
84
    return QString("@CMAKE_SOURCE_DIR@/");
70
85
}