Git commit b109284c30244f779e7be50dc33412301063dd58 by Konstantinos Smanis. Committed on 27/10/2013 at 17:24. Pushed by ksmanis into branch 'master'. Oops. Multiple definitions in different translation units. Inline the functions in order to share the definition in all translation units. Making these functions static is *wrong*! Each translation unit would have a different copy of the function and thus different static local variables. This kills the purpose of caching the value in a single static local variable. Construct-On-First-Use would still work but with different copies of the variable. An excellent summary of the avaiable options can be found here: http://stackoverflow.com/a/10847368/1266511 M +9 -9 config.h.cmake http://commits.kde.org/kcm-grub2/b109284c30244f779e7be50dc33412301063dd58 diff --git a/config.h.cmake b/config.h.cmake index 24d2b68..25475af 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -12,47 +12,47 @@ //Qt #include = -const QString & grubInstallExePath() +inline const QString & grubInstallExePath() { static const QString str =3D QFile::decodeName("@GRUB_INSTALL_EXE@"); return str; } -const QString & grubMkconfigExePath() +inline const QString & grubMkconfigExePath() { static const QString str =3D QFile::decodeName("@GRUB_MKCONFIG_EXE@"); return str; } -const QString & grubProbeExePath() +inline const QString & grubProbeExePath() { static const QString str =3D QFile::decodeName("@GRUB_PROBE_EXE@"); return str; } -const QString & grubSetDefaultExePath() +inline const QString & grubSetDefaultExePath() { static const QString str =3D QFile::decodeName("@GRUB_SET_DEFAULT_EXE@= "); return str; } -const QString & grubMenuPath() +inline const QString & grubMenuPath() { static const QString str =3D QFile::decodeName("@GRUB_MENU@"); return str; } -const QString & grubConfigPath() +inline const QString & grubConfigPath() { static const QString str =3D QFile::decodeName("@GRUB_CONFIG@"); return str; } -const QString & grubEnvPath() +inline const QString & grubEnvPath() { static const QString str =3D QFile::decodeName("@GRUB_ENV@"); return str; } -const QString & grubMemtestPath() +inline const QString & grubMemtestPath() { static const QString str =3D QFile::decodeName("@GRUB_MEMTEST@"); return str; } -const QString & grubLocalePath() +inline const QString & grubLocalePath() { static const QString str =3D QFile::decodeName("@GRUB_LOCALE@"); return str;