2
* Copyright (C) 2012 Canonical, Ltd.
5
* Ugo Riboni <ugo.riboni@canonical.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include <QtCore/QCoreApplication>
22
#include <QtCore/QDir>
24
inline bool isRunningInstalled() {
25
static bool installed = (QCoreApplication::applicationDirPath() ==
26
QDir(("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@")).canonicalPath());
30
inline QString translationDirectory() {
31
if (isRunningInstalled()) {
32
return QString("@CMAKE_INSTALL_PREFIX@/share/locale");
34
return QString("@CMAKE_BINARY_DIR@/po/locale");
38
inline QString shellAppDirectory() {
39
if (isRunningInstalled()) {
40
return QString("@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/");
42
return QString("@CMAKE_SOURCE_DIR@/");
46
inline QString shellImportPath() {
47
if (isRunningInstalled()) {
48
return QString("@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/plugins");
50
return QString("@CMAKE_BINARY_DIR@/plugins/");
54
inline QString fakePluginsImportPath() {
55
if (isRunningInstalled()) {
56
return QString("@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/plugins/mocks");
58
return QString("@CMAKE_BINARY_DIR@/tests/mocks");
62
inline QString sourceDirectory() {
63
return QString("@CMAKE_SOURCE_DIR@/");