Check if system has system tray using QSystemTrayIcon::isSystemTrayAvailable()
This commit is contained in:
@@ -112,9 +112,7 @@ void OSD::ReshowCurrentSong() {
|
||||
void OSD::AlbumArtLoaded(const Song &song, const QString &uri, const QImage &image) {
|
||||
|
||||
// Don't change tray icon details if it's a preview
|
||||
if (!preview_mode_) {
|
||||
tray_icon_->SetNowPlaying(song, uri);
|
||||
}
|
||||
if (!preview_mode_ && tray_icon_) tray_icon_->SetNowPlaying(song, uri);
|
||||
|
||||
last_song_ = song;
|
||||
last_image_ = image;
|
||||
@@ -179,7 +177,7 @@ void OSD::Paused() {
|
||||
}
|
||||
|
||||
void OSD::Stopped() {
|
||||
tray_icon_->ClearNowPlaying();
|
||||
if (tray_icon_) tray_icon_->ClearNowPlaying();
|
||||
if (ignore_next_stopped_) {
|
||||
ignore_next_stopped_ = false;
|
||||
return;
|
||||
@@ -222,7 +220,7 @@ void OSD::ShowMessage(const QString &summary, const QString &message, const QStr
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
case TrayPopup:
|
||||
tray_icon_->ShowPopup(summary, message, timeout_msec_);
|
||||
if (tray_icon_) tray_icon_->ShowPopup(summary, message, timeout_msec_);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user