From 30dfd89126b4d1e7366697fb7f937e2db29d7295 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 4 Oct 2018 06:33:17 -0400 Subject: 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. --- src/yuzu/ui_settings.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/yuzu/ui_settings.cpp') diff --git a/src/yuzu/ui_settings.cpp b/src/yuzu/ui_settings.cpp index 120b34990..a314493fc 100644 --- a/src/yuzu/ui_settings.cpp +++ b/src/yuzu/ui_settings.cpp @@ -6,5 +6,11 @@ namespace UISettings { +const Themes themes{{ + {"Default", "default"}, + {"Dark", "qdarkstyle"}, +}}; + Values values = {}; -} + +} // namespace UISettings -- cgit v1.2.3