From 5cb1b6fe8e2180bab003bc0a95231c82d074d582 Mon Sep 17 00:00:00 2001 From: Dubslow Date: Tue, 9 Dec 2014 14:18:12 -0600 Subject: [PATCH] check for no systray, fixes #908 cant believe it took this long to figure out ;_; --- src/widget/widget.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index f30e86544..dcf6c67a4 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -125,7 +125,8 @@ void Widget::init() } else { - qWarning() << "No system tray detected!"; + qWarning() << "Widget: No system tray detected!"; + icon = nullptr; this->show(); } @@ -295,17 +296,19 @@ void Widget::setTranslation() void Widget::updateTrayIcon() { + if (!icon) + return; QString status = ui->statusButton->property("status").toString(); - QString icon; - if(status == "online") - icon = ":img/taskbar/taskbar_online_2x.png"; - else if(status == "away") - icon = ":img/taskbar/taskbar_idle_2x.png"; - else if(status == "busy") - icon = ":img/taskbar/taskbar_busy_2x.png"; + QString pic; + if (status == "online") + pic = ":img/taskbar/taskbar_online_2x.png"; + else if (status == "away") + pic = ":img/taskbar/taskbar_idle_2x.png"; + else if (status == "busy") + pic = ":img/taskbar/taskbar_busy_2x.png"; else - icon = ":img/taskbar/taskbar_offline_2x.png"; - this->icon->setIcon(QIcon(icon)); + pic = ":img/taskbar/taskbar_offline_2x.png"; + icon->setIcon(QIcon(pic)); } Widget::~Widget()