From 97985c9ca2aa21b995125ed8e7e42f6f23f6c48c Mon Sep 17 00:00:00 2001 From: Stefan Derkits Date: Mon, 26 May 2014 22:11:26 +0200 Subject: [PATCH] only show tray icon if systray is available --- src/tomahawk/TomahawkWindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tomahawk/TomahawkWindow.cpp b/src/tomahawk/TomahawkWindow.cpp index 6ffec6cc0..2cfbe5d73 100644 --- a/src/tomahawk/TomahawkWindow.cpp +++ b/src/tomahawk/TomahawkWindow.cpp @@ -108,7 +108,7 @@ TomahawkWindow::TomahawkWindow( QWidget* parent ) #endif , ui( new Ui::TomahawkWindow ) , m_searchWidget( 0 ) - , m_trayIcon( new TomahawkTrayIcon( this ) ) + , m_trayIcon( 0 ) , m_audioRetryCounter( 0 ) { TomahawkStyle::loadFonts(); @@ -127,6 +127,11 @@ TomahawkWindow::TomahawkWindow( QWidget* parent ) ui->centralWidget->setContentsMargins( 0, 0, 0, 0 ); TomahawkUtils::unmarginLayout( ui->centralWidget->layout() ); + if ( QSystemTrayIcon::isSystemTrayAvailable() ) + { + m_trayIcon = new TomahawkTrayIcon( this ); + } + setupMenuBar(); setupToolBar(); setupSideBar(); @@ -712,7 +717,10 @@ TomahawkWindow::closeEvent( QCloseEvent* e ) return; } #else - m_trayIcon->setShowHideWindow( false ); + if ( m_trayIcon ) + { + m_trayIcon->setShowHideWindow( false ); + } #endif e->accept();