Commit d8f94be2 authored by scuq's avatar scuq

set offline on close

parent df0143e2
Pipeline #389 passed with stage
in 41 seconds
......@@ -301,6 +301,7 @@ void qmMainWindow::closeEvent(QCloseEvent *closeev)
} else {
closeev->accept();
}
}
void qmMainWindow::changeEvent(QEvent *ev)
......@@ -338,6 +339,16 @@ void qmMainWindow::setCloseToTray(bool value)
closeToTray = value;
}
void qmMainWindow::disconnectSessions()
{
QMapIterator<QString, ImSession*> sessions(this->iMSessions);
while (sessions.hasNext()) {
sessions.next();
sessions.value()->setCurrentStatus(ImContact::presenceStatus::offline);
sessions.value()->setNetworkConnection(0);
}
}
bool qmMainWindow::getNetworkConnection() const
{
return networkConnection;
......@@ -556,6 +567,7 @@ void qmMainWindow::slOnConnected()
void qmMainWindow::slExit()
{
this->disconnectSessions();
qApp->quit();
}
......
......@@ -59,6 +59,7 @@ private:
void createTrayIcon();
bool getCloseToTray() const;
void setCloseToTray(bool value);
void disconnectSessions();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment