Fix trayicon disconnect warning
This commit is contained in:
@@ -507,9 +507,11 @@ void Controller::setQuitOnLastWindowClosed()
|
|||||||
m_trayIcon->show();
|
m_trayIcon->show();
|
||||||
connect(m_trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
connect(m_trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
||||||
} else {
|
} else {
|
||||||
disconnect(m_trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
if (m_trayIcon) {
|
||||||
delete m_trayIcon;
|
disconnect(m_trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
||||||
m_trayIcon = nullptr;
|
delete m_trayIcon;
|
||||||
|
m_trayIcon = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
QGuiApplication::setQuitOnLastWindowClosed(!NeoChatConfig::self()->systemTray());
|
QGuiApplication::setQuitOnLastWindowClosed(!NeoChatConfig::self()->systemTray());
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user