Let ModeManager::addAction take a QAction instead of Command

There was no reason, and using QAction is more flexible.
This commit is contained in:
con
2011-01-12 14:21:12 +01:00
parent e7ad89ffd8
commit 8bf142fbc3
5 changed files with 10 additions and 10 deletions

View File

@@ -71,7 +71,7 @@ struct ModeManagerPrivate
Internal::MainWindow *m_mainWindow;
Internal::FancyTabWidget *m_modeStack;
Internal::FancyActionBar *m_actionBar;
QMap<Command*, int> m_actions;
QMap<QAction*, int> m_actions;
QVector<IMode*> m_modes;
QVector<Command*> m_modeShortcuts;
QSignalMapper *m_signalMapper;
@@ -269,9 +269,9 @@ void ModeManager::aboutToRemoveObject(QObject *obj)
d->m_mainWindow->removeContextObject(mode);
}
void ModeManager::addAction(Command *command, int priority)
void ModeManager::addAction(QAction *action, int priority)
{
d->m_actions.insert(command, priority);
d->m_actions.insert(action, priority);
// Count the number of commands with a higher priority
int index = 0;
@@ -280,7 +280,7 @@ void ModeManager::addAction(Command *command, int priority)
++index;
}
d->m_actionBar->insertAction(index, command->action());
d->m_actionBar->insertAction(index, action);
}
void ModeManager::addProjectSelector(QAction *action)