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
This commit is contained in:
Peter Penz 2008-02-23 15:48:56 +00:00
parent 90625552ea
commit eb7294fa10
2 changed files with 15 additions and 21 deletions

View file

@ -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)));
}

View file

@ -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();