Fix trayicon disconnect warning

This commit is contained in:
Tobias Fella
2023-04-29 20:10:11 +02:00
parent e94b3caf51
commit 11233bee3a

View File

@@ -507,9 +507,11 @@ void Controller::setQuitOnLastWindowClosed()
m_trayIcon->show();
connect(m_trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
} else {
disconnect(m_trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
delete m_trayIcon;
m_trayIcon = nullptr;
if (m_trayIcon) {
disconnect(m_trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
delete m_trayIcon;
m_trayIcon = nullptr;
}
}
QGuiApplication::setQuitOnLastWindowClosed(!NeoChatConfig::self()->systemTray());
#else