[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/network/rekonq/src
From:       Andrea Diamantini <adjam7 () gmail ! com>
Date:       2009-06-21 20:31:01
Message-ID: 1245616261.781188.16730.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 984986 by adjam:

No more Action Back Menu

 M  +0 -42     mainwindow.cpp  
 M  +2 -3      mainwindow.h  


--- trunk/playground/network/rekonq/src/mainwindow.cpp #984985:984986
@@ -292,11 +292,7 @@
 
     // ================ 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::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();
--- trunk/playground/network/rekonq/src/mainwindow.h #984985:984986
@@ -89,11 +89,11 @@
     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 @@
     FindBar *m_findBar;
     SidePanel *m_sidePanel;
 
-    KMenu *m_historyBackMenu;
     KMenu *m_windowMenu;
     KActionMenu *m_historyActionMenu;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic