From 8a7e6c079fcc941b5232a03044512135d43b8403 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 18:19:28 +0200 Subject: No more Action Back Menu --- src/mainwindow.cpp | 42 ------------------------------------------ src/mainwindow.h | 5 ++--- 2 files changed, 2 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e4b6773c..0cae2ab6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -292,11 +292,7 @@ void MainWindow::setupActions() // ================ history related actions m_historyBackAction = new KAction(KIcon("go-previous"), i18n("Back"), this); - m_historyBackMenu = new KMenu(this); - m_historyBackAction->setMenu(m_historyBackMenu); connect(m_historyBackAction, SIGNAL(triggered(bool)), this, SLOT(slotOpenPrevious())); - connect(m_historyBackMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowBackMenu())); - connect(m_historyBackMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenActionUrl(QAction *))); actionCollection()->addAction(QLatin1String("history_back"), m_historyBackAction); m_historyForwardAction = new KAction(KIcon("go-next"), i18n("Forward"), this); @@ -771,44 +767,6 @@ void MainWindow::slotLoadProgress(int progress) } -void MainWindow::slotAboutToShowBackMenu() -{ - m_historyBackMenu->clear(); - if (!currentTab()) - return; - QWebHistory *history = currentTab()->history(); - int historyCount = history->count(); - for (int i = history->backItems(historyCount).count() - 1; i >= 0; --i) - { - QWebHistoryItem item = history->backItems(history->count()).at(i); - KAction *action = new KAction(this); - action->setData(-1*(historyCount - i - 1)); - QIcon icon = Application::instance()->icon(item.url()); - action->setIcon(icon); - action->setText(item.title()); - m_historyBackMenu->addAction(action); - } -} - - -void MainWindow::slotOpenActionUrl(QAction *action) -{ - int offset = action->data().toInt(); - QWebHistory *history = currentTab()->history(); - if (offset < 0) - { - history->goToItem(history->backItems(-1*offset).first()); // back - } - else - { - if (offset > 0) - { - history->goToItem(history->forwardItems(history->count() - offset + 1).back()); // forward - } - } -} - - void MainWindow::slotOpenPrevious() { QWebHistory *history = currentTab()->history(); diff --git a/src/mainwindow.h b/src/mainwindow.h index f1ea3a98..0d17ef4d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -89,11 +89,11 @@ private slots: void slotUpdateActions(); void slotUpdateWindowTitle(const QString &title = QString()); void slotOpenLocation(); - void slotAboutToShowBackMenu(); +// void slotAboutToShowBackMenu(); void geometryChangeRequested(const QRect &geometry); // history related - void slotOpenActionUrl(QAction *action); +// void slotOpenActionUrl(QAction *action); void slotOpenPrevious(); void slotOpenNext(); @@ -130,7 +130,6 @@ private: FindBar *m_findBar; SidePanel *m_sidePanel; - KMenu *m_historyBackMenu; KMenu *m_windowMenu; KActionMenu *m_historyActionMenu; -- cgit v1.2.1