diff options
Diffstat (limited to 'framework/src')
-rw-r--r-- | framework/src/extensionmodel.cpp | 6 | ||||
-rw-r--r-- | framework/src/extensionmodel.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/framework/src/extensionmodel.cpp b/framework/src/extensionmodel.cpp index 5f42aa7a..9256f5df 100644 --- a/framework/src/extensionmodel.cpp +++ b/framework/src/extensionmodel.cpp | |||
@@ -60,7 +60,7 @@ void ExtensionModel::load() | |||
60 | QDir dir{path + "/org/kube/" + mExtensionPoint}; | 60 | QDir dir{path + "/org/kube/" + mExtensionPoint}; |
61 | for (const auto &pluginName : dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { | 61 | for (const auto &pluginName : dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { |
62 | const auto pluginPath = dir.path() + "/" + pluginName; | 62 | const auto pluginPath = dir.path() + "/" + pluginName; |
63 | mPaths.insert(pluginName, pluginPath); | 63 | mPaths.insert(pluginName, QUrl::fromLocalFile(pluginPath)); |
64 | auto item = new QStandardItem; | 64 | auto item = new QStandardItem; |
65 | item->setData(pluginName, Name); | 65 | item->setData(pluginName, Name); |
66 | item->setData(pluginName, Tooltip); | 66 | item->setData(pluginName, Tooltip); |
@@ -85,12 +85,12 @@ void ExtensionModel::load() | |||
85 | setSourceModel(model); | 85 | setSourceModel(model); |
86 | } | 86 | } |
87 | 87 | ||
88 | QString ExtensionModel::findSource(const QString &extensionName, const QString &sourceName) | 88 | QUrl ExtensionModel::findSource(const QString &extensionName, const QString &sourceName) |
89 | { | 89 | { |
90 | if (mPaths.isEmpty()) { | 90 | if (mPaths.isEmpty()) { |
91 | load(); | 91 | load(); |
92 | } | 92 | } |
93 | return mPaths.value(extensionName) + "/" + sourceName; | 93 | return mPaths.value(extensionName).resolved(QUrl{extensionName + "/" + sourceName}); |
94 | } | 94 | } |
95 | 95 | ||
96 | void ExtensionModel::setSortOrder(const QVariantList &order) | 96 | void ExtensionModel::setSortOrder(const QVariantList &order) |
diff --git a/framework/src/extensionmodel.h b/framework/src/extensionmodel.h index 54cbb753..91ec2ef5 100644 --- a/framework/src/extensionmodel.h +++ b/framework/src/extensionmodel.h | |||
@@ -54,14 +54,14 @@ public: | |||
54 | void setExtensionPoint(const QString &order); | 54 | void setExtensionPoint(const QString &order); |
55 | QString extensionPoint() const; | 55 | QString extensionPoint() const; |
56 | 56 | ||
57 | Q_INVOKABLE QString findSource(const QString &extensionName, const QString &sourceName); | 57 | Q_INVOKABLE QUrl findSource(const QString &extensionName, const QString &sourceName); |
58 | 58 | ||
59 | private slots: | 59 | private slots: |
60 | void load(); | 60 | void load(); |
61 | 61 | ||
62 | private: | 62 | private: |
63 | QStringList mSortOrder; | 63 | QStringList mSortOrder; |
64 | QHash<QString, QString> mPaths; | 64 | QHash<QString, QUrl> mPaths; |
65 | QString mExtensionPoint; | 65 | QString mExtensionPoint; |
66 | }; | 66 | }; |
67 | 67 | ||