summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 3d49752..40daad8 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -142,6 +142,8 @@ void MainWindow::showSessions()
sessions.show();
}
+extern QWidget *viewer;
+//#include <QApplication>
void MainWindow::closeEvent(QCloseEvent *event)
{
if(isStored || QMessageBox::question(this,
@@ -150,6 +152,11 @@ void MainWindow::closeEvent(QCloseEvent *event)
"Are you sure you want to continue?",
QMessageBox::Yes | QMessageBox::No)
== QMessageBox::Yes) {
+ if(!isStored) {
+ netcom.discard();
+ sessions.remove(cpr);
+ }
+
QSettings settings("Aasimon.org", "Pracro");
settings.beginGroup("MainWindow");
@@ -159,6 +166,8 @@ void MainWindow::closeEvent(QCloseEvent *event)
settings.endGroup();
event->accept();
+ if(viewer) viewer->close();
+ // qApp->quit();
} else {
event->ignore();
}