From 7cbea07358b608231067a43172bd4f5ea583b2c9 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 9 May 2018 14:21:11 +0200 Subject: Windows search paths --- applications/kube/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/applications/kube/main.cpp b/applications/kube/main.cpp index a81a0b4d..cbda7630 100644 --- a/applications/kube/main.cpp +++ b/applications/kube/main.cpp @@ -169,7 +169,11 @@ int main(int argc, char *argv[]) app.setApplicationVersion(kube_VERSION_STRING); app.setFont(QFont{"Noto Sans", app.font().pointSize(), QFont::Normal}); - const QString kubeIcons = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kube-icons.rcc")); + QString kubeIcons = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kube-icons.rcc")); + //For windows + if (kubeIcons.isEmpty()) { + kubeIcons = findFile(QStringLiteral("kube/kube-icons.rcc"), QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)); + } if (!QResource::registerResource(kubeIcons, "/icons/kube")) { qWarning() << "Failed to register icon resource!" << kubeIcons; qWarning() << "Searched paths: " << QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); @@ -224,6 +228,8 @@ int main(int argc, char *argv[]) } QQmlApplicationEngine engine; + //For windows + engine.addImportPath(QCoreApplication::applicationDirPath() + QStringLiteral("/../qml")); const auto file = "/org/kube/components/kube/main.qml"; const auto mainFile = findFile(file, engine.importPathList()); if (mainFile.isEmpty()) { -- cgit v1.2.3