1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 11:50:37 +02:00

only show tray icon if systray is available

This commit is contained in:
Stefan Derkits
2014-05-26 22:11:26 +02:00
parent 4deae94b99
commit 97985c9ca2

View File

@@ -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();