From 24621294b02dff02436c128f8f558b28be83258a Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Thu, 20 Aug 2026 08:56:06 +0200 Subject: [PATCH] kde: use embedded octopus icon directly, not fromTheme QIcon::fromTheme("ollie") was finding a stale brain SVG at /usr/share/icons/ instead of the octopus. Now the app uses the embedded resource for both window icon and systray, and sets app.setWindowIcon() explicitly. Also fixed the .desktop file to use the theme name 'ollie' instead of a hardcoded absolute path. --- kde/gui/main.cpp | 19 +++++++++++++------ kde/gui/org.ollie.gui.desktop | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/kde/gui/main.cpp b/kde/gui/main.cpp index 0bce126..a8e5ee2 100644 --- a/kde/gui/main.cpp +++ b/kde/gui/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "ollie9pclient.h" #include "sessionmodel.h" @@ -26,6 +27,17 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); app.setApplicationName("ollie-gui"); + // Locate the installed octopus SVG (user-local takes priority over system). + // Falls back to the Qt resource if not found on disk. + QIcon appIcon; + QString iconPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, + QStringLiteral("icons/hicolor/scalable/apps/ollie.svg")); + if (!iconPath.isEmpty()) + appIcon = QIcon(iconPath); + else + appIcon = QIcon(QStringLiteral(":/ollie.svg")); + app.setWindowIcon(appIcon); + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) QQuickStyle::setStyle("Basic"); @@ -54,12 +66,7 @@ const QUrl url(QStringLiteral("qrc:/main.qml")); return -1; auto *window = qobject_cast(engine.rootObjects().constFirst()); - QIcon trayIconImage = QIcon::fromTheme("ollie"); - if (trayIconImage.isNull()) { - trayIconImage.addFile(":/ollie.svg"); - trayIconImage.addFile(":/gui/ollie.svg"); - } - auto *trayIcon = new QSystemTrayIcon(trayIconImage, &app); + auto *trayIcon = new QSystemTrayIcon(appIcon, &app); auto *trayMenu = new QMenu; auto *showAction = trayMenu->addAction("Show Ollie"); trayMenu->addSeparator(); diff --git a/kde/gui/org.ollie.gui.desktop b/kde/gui/org.ollie.gui.desktop index 4b1aee8..3fffefa 100644 --- a/kde/gui/org.ollie.gui.desktop +++ b/kde/gui/org.ollie.gui.desktop @@ -3,7 +3,7 @@ Type=Application Name=Ollie Comment=AI assistant Exec=ollie-gui -Icon=/home/lkn/.local/share/icons/hicolor/scalable/apps/ollie.svg +Icon=ollie Categories=Utility;Development; Terminal=false StartupWMClass=ollie-gui