diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-06-01 10:01:37 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-06-01 10:01:37 +0200 |
commit | e9f98dbe4ccc2066e35c626f003d2401a9ca83e2 (patch) | |
tree | 6b2312d0d6b1203b97f41c8bd0ac4b47dbb140ac /framework/src | |
parent | c2bd81b037aad4752aa54c1ba81d4bef547f6f75 (diff) | |
download | kube-e9f98dbe4ccc2066e35c626f003d2401a9ca83e2.tar.gz kube-e9f98dbe4ccc2066e35c626f003d2401a9ca83e2.zip |
Deal with broken lookup paths on osx
Diffstat (limited to 'framework/src')
-rw-r--r-- | framework/src/frameworkplugin.cpp | 15 |
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); |