diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-04 06:33:17 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-04 09:43:51 -0400 |
commit | 30dfd89126b4d1e7366697fb7f937e2db29d7295 (patch) | |
tree | ea230e248bffe2a944ce6062a7775d25feab1dfc /src/yuzu/ui_settings.h | |
parent | bc679c9b8c05d3db46da8cef77e729b31c6dbff5 (diff) |
ui_settings: Place definition of the theme array within the cpp file
Placing the array wholesale into the header places a copy of the whole
array into every translation unit that uses the data, which is wasteful.
Particularly given that this array is referenced from three different
translation units.
This also changes the array to contain pairs of const char*, rather than
QString instances. This way, the string data is able to be fixed into
the read-only segment of the program, as well as eliminate static
constructors/heap allocation immediately on program start.
Diffstat (limited to 'src/yuzu/ui_settings.h')
-rw-r--r-- | src/yuzu/ui_settings.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/yuzu/ui_settings.h b/src/yuzu/ui_settings.h index 051494bc5..2d679004f 100644 --- a/src/yuzu/ui_settings.h +++ b/src/yuzu/ui_settings.h @@ -15,9 +15,8 @@ namespace UISettings { using ContextualShortcut = std::pair<QString, int>; using Shortcut = std::pair<QString, ContextualShortcut>; -static const std::array<std::pair<QString, QString>, 2> themes = { - {std::make_pair(QString("Default"), QString("default")), - std::make_pair(QString("Dark"), QString("qdarkstyle"))}}; +using Themes = std::array<std::pair<const char*, const char*>, 2>; +extern const Themes themes; struct Values { QByteArray geometry; |