diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-15 10:50:54 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-15 10:50:54 +0200 |
commit | bca889a2bdc89ee3fca3a8a8da6f2e1835cab49b (patch) | |
tree | ef7fc7e1e7c1998e99be66306a7aaf7e31d3aa21 /framework/src/extensionmodel.cpp | |
parent | e6490b8d71a26a96714b070667f93656f3afb489 (diff) | |
download | kube-bca889a2bdc89ee3fca3a8a8da6f2e1835cab49b.tar.gz kube-bca889a2bdc89ee3fca3a8a8da6f2e1835cab49b.zip |
QUrl for paths
Diffstat (limited to 'framework/src/extensionmodel.cpp')
-rw-r--r-- | framework/src/extensionmodel.cpp | 6 |
1 files changed, 3 insertions, 3 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) |