Don't remove SNI object when SNI is lost

This commit is contained in:
Ilya Fedin 2020-04-13 06:06:31 +04:00 committed by John Preston
parent e71b7dd384
commit a1a7399023
1 changed files with 1 additions and 7 deletions

View File

@ -451,7 +451,7 @@ void MainWindow::initHook() {
bool MainWindow::hasTrayIcon() const { bool MainWindow::hasTrayIcon() const {
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION #ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
return trayIcon || _sniTrayIcon; return trayIcon || (SNIAvailable && _sniTrayIcon);
#else #else
return trayIcon; return trayIcon;
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION #endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
@ -545,12 +545,6 @@ void MainWindow::onSNIOwnerChanged(
return; return;
} }
if (_sniTrayIcon) {
_sniTrayIcon->setContextMenu(0);
_sniTrayIcon->deleteLater();
}
_sniTrayIcon = nullptr;
if (trayIcon) { if (trayIcon) {
trayIcon->setContextMenu(0); trayIcon->setContextMenu(0);
trayIcon->deleteLater(); trayIcon->deleteLater();