summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 46cd9a15..2123d021 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -447,9 +447,26 @@ void MainView::cloneTab(int index)
// When index is -1 index chooses the current tab
void MainView::closeTab(int index)
{
- // do nothing if just one tab is opened
+ // open default homePage if just one tab is opened
if (count() == 1)
+ {
+ WebView *w = currentWebTab()->view();
+ urlBar()->setUrl(KUrl(""));
+ switch(ReKonfig::newTabsBehaviour())
+ {
+ case 0: // new tab page
+ case 1: // blank page
+ w->load( KUrl("about:home") );
+ break;
+ case 2: // homepage
+ w->load( KUrl(ReKonfig::homePage()) );
+ break;
+ default:
+ break;
+ }
+ urlBar()->setFocus();
return;
+ }
if (index < 0)
index = currentIndex();