diff --git a/src/plasmaquick/configmodel.cpp b/src/plasmaquick/configmodel.cpp index c452bb4cc..df537c1e7 100644 --- a/src/plasmaquick/configmodel.cpp +++ b/src/plasmaquick/configmodel.cpp @@ -199,11 +199,15 @@ QVariant ConfigModel::data(const QModelIndex &index, int role) const case IconRole: return d->categories.at(index.row())->icon(); case SourceRole: - if (d->appletInterface) { - return QUrl::fromLocalFile(d->appletInterface.data()->package().filePath("ui", d->categories.at(index.row())->source())); + { + const QString source = d->categories.at(index.row())->source(); + // Quick check if source is an absolute path or not + if (d->appletInterface && !(source.startsWith('/') && source.endsWith(QLatin1String("qml")))) { + return QUrl::fromLocalFile(d->appletInterface.data()->package().filePath("ui", source)); } else { - return d->categories.at(index.row())->source(); + return source; } + } case PluginNameRole: return d->categories.at(index.row())->pluginName(); case VisibleRole: diff --git a/src/plasmaquick/configmodel.h b/src/plasmaquick/configmodel.h index dad8a6fa1..ed2df2e53 100644 --- a/src/plasmaquick/configmodel.h +++ b/src/plasmaquick/configmodel.h @@ -83,7 +83,7 @@ public: void appendCategory(const QString &iconName, const QString &name, const QString &path, const QString &pluginName); - void appendCategory(const QString &iconName, const QString &name, + Q_INVOKABLE void appendCategory(const QString &iconName, const QString &name, const QString &path, const QString &pluginName, bool visible); /**