Introduce global icons hash table

Authored by wojnilowicz on Jun 22 2017, 5:05 PM.

Description

Introduce global icons hash table

The purpose of this patch is to make icon handling in KMyMoney easier.
Moreover QIcon::fromTheme(QString, QString) make lots of
QIcon::isNull(), which are costly. That can be avoided by providing
correct icon name right from the beginning. That's what this patch does.

Advantages:

  1. Deduplication of QStringLiterals with icon names.
  2. New kmm_icons shared object allows to get icon names from every place

in KMM without code size overhead.

  1. One place to add icon names and icon replacements.
  2. QIcon::isNull() isn't called explicitly, because we can't do anything

useful if icon is null, so power isn't wasted on that.

  1. Pixmap cache names are unified now, so there will be no two identical

icons in cache under different names.

  1. Simplified KMyMoneyUtils::overlayIcon and

MyMoneyAccount::accountPixmap as lots of allocations go through them.

  1. Very easy to add new icon themes and easier to change theme on the

fly.

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

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

Details

Committed
wojnilowiczJul 6 2017, 4:17 PM
Differential Revision
D6377: Introduce global icons hash table
Parents
R261:2eea9cee9160: Introduce kmm_csvimport_core
Branches
Unknown
Tags
Unknown