summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-09-20 11:23:51 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-09-20 11:23:51 +0200
commit5bacded29a5e33c027a39a537bf2b0f3e9c6243d (patch)
tree5d754f4cf2555c9e1ce0ab6864c3588a1843e4d6 /src
parentSVN_SILENT made messages (.desktop file) (diff)
parentChange the behavior of Ctrl+Maj+T to open only the last closed tab (diff)
downloadrekonq-5bacded29a5e33c027a39a537bf2b0f3e9c6243d.tar.xz
Merge commit 'refs/merge-requests/216' of git://gitorious.org/rekonq/mainline into m216
Diffstat (limited to 'src')
-rw-r--r--src/mainview.cpp12
-rw-r--r--src/mainview.h2
-rw-r--r--src/mainwindow.cpp6
-rw-r--r--src/tabbar.cpp8
4 files changed, 14 insertions, 14 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index f020fb53..3daee339 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -633,13 +633,13 @@ void MainView::previousTab()
}
-void MainView::openClosedTabs()
+void MainView::openLastClosedTab()
{
- foreach (const HistoryItem &item, recentlyClosedTabs())
- {
- Application::instance()->loadUrl( KUrl(item.url), Rekonq::NewTab);
- }
- m_recentlyClosedTabs.clear();
+ if (m_recentlyClosedTabs.isEmpty())
+ return;
+
+ const HistoryItem item = m_recentlyClosedTabs.takeFirst();
+ Application::instance()->loadUrl(KUrl(item.url), Rekonq::NewTab);
}
diff --git a/src/mainview.h b/src/mainview.h
index 6fab7fc0..29162dd1 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -135,7 +135,7 @@ public slots:
void nextTab();
void previousTab();
- void openClosedTabs();
+ void openLastClosedTab();
void openClosedTab();
void switchToTab();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4c766ba0..4d3dfc91 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -449,10 +449,10 @@ void MainWindow::setupActions()
actionCollection()->addAction(QL1S("show_prev_tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(previousTab()));
- a = new KAction(KIcon("tab-new"), i18n("Open Closed Tabs"), this);
+ a = new KAction(KIcon("tab-new"), i18n("Open Last Closed Tab"), this);
a->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_T));
- actionCollection()->addAction(QL1S("open_closed_tabs"), a);
- connect(a, SIGNAL(triggered(bool)), m_view, SLOT(openClosedTabs()));
+ actionCollection()->addAction(QL1S("open_last_closed_tab"), a);
+ connect(a, SIGNAL(triggered(bool)), m_view, SLOT(openLastClosedTab()));
// Closed Tabs Menu
KActionMenu *closedTabsMenu = new KActionMenu(KIcon("tab-new"), i18n("Closed Tabs"), this);
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index d403a39c..1756c20e 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -293,7 +293,7 @@ void TabBar::contextMenu(int tab, const QPoint &pos)
menu.addAction(mainWindow->actionByName( QL1S("clone_tab") ));
if (count() > 1)
menu.addAction(mainWindow->actionByName( QL1S("detach_tab") ));
- menu.addAction(mainWindow->actionByName( QL1S("open_closed_tabs") ));
+ menu.addAction(mainWindow->actionByName( QL1S("open_last_closed_tab") ));
menu.addAction(mainWindow->actionByName( QL1S("closed_tab_menu") ));
menu.addSeparator();
menu.addAction(mainWindow->actionByName( QL1S("close_tab") ));
@@ -314,7 +314,7 @@ void TabBar::emptyAreaContextMenu(const QPoint &pos)
MainWindow *mainWindow = Application::instance()->mainWindow();
menu.addAction(mainWindow->actionByName( QL1S("new_tab") ));
- menu.addAction(mainWindow->actionByName( QL1S("open_closed_tabs") ));
+ menu.addAction(mainWindow->actionByName( QL1S("open_last_closed_tab") ));
menu.addAction(mainWindow->actionByName( QL1S("closed_tab_menu") ));
menu.addSeparator();
menu.addAction(mainWindow->actionByName( QL1S("reload_all_tabs") ));
@@ -357,8 +357,8 @@ void TabBar::setupHistoryActions()
MainWindow *w = Application::instance()->mainWindow();
MainView *mv = qobject_cast<MainView *>(parent());
- QAction *openClosedTabsAction = w->actionByName( QL1S("open_closed_tabs") );
- openClosedTabsAction->setEnabled( mv->recentlyClosedTabs().size() > 0 );
+ QAction *openLastClosedTabAction = w->actionByName( QL1S("open_last_closed_tab") );
+ openLastClosedTabAction->setEnabled( mv->recentlyClosedTabs().size() > 0 );
// update closed tabs menu
KActionMenu *am = qobject_cast<KActionMenu *>( w->actionByName( QL1S("closed_tab_menu") ));