Comment 0 for bug 1629009

Revision history for this message
Michael Terry (mterry) wrote : Does not work inside a snap

Some apps can't find their main qml file. Error messages like:

"file:///build/messaging-app-gcXPE6/messaging-app-0.1+16.04.20160831/src/qml/messaging-app.qml: File not found"

Seems due to code like the following in config.h.in. Probably needs to consider the value of $SNAP or just be a little more forgiving.

inline bool isRunningInstalled() {
    static bool installed = (QCoreApplication::applicationDirPath() ==
                             QDir(("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@")).canonicalPath());
    return installed;
}

inline QString messagingAppDirectory() {
    if (isRunningInstalled()) {
        return QString("@CMAKE_INSTALL_PREFIX@/@MESSAGING_APP_DIR@/");
    } else {
        return QString("@CMAKE_SOURCE_DIR@/src/qml/");
    }
}

inline QString ubuntuPhonePluginPath() {
    if (isRunningInstalled()) {
        return QString::null;
    } else {
        return QString("@CMAKE_SOURCE_DIR@/");
    }
}