1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 16:44:05 +02:00

Share one trayIcon across all windows

This commit is contained in:
Dominik Schmidt
2011-09-07 06:12:07 +02:00
parent 5ea4b28ad4
commit f5b0c35274
2 changed files with 6 additions and 3 deletions

View File

@@ -32,10 +32,10 @@
using namespace Tomahawk;
SourcesModel* TomahawkWindow::s_sourcesModel = 0;
TomahawkTrayIcon* TomahawkWindow::s_trayIcon = 0;
TomahawkWindow::TomahawkWindow( QWidget* parent )
: QMainWindow( parent )
, m_trayIcon( new TomahawkTrayIcon( this ) )
{
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
@@ -45,6 +45,9 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
if( !s_sourcesModel )
s_sourcesModel = new SourcesModel( this );
if( !s_trayIcon )
s_trayIcon = new TomahawkTrayIcon( this );
setupSignals();
}
@@ -127,7 +130,7 @@ TomahawkWindow::closeEvent( QCloseEvent* e )
return;
}
#else
m_trayIcon->setShowHideWindow( false );
s_trayIcon->setShowHideWindow( false );
#endif
e->accept();

View File

@@ -59,9 +59,9 @@ private:
protected:
static SourcesModel* s_sourcesModel;
static TomahawkTrayIcon* s_trayIcon;
QString m_windowTitle;
TomahawkTrayIcon* m_trayIcon;
Tomahawk::result_ptr m_currentTrack;
};