#include "qtuistyle.h"
#include "settingsdlg.h"
#include "settingspagedlg.h"
+#include "statusnotifieritem.h"
#include "toolbaractionprovider.h"
#include "topicwidget.h"
#include "verticaldock.h"
}
void MainWin::setupSystray() {
-#ifndef QT_NO_SYSTEMTRAYICON
+#ifdef HAVE_DBUS
+ _systemTray = new StatusNotifierItem(this);
+#elif !defined QT_NO_SYSTEMTRAYICON
_systemTray = new LegacySystemTray(this);
#else
_systemTray = new SystemTray(this); // dummy
void MainWin::saveLayout() {
QtUiSettings s;
- int accountId = Client::currentCoreAccount().accountId().toInt();
- if(accountId > 0) s.setValue(QString("MainWinState-%1").arg(accountId) , saveState(accountId));
+ int accountId = _bufferViews.count()? Client::currentCoreAccount().accountId().toInt() : 0; // only save if we still have a layout!
+ if(accountId > 0)
+ s.setValue(QString("MainWinState-%1").arg(accountId) , saveState(accountId));
}
void MainWin::disconnectedFromCore() {