~alan-griffiths/miral/debug

« back to all changes in this revision

Viewing changes to miral-qt/demos/paths.h.in

  • Committer: Gerry Boland
  • Date: 2016-06-01 22:06:51 UTC
  • mto: This revision was merged to the branch mainline in revision 178.
  • Revision ID: gerry.boland@canonical.com-20160601220651-ge508tffql4e7u7c
Import QtMir code into miral-qt subdirectory. Disabled by default, use -DMIRAL_ENABLE_QT=1 to build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#ifndef PATHS_H
 
18
#define PATHS_H
 
19
 
 
20
// Qt
 
21
#include <QtCore/QCoreApplication>
 
22
#include <QtCore/QDir>
 
23
#include <QtGui/QIcon>
 
24
#include <QtQml/QQmlEngine>
 
25
#include <QStandardPaths>
 
26
 
 
27
inline bool isRunningInstalled() {
 
28
    static bool installed = (QCoreApplication::applicationDirPath() ==
 
29
                             QDir(("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@")).canonicalPath());
 
30
    return installed;
 
31
}
 
32
 
 
33
inline QString qmlDirectory() {
 
34
    if (isRunningInstalled()) {
 
35
        return QString("@CMAKE_INSTALL_PREFIX@/@QTMIR_DATA_DIR@/");
 
36
    } else {
 
37
        return QString("@CMAKE_SOURCE_DIR@/demos/");
 
38
    }
 
39
}
 
40
#endif
 
 
b'\\ No newline at end of file'