~ken-vandine/address-book-app/add_profile

« back to all changes in this revision

Viewing changes to src/app/addressbookapp.cpp

  • Committer: Tarmac
  • Author(s): Renato Araujo Oliveira Filho, Sergio Schvezov
  • Date: 2014-01-12 22:42:38 UTC
  • mfrom: (114.2.15 click-package)
  • Revision ID: tarmac-20140112224238-ym0q71h8mxyxdt1i
click package.

Approved by PS Jenkins bot, Sergio Schvezov.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
{
51
51
    QString result;
52
52
    QString appPath = QCoreApplication::applicationDirPath();
53
 
    if (appPath == ADDRESS_BOOK_APP_BINDIR) {
 
53
    if (appPath.startsWith(ADDRESS_BOOK_DEV_BINDIR)) {
 
54
        result = QString(ADDRESS_BOOK_APP_DEV_DATADIR) + fileName;
 
55
    } else if (QString(ADDRESS_BOOK_APP_CLICK_PACKAGE).toLower() == "on") {
 
56
        result = appPath + QStringLiteral("/share/address-book-app/") + fileName;
 
57
    } else {
54
58
        result = QString(ADDRESS_BOOK_APP_INSTALL_DATADIR) + fileName;
55
 
    } else {
56
 
        result = QString(ADDRESS_BOOK_APP_DEV_DATADIR) + fileName;
57
59
    }
58
60
    return result;
59
61
}
61
63
static QString importPath(const QString &suffix)
62
64
{
63
65
    QString appPath = QCoreApplication::applicationDirPath();
64
 
    if (appPath != ADDRESS_BOOK_APP_BINDIR) {
 
66
    if (appPath.startsWith(ADDRESS_BOOK_DEV_BINDIR)) {
65
67
        return QString(ADDRESS_BOOK_APP_DEV_DATADIR) + suffix;
 
68
    } else if (QT_EXTRA_IMPORTS_DIR != ""){
 
69
        return QString(QT_EXTRA_IMPORTS_DIR) + suffix;
66
70
    } else {
67
71
        return "";
68
72
    }
118
122
 
119
123
    // The testability driver is only loaded by QApplication but not by QGuiApplication.
120
124
    // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own.
121
 
    if (arguments.contains("-testability")) {
 
125
    if (arguments.contains(QLatin1String("-testability")) ||
 
126
        qgetenv("QT_LOAD_TESTABILITY") == "1") {
122
127
        arguments.removeAll("-testability");
123
128
        QLibrary testLib(QLatin1String("qttestability"));
124
129
        if (testLib.load()) {