~alan-griffiths/miral/fix-1645284

« back to all changes in this revision

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

  • Committer: Alan Griffiths
  • Date: 2016-11-07 17:59:19 UTC
  • mfrom: (436.1.1 miral2)
  • Revision ID: alan@octopull.co.uk-20161107175919-stbb64i7j1htgog2
[miral-qt] delete all as qtmir work on MirAL has shifted to lp:~unity-team/qtmir/miral-qt-integration and this is a needless distration

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@/miral-qt/demos/");
38
 
    }
39
 
}
40
 
 
41
 
inline QString qmlPluginDirectory() {
42
 
    if (isRunningInstalled()) {
43
 
        return QString("@QML_MODULE_INSTALL_DIR@/");
44
 
    } else {
45
 
        return QString("@CMAKE_BINARY_DIR@/miral-qt/src/modules/");
46
 
    }
47
 
}
48
 
 
49
 
inline QString qpaPluginDirectory() {
50
 
    if (isRunningInstalled()) {
51
 
        return QString("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/qt5/plugins/platforms/");
52
 
    } else {
53
 
        //return QString("@CMAKE_BINARY_DIR@/miral-qt/src/platforms/mirserver/"); //miral moving it out of here
54
 
        return QString("@CMAKE_BINARY_DIR@/lib/");
55
 
    }
56
 
}
57
 
 
58
 
#endif