|
@@ -65,21 +65,23 @@ int main(int argc, char *argv[])
|
|
context->setContextProperty(QStringLiteral("windowConfig"), windowConfig);
|
|
context->setContextProperty(QStringLiteral("windowConfig"), windowConfig);
|
|
|
|
|
|
KPackage::Package package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
|
|
KPackage::Package package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
|
|
- package.setDefaultPackageRoot(QStringLiteral("/usr/local/share/kpackage/kcms"));
|
|
|
|
- package.setPath(QStringLiteral("kcm_fancontrol"));
|
|
|
|
- package.addFileDefinition("appqmlroot", QStringLiteral("ui/Application.qml"), i18n("The Application's root QML file"));
|
|
|
|
- package.setRequired("appqmlroot", true);
|
|
|
|
-
|
|
|
|
- if (!package.isValid())
|
|
|
|
|
|
+ QStringList possiblePackageLocations = QStringList() << QStringLiteral("/usr/local/share/kpackage/kcms")
|
|
|
|
+ << QStringLiteral("kpackage/kcms")
|
|
|
|
+ << QStringLiteral("/opt/share/kpackage/kcms");
|
|
|
|
+
|
|
|
|
+ for (int i=0; i<possiblePackageLocations.size(); i++)
|
|
{
|
|
{
|
|
- package.setDefaultPackageRoot(QStringLiteral("/usr/share/kpackage/kcms"));
|
|
|
|
|
|
+ package.setDefaultPackageRoot(possiblePackageLocations.at(i));
|
|
package.setPath(QStringLiteral("kcm_fancontrol"));
|
|
package.setPath(QStringLiteral("kcm_fancontrol"));
|
|
package.addFileDefinition("appqmlroot", QStringLiteral("ui/Application.qml"), i18n("The Application's root QML file"));
|
|
package.addFileDefinition("appqmlroot", QStringLiteral("ui/Application.qml"), i18n("The Application's root QML file"));
|
|
package.setRequired("appqmlroot", true);
|
|
package.setRequired("appqmlroot", true);
|
|
|
|
+
|
|
|
|
+ if (package.isValid())
|
|
|
|
+ {
|
|
|
|
+ engine->load(QUrl::fromLocalFile(package.filePath("appqmlroot")));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (package.isValid())
|
|
|
|
- engine->load(QUrl::fromLocalFile(package.filePath("appqmlroot")));
|
|
|
|
|
|
|
|
return app.exec();
|
|
return app.exec();
|
|
}
|
|
}
|