summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-03-13 16:34:34 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-03-13 16:34:34 +0100
commitb35c6e35d9cea978e57838ccc95779a25d048fb4 (patch)
treec84af6a19ccd52e7ca83d5a90c1842eeb276e1cf /src
parentAdded missing reload button when webpage fails to load (diff)
downloadrekonq-b35c6e35d9cea978e57838ccc95779a25d048fb4.tar.xz
Restore a small portion of (un)ported code
Close window if option says so BUG: 316637
Diffstat (limited to 'src')
-rw-r--r--src/tabwindow/rekonqwindow.cpp4
-rw-r--r--src/tabwindow/tabwidget.cpp7
-rw-r--r--src/tabwindow/tabwidget.h3
3 files changed, 12 insertions, 2 deletions
diff --git a/src/tabwindow/rekonqwindow.cpp b/src/tabwindow/rekonqwindow.cpp
index a14dcf15..0e6515bd 100644
--- a/src/tabwindow/rekonqwindow.cpp
+++ b/src/tabwindow/rekonqwindow.cpp
@@ -91,9 +91,11 @@ void RekonqWindow::init()
l->addWidget(_splitter);
-
// fix focus handling
setFocusProxy(_tabWidget);
+
+ // signals
+ connect(_tabWidget, SIGNAL(closeWindow()), this, SLOT(close()));
}
// --------------------------------------------------------------------------------------------------
diff --git a/src/tabwindow/tabwidget.cpp b/src/tabwindow/tabwidget.cpp
index 322c45e1..bdc7a47a 100644
--- a/src/tabwindow/tabwidget.cpp
+++ b/src/tabwindow/tabwidget.cpp
@@ -621,7 +621,12 @@ void TabWidget::closeTab(int index, bool del)
// what to do if there is just one tab...
if (count() == 1)
{
- kDebug() << "CANNOT CLOSE WINDOW FROM HERE...";
+ if (ReKonfig::lastTabClosesWindow())
+ {
+ emit closeWindow();
+ return;
+ }
+
currentWebWindow()->load(KUrl("about:home"));
return;
}
diff --git a/src/tabwindow/tabwidget.h b/src/tabwindow/tabwidget.h
index 9c79df11..2718904c 100644
--- a/src/tabwindow/tabwidget.h
+++ b/src/tabwindow/tabwidget.h
@@ -86,6 +86,9 @@ public Q_SLOTS:
void loadUrl(const KUrl &, Rekonq::OpenType type = Rekonq::CurrentTab, TabHistory *history = 0);
void newTab(WebPage *page = 0);
+Q_SIGNALS:
+ void closeWindow();
+
private:
/**
* Prepares the new WebWindow to be open