summaryrefslogtreecommitdiffstats
path: root/framework/src/frameworkplugin.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-06-01 10:01:37 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-06-01 10:01:37 +0200
commite9f98dbe4ccc2066e35c626f003d2401a9ca83e2 (patch)
tree6b2312d0d6b1203b97f41c8bd0ac4b47dbb140ac /framework/src/frameworkplugin.cpp
parentc2bd81b037aad4752aa54c1ba81d4bef547f6f75 (diff)
downloadkube-e9f98dbe4ccc2066e35c626f003d2401a9ca83e2.tar.gz
kube-e9f98dbe4ccc2066e35c626f003d2401a9ca83e2.zip
Deal with broken lookup paths on osx
Diffstat (limited to 'framework/src/frameworkplugin.cpp')
-rw-r--r--framework/src/frameworkplugin.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/src/frameworkplugin.cpp b/framework/src/frameworkplugin.cpp
index 92c6df3a..a3461c66 100644
--- a/framework/src/frameworkplugin.cpp
+++ b/framework/src/frameworkplugin.cpp
@@ -134,6 +134,21 @@ void FrameworkPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
134 const auto locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation) + QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); 134 const auto locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation) + QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
135 kubeIcons = findFile(QStringLiteral("/kube/kube-icons.rcc"), locations); 135 kubeIcons = findFile(QStringLiteral("/kube/kube-icons.rcc"), locations);
136 } 136 }
137 //For osx
138 if (kubeIcons.isEmpty()) {
139 //On Mac OS we want to include Contents/Resources/ in the bundle, and that path is in AppDataLocations.
140 QStringList iconSearchPaths;
141 for (const auto &p : QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) {
142 auto iconPath = p;
143 //I'm getting broken paths reported from standardLocations
144 if (iconPath.contains("kube.appContents")) {
145 iconPath.replace("kube.appContents", "kube.app/Contents");
146 }
147 iconSearchPaths << iconPath;
148 }
149 kubeIcons = findFile(QStringLiteral("/kube/kube-icons.rcc"), iconSearchPaths);
150 }
151
137 if (!QResource::registerResource(kubeIcons, "/icons/kube")) { 152 if (!QResource::registerResource(kubeIcons, "/icons/kube")) {
138 qWarning() << "Failed to register icon resource!" << kubeIcons; 153 qWarning() << "Failed to register icon resource!" << kubeIcons;
139 qWarning() << "Searched paths: " << QStandardPaths::standardLocations(QStandardPaths::AppDataLocation) + QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); 154 qWarning() << "Searched paths: " << QStandardPaths::standardLocations(QStandardPaths::AppDataLocation) + QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);