~mterry/qtmir/warn-on-xapp

« back to all changes in this revision

Viewing changes to demos/paths.h.in

  • Committer: CI Train Bot
  • Author(s): Nick Dedekind
  • Date: 2015-10-21 11:46:54 UTC
  • mfrom: (369.4.13 qtmir)
  • Revision ID: ci-train-bot@canonical.com-20151021114654-zxs13246bxcdci9l
Added touch performance tracing and test.
Approved by: Gerry Boland

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'