Introduce actions hash table

Authored by wojnilowicz on Jun 24 2017, 6:20 PM.

Description

Introduce actions hash table

The purpose of this patch is to make actions handling in KMyMoney
easier.

Advantages:

  1. Action names are defined in one place, so no multiple and unconnected

definitions of the same action name.

  1. Action names are now QStringLiterals, so no allocation of QStrings

occurs.

  1. Use of KStandardAction::name to get standard action names instead of

hardcoded strings subject to change.

  1. Use of actionCollection()->action(QString) instead of action(char *)

because the second makes internal QString allocation anyway.

  1. No use of KToggleAction because everything can be done with QAction.
  2. QKeySequence uses Qt::CTRL + Qt::Key_F rather than "Ctrl+F", so less

processing power and memory is used.

  1. No multiple QAction pointers in KMyMoneyApp::initActions.
  2. Actions are connected using new signal-slot syntax, so errors are

easy to spot.

  1. Actions are initialized through one loop from struct, so every action

is initialized the same way and with little error probability.

  1. Through initialization lists it's easier to see what action has got

what icon, signal, text, and shortcut.

  1. Easier to change icon theme on the fly.

Differential Revision: https://phabricator.kde.org/D6378

Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>

Details

Committed
wojnilowiczJul 6 2017, 4:17 PM
Differential Revision
D6378: Introduce actions hash table
Parents
R261:181ed8a98a69: Introduce global icons hash table
Branches
Unknown
Tags
Unknown