forked from qt-creator/qt-creator
Let ModeManager::addAction take a QAction instead of Command
There was no reason, and using QAction is more flexible.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user