From 6569a0989e8c4bd569ecefe701890039ea6db22f Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Tue, 3 Apr 2012 00:12:33 +0800 Subject: [PATCH] Rename: actionForKey ==> actionForProfile --- src/ProfileList.cpp | 14 +++++++------- src/ProfileList.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ProfileList.cpp b/src/ProfileList.cpp index 13f518669..7500e1f84 100644 --- a/src/ProfileList.cpp +++ b/src/ProfileList.cpp @@ -75,20 +75,20 @@ void ProfileList::updateEmptyAction() if (showEmptyAction != _emptyListAction->isVisible()) _emptyListAction->setVisible(showEmptyAction); } -QAction* ProfileList::actionForKey(Profile::Ptr key) const +QAction* ProfileList::actionForProfile(Profile::Ptr profile) const { foreach ( QAction* action, _group->actions() ) { - if (action->data().value() == key) + if (action->data().value() == profile) return action; } return 0; // not found } -void ProfileList::profileChanged(Profile::Ptr key) +void ProfileList::profileChanged(Profile::Ptr profile) { - QAction* action = actionForKey(key); + QAction* action = actionForProfile(profile); if (action) - updateAction(action, key); + updateAction(action, profile); } void ProfileList::updateAction(QAction* action , Profile::Ptr profile) @@ -104,7 +104,7 @@ void ProfileList::shortcutChanged(Profile::Ptr profile, const QKeySequence& sequ if (!_addShortcuts) return; - QAction* action = actionForKey(profile); + QAction* action = actionForProfile(profile); if (action) { action->setShortcut(sequence); @@ -145,7 +145,7 @@ void ProfileList::favoriteChanged(Profile::Ptr profile, bool isFavorite) } emit actionsChanged(_group->actions()); } else { - QAction* action = actionForKey(profile); + QAction* action = actionForProfile(profile); if (action) { _group->removeAction(action); diff --git a/src/ProfileList.h b/src/ProfileList.h index 5da94dc2f..36c95477a 100644 --- a/src/ProfileList.h +++ b/src/ProfileList.h @@ -93,7 +93,7 @@ private slots: void shortcutChanged(Profile::Ptr profile, const QKeySequence& sequence); private: - QAction* actionForKey(Profile::Ptr profile) const; + QAction* actionForProfile(Profile::Ptr profile) const; void updateAction(QAction* action , Profile::Ptr profile); void updateEmptyAction();