diff options
Diffstat (limited to 'applications')
-rw-r--r-- | applications/kube/main.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/applications/kube/main.cpp b/applications/kube/main.cpp index aafbeef8..efe31ea2 100644 --- a/applications/kube/main.cpp +++ b/applications/kube/main.cpp | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <QQmlContext> | 48 | #include <QQmlContext> |
49 | #include <QIcon> | 49 | #include <QIcon> |
50 | #include <QStandardPaths> | 50 | #include <QStandardPaths> |
51 | #include <QResource> | ||
51 | #include <sink/store.h> | 52 | #include <sink/store.h> |
52 | 53 | ||
53 | #include "framework/src/keyring.h" | 54 | #include "framework/src/keyring.h" |
@@ -168,17 +169,14 @@ int main(int argc, char *argv[]) | |||
168 | app.setApplicationVersion(kube_VERSION_STRING); | 169 | app.setApplicationVersion(kube_VERSION_STRING); |
169 | app.setFont(QFont{"Noto Sans", app.font().pointSize(), QFont::Normal}); | 170 | app.setFont(QFont{"Noto Sans", app.font().pointSize(), QFont::Normal}); |
170 | 171 | ||
171 | //On Mac OS we want to include Contents/Resources/icons in the bundle, and that path is in AppDataLocations. | 172 | const QString kubeIcons = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kube-icons.rcc")); |
172 | QStringList iconSearchPaths; | 173 | if (!QResource::registerResource(kubeIcons, "/icons/kube")) { |
173 | for (const auto &p : QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) { | 174 | qWarning() << "Failed to register icon resource!" << kubeIcons; |
174 | auto iconPath = p + "/icons/"; | 175 | Q_ASSERT(false); |
175 | //I'm getting broken paths reported from standardLocations | 176 | } else { |
176 | if (iconPath.contains("kube.appContents")) { | 177 | QIcon::setThemeSearchPaths(QStringList() << QStringLiteral(":/icons")); |
177 | iconPath.replace("kube.appContents", "kube.app/Contents"); | 178 | QIcon::setThemeName(QStringLiteral("kube")); |
178 | } | ||
179 | iconSearchPaths << iconPath; | ||
180 | } | 179 | } |
181 | QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() + iconSearchPaths); | ||
182 | 180 | ||
183 | QCommandLineParser parser; | 181 | QCommandLineParser parser; |
184 | parser.setApplicationDescription("A communication and collaboration client."); | 182 | parser.setApplicationDescription("A communication and collaboration client."); |