From f26ac63c078f1f18eff486fd2a96c7252961541b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 26 Feb 2018 14:22:24 +0100 Subject: [PATCH] [libcalamaresui] Make Python code const - This is always loaded into the Python context, so it may as well be done only once. --- src/libcalamaresui/modulesystem/PythonQtViewModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp b/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp index e2b497f2e..486d9a8e2 100644 --- a/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp +++ b/src/libcalamaresui/modulesystem/PythonQtViewModule.cpp @@ -143,12 +143,12 @@ PythonQtViewModule::loadSelf() return; } - QString calamares_module_annotation = + static const QLatin1Literal calamares_module_annotation( "_calamares_module_typename = ''\n" "def calamares_module(viewmodule_type):\n" " global _calamares_module_typename\n" " _calamares_module_typename = viewmodule_type.__name__\n" - " return viewmodule_type\n"; + " return viewmodule_type\n"); // Load in the decorator PythonQt::self()->evalScript( cxt, calamares_module_annotation );