summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-11-24 16:08:52 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-11-24 16:12:34 +0100
commit12e20923d870fd9884ee9c02bedbbd1989f22a44 (patch)
treef3c231db35f67689a5922f988564642dc418ff79
parentSVN_SILENT made messages (.desktop file) (diff)
downloadrekonq-12e20923d870fd9884ee9c02bedbbd1989f22a44.tar.xz
Properly handle window/app close
(cherry-picked from master)
-rw-r--r--src/application.cpp1
-rw-r--r--src/mainview.cpp7
-rw-r--r--src/mainview.h1
-rw-r--r--src/mainwindow.cpp2
4 files changed, 7 insertions, 4 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 35a4c0d8..d095e222 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -458,6 +458,7 @@ MainWindow *Application::newMainWindow(bool withTab)
void Application::removeMainWindow(MainWindow *window)
{
m_mainWindows.removeOne(window);
+ kDebug() << "Removing Window from app window list...";
}
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 15c78f5a..bb4dc5d1 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -422,9 +422,10 @@ void MainView::closeTab(int index, bool del)
{
if (ReKonfig::lastTabClosesWindow())
{
- // closing window...
- MainWindow *w = qobject_cast<MainWindow *>(parent());
- w->close();
+ emit closeWindow();
+// // closing window...
+// MainWindow *w = qobject_cast<MainWindow *>(parent());
+// w->close();
return;
}
diff --git a/src/mainview.h b/src/mainview.h
index 632ddbca..4e6f1bbb 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -114,6 +114,7 @@ Q_SIGNALS:
void browserTabLoading(bool);
void openPreviousInHistory();
void openNextInHistory();
+ void closeWindow();
void printRequested(QWebFrame *frame);
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 8c7e4b65..a9b6e8a2 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -121,7 +121,6 @@ MainWindow::MainWindow()
{
// Setting attributes (just to be sure...)
setAttribute(Qt::WA_DeleteOnClose, true);
- setAttribute(Qt::WA_QuitOnClose, false);
// creating a centralWidget containing panel, m_view and the hidden findbar
QWidget *centralWidget = new QWidget;
@@ -186,6 +185,7 @@ MainWindow::MainWindow()
// connect signals and slots
connect(m_view, SIGNAL(currentTitle(const QString &)), this, SLOT(updateWindowTitle(const QString &)));
connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *)));
+ connect(m_view, SIGNAL(closeWindow()), this, SLOT(close()));
// (shift +) ctrl + tab switching
connect(this, SIGNAL(ctrlTabPressed()), m_view, SLOT(nextTab()));