diff options
| author | 2023-04-30 18:30:36 -0400 | |
|---|---|---|
| committer | 2023-04-30 18:30:36 -0400 | |
| commit | 3565aad630864ecdbe53fdaa501ea708555b3c7c (patch) | |
| tree | c743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /SQLiteStudio3/guiSQLiteStudio/common/extactioncontainer.h | |
| parent | 1fdc150116cad39aae5c5da407c3312b47a59e3a (diff) | |
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/common/extactioncontainer.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/common/extactioncontainer.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/common/extactioncontainer.h b/SQLiteStudio3/guiSQLiteStudio/common/extactioncontainer.h index 159d4e5..dbec385 100644 --- a/SQLiteStudio3/guiSQLiteStudio/common/extactioncontainer.h +++ b/SQLiteStudio3/guiSQLiteStudio/common/extactioncontainer.h @@ -1,7 +1,6 @@ #ifndef extactionCONTAINER_H #define extactionCONTAINER_H -#include "iconmanager.h" #include "config_builder.h" #include "extactionprototype.h" #include <QString> @@ -18,6 +17,7 @@ class QActionGroup; class QToolBar; class QSignalMapper; class QMenu; +class Icon; #define CFG_SHORTCUTS_METANAME "Shortcuts" @@ -58,7 +58,21 @@ class QMenu; } \ } -#define GET_SHORTCUTS(Type) ExtActionContainer::getAllShortcutSequences(Cfg::getShortcuts##Type##Instance()->ShortcutsCategory##Type) +/** + * @def Finds shortcut config category instance. + * Finds CfgCategory containing CfgEntry instances of all shortcuts defined for class \arg Type. + * For example: GET_SHORTCUTS_CATEGORY(EditorWindow)->getTitle() + * @return CfgCategory instance of a shortcuts configuration used for specified class. + */ +#define GET_SHORTCUTS_CATEGORY(Type) Cfg::getShortcuts##Type##Instance()->ShortcutsCategory##Type + +/** + * @def Finds shortcut config entry instance. + * Finds CfgEntry used to store shortcut for enumerated action with \arg ActionName in the class \arg Type. + * For example: GET_SHORTCUT_ENTRY(EditorWindow, EXEC_QUERY)->get().toString() + * @return CfgEntry instance of a shortcut config entry. + */ +#define GET_SHORTCUT_ENTRY(Type, ActionName) Cfg::getShortcuts##Type##Instance()->ShortcutsCategory##Type.getEntryByName(#ActionName) class GUI_API_EXPORT ExtActionContainer { @@ -224,7 +238,7 @@ void ExtActionContainer::removeAction(ExtActionPrototype* action, int toolbar) return; ActionDetails* dets = nullptr; - for (ActionDetails* d : extraActions[clsName][toolbar]) + for (ActionDetails*& d : extraActions[clsName][toolbar]) { if (d->action == action) { @@ -248,7 +262,7 @@ QList<T*> ExtActionContainer::getInstances() { QList<T*> typedInstances; T* typedInstance = nullptr; - for (ExtActionContainer* instance : instances) + for (ExtActionContainer*& instance : instances) { typedInstance = dynamic_cast<T*>(instance); if (typedInstance) |
