summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2019-04-15 17:50:27 -0400
committerGravatar Lioncash2019-04-15 17:59:41 -0400
commitd28bb56c91422858395b2579ee59b7855bb7ebaa (patch)
tree879b2f66d6d50e16343c1d428edd3625a8355a97
parentMerge pull request #2378 from lioncash/ro (diff)
downloadyuzu-d28bb56c91422858395b2579ee59b7855bb7ebaa.tar.gz
yuzu-d28bb56c91422858395b2579ee59b7855bb7ebaa.tar.xz
yuzu-d28bb56c91422858395b2579ee59b7855bb7ebaa.zip
CMakeLists: Define QT_USE_QSTRINGBUILDER for the Qt target
This is a compile definition introduced in Qt 4.8 for reducing the total potential number of strings created when performing string concatenation. This allows for less memory churn. This can be read about here: https://blog.qt.io/blog/2011/06/13/string-concatenation-with-qstringbuilder/ For a change that isn't source-compatible, we only had one occurrence that actually need to have its type clarified, which is pretty good, as far as transitioning goes.
-rw-r--r--src/yuzu/CMakeLists.txt6
-rw-r--r--src/yuzu/game_list_p.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt
index 2eb86d6e5..31b65c04c 100644
--- a/src/yuzu/CMakeLists.txt
+++ b/src/yuzu/CMakeLists.txt
@@ -151,6 +151,12 @@ target_link_libraries(yuzu PRIVATE common core input_common video_core)
151target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) 151target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets)
152target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) 152target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
153 153
154target_compile_definitions(yuzu PRIVATE
155 # Use QStringBuilder for string concatenation to reduce
156 # the overall number of temporary strings created.
157 -DQT_USE_QSTRINGBUILDER
158)
159
154if (YUZU_ENABLE_COMPATIBILITY_REPORTING) 160if (YUZU_ENABLE_COMPATIBILITY_REPORTING)
155 target_compile_definitions(yuzu PRIVATE -DYUZU_ENABLE_COMPATIBILITY_REPORTING) 161 target_compile_definitions(yuzu PRIVATE -DYUZU_ENABLE_COMPATIBILITY_REPORTING)
156endif() 162endif()
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index 3db0e90da..2cf5c58a0 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -95,7 +95,7 @@ public:
95 if (row2.isEmpty()) 95 if (row2.isEmpty())
96 return row1; 96 return row1;
97 97
98 return row1 + "\n " + row2; 98 return QString(row1 + "\n " + row2);
99 } 99 }
100 100
101 return GameListItem::data(role); 101 return GameListItem::data(role);