~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-yakkety-1943

« back to all changes in this revision

Viewing changes to src/plugin.cpp

  • Committer: Jonas G. Drange
  • Date: 2016-09-22 14:21:55 UTC
  • mto: This revision was merged to the branch mainline in revision 1727.
  • Revision ID: jonas.drange@canonical.com-20160922142155-4c0eyh4zi1ypoet3
a bit more precise naming of cmake variables, and look for qml files relative to the manifest file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
using namespace SystemSettings;
40
40
 
41
41
static const QLatin1String pluginModuleDir{PLUGIN_MODULE_DIR};
42
 
static const QLatin1String pluginQmlDir{PLUGIN_QML_DIR_BASE};
 
42
static const QLatin1String pluginQmlDir{QML_DIR};
43
43
 
44
44
namespace SystemSettings {
45
45
 
88
88
    }
89
89
 
90
90
    m_data = json.toVariant().toMap();
91
 
 
92
 
    QStandardPaths::StandardLocation loc = QStandardPaths::GenericDataLocation;
93
 
    Q_FOREACH(const QString &path, QStandardPaths::standardLocations(loc)) {
94
 
        QDir dir(QString("%1/%2/%3").arg(path).arg(pluginQmlDir).arg(m_baseName));
95
 
        if (dir.exists()) {
96
 
            m_dataPath = dir.absolutePath();
97
 
            break;
98
 
        }
99
 
    }
 
91
    m_dataPath = manifest.absolutePath();
100
92
}
101
93
 
102
94
bool PluginPrivate::ensureLoaded() const
160
152
    QUrl componentUrl = m_data.value(key).toString();
161
153
    if (!componentUrl.isEmpty()) {
162
154
        if (componentUrl.isRelative()) {
163
 
            if (!m_dataPath.isEmpty()) {
164
 
                QDir dir(m_dataPath);
 
155
            QDir dir(m_dataPath);
 
156
            if (dir.cd(pluginQmlDir) && dir.cd(m_baseName)) {
165
157
                componentUrl =
166
158
                    QUrl::fromLocalFile(dir.filePath(componentUrl.path()));
167
159
            }