Fix tray icon loading if no share is defined.

This commit is contained in:
Klaas Freitag 2012-03-13 16:30:37 +01:00
parent 1a20d42424
commit 4699093c06
3 changed files with 7 additions and 5 deletions

View file

@ -143,7 +143,7 @@ void Application::setupActions()
void Application::setupSystemTray()
{
_tray = new QSystemTrayIcon(this);
_tray->setIcon(QIcon::fromTheme(FOLDER_ICON_EMPTY, QIcon( QString( ":/mirall/resources/%1").arg(FOLDER_ICON_EMPTY))));
_tray->setIcon( _theme->folderIcon("none", 22) ); // load the grey icon
connect(_tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
SLOT(slotTrayClicked(QSystemTrayIcon::ActivationReason)));

View file

@ -30,9 +30,11 @@ QIcon Theme::folderIcon( const QString& backend, int size ) const
{
QString name;
if( backend == "owncloud") name = QString( "mirall-%1.png" ).arg(size);
if( backend == "unison" ) name = QString( "folder-%1.png" ).arg(size);
if( backend == "csync" ) name = QString( "folder-remote-%1.png" ).arg(size);
if( backend == QString::fromLatin1("owncloud")) name = QString( "mirall-%1.png" ).arg(size);
if( backend == QString::fromLatin1("unison" )) name = QString( "folder-%1.png" ).arg(size);
if( backend == QString::fromLatin1("csync" )) name = QString( "folder-remote-%1.png" ).arg(size);
if( backend.isEmpty() || backend == QString::fromLatin1("none") )
name = QString("folder-grey-%1.png").arg(size);
return QIcon( QString( ":/mirall/resources/%1").arg(name) );
}

View file

@ -43,7 +43,7 @@ public:
virtual QIcon syncStateIcon( SyncResult::Status, int ) const;
virtual QString statusHeaderText( SyncResult::Status ) const;
virtual QPixmap splashScreen() const = 0;
virtual QIcon applicationIcon( int ) const;
virtual QIcon applicationIcon( int ) const;
virtual QString version() const;
private: