forked from qt-creator/qt-creator
Refactor the shortcut management for plugin macros
When saving a macro, a shortcut is created and the user can change the shortcut in Options->Keyboard. When the macro is removed, the shortcut is removed from the actionManager using the removeShortcut method. This is way simpler than before, where a number of default shortcuts where defined and macros took the empty space. Merge-request: 236 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
f3d7bbff0c
commit
1f1656163c
@@ -60,12 +60,10 @@ public:
|
||||
QString version;
|
||||
QString fileName;
|
||||
QList<MacroEvent> events;
|
||||
int shortcutId;
|
||||
};
|
||||
|
||||
Macro::MacroPrivate::MacroPrivate() :
|
||||
version(Core::Constants::IDE_VERSION_LONG),
|
||||
shortcutId(-1)
|
||||
version(Core::Constants::IDE_VERSION_LONG)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -85,7 +83,6 @@ Macro::Macro(const Macro &other):
|
||||
d->version = other.d->version;
|
||||
d->fileName = other.d->fileName;
|
||||
d->events = other.d->events;
|
||||
d->shortcutId = other.d->shortcutId;
|
||||
}
|
||||
|
||||
Macro::~Macro()
|
||||
@@ -101,7 +98,6 @@ Macro& Macro::operator=(const Macro &other)
|
||||
d->version = other.d->version;
|
||||
d->fileName = other.d->fileName;
|
||||
d->events = other.d->events;
|
||||
d->shortcutId = other.d->shortcutId;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -191,16 +187,6 @@ const QList<MacroEvent> &Macro::events() const
|
||||
return d->events;
|
||||
}
|
||||
|
||||
void Macro::setShortcutId(int id)
|
||||
{
|
||||
d->shortcutId = id;
|
||||
}
|
||||
|
||||
int Macro::shortcutId() const
|
||||
{
|
||||
return d->shortcutId;
|
||||
}
|
||||
|
||||
bool Macro::isWritable() const
|
||||
{
|
||||
QFileInfo fileInfo(d->fileName);
|
||||
|
||||
Reference in New Issue
Block a user