From: Peter Penz Date: Sat, 23 Feb 2008 15:48:56 +0000 (+0000) Subject: minor cleanup: no need to create a slot which just invokes another method, just use... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/eb7294fa1076c91d77da982d1d4a0707bbc60b0c?ds=inline minor cleanup: no need to create a slot which just invokes another method, just use the other method as slot svn path=/trunk/KDE/kdebase/apps/; revision=778423 --- diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 27ed1b89b..ca392c134 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -212,9 +212,20 @@ void DolphinMainWindow::slotRequestItemInfo(const KFileItem& item) emit requestItemInfo(item); } -void DolphinMainWindow::slotHistoryChanged() +void DolphinMainWindow::updateHistory() { - updateHistory(); + const KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator(); + const int index = urlNavigator->historyIndex(); + + QAction* backAction = actionCollection()->action("go_back"); + if (backAction != 0) { + backAction->setEnabled(index < urlNavigator->historySize() - 1); + } + + QAction* forwardAction = actionCollection()->action("go_forward"); + if (forwardAction != 0) { + forwardAction->setEnabled(index > 0); + } } void DolphinMainWindow::updateFilterBarAction(bool show) @@ -897,22 +908,6 @@ void DolphinMainWindow::setupDockWidgets() placesView, SLOT(setUrl(KUrl))); } -void DolphinMainWindow::updateHistory() -{ - const KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator(); - const int index = urlNavigator->historyIndex(); - - QAction* backAction = actionCollection()->action("go_back"); - if (backAction != 0) { - backAction->setEnabled(index < urlNavigator->historySize() - 1); - } - - QAction* forwardAction = actionCollection()->action("go_forward"); - if (forwardAction != 0) { - forwardAction->setEnabled(index > 0); - } -} - void DolphinMainWindow::updateEditActions() { const KFileItemList list = m_activeViewContainer->view()->selectedItems(); @@ -991,7 +986,7 @@ void DolphinMainWindow::connectViewSignals(int viewIndex) connect(navigator, SIGNAL(urlChanged(const KUrl&)), this, SLOT(changeUrl(const KUrl&))); connect(navigator, SIGNAL(historyChanged()), - this, SLOT(slotHistoryChanged())); + this, SLOT(updateHistory())); connect(navigator, SIGNAL(editableStateChanged(bool)), this, SLOT(slotEditableStateChanged(bool))); } diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index a72047039..39cd7431f 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -301,7 +301,7 @@ private slots: * Updates the state of the 'Back' and 'Forward' menu * actions corresponding the the current history. */ - void slotHistoryChanged(); + void updateHistory(); /** Updates the state of the 'Show filter bar' menu action. */ void updateFilterBarAction(bool show); @@ -329,7 +329,6 @@ private: void setupActions(); void setupDockWidgets(); - void updateHistory(); void updateEditActions(); void updateViewActions(); void updateGoActions();