From 0b98f471edf146b488ce28a02789cca39003cbf1 Mon Sep 17 00:00:00 2001 From: tnixeu <4436784+tnixeu@users.noreply.github.com> Date: Sat, 29 Oct 2022 02:19:35 +0200 Subject: [PATCH] add guards around string constants and into an anonymous namespace Signed-off-by: tnixeu <4436784+tnixeu@users.noreply.github.com> --- src/gui/folder.cpp | 8 ++++++-- src/gui/folderman.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 9a50716a1..a14d8b7c3 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -46,8 +46,12 @@ #include #include -static const char versionC[] = "version"; - +namespace { +#ifndef VERSION_C +#define VERSION_C +constexpr auto versionC= "version"; +#endif +} namespace OCC { Q_LOGGING_CATEGORY(lcFolder, "nextcloud.gui.folder", QtInfoMsg) diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index b71a9593d..7b6582b68 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -38,7 +38,12 @@ #include #include -static const char versionC[] = "version"; +namespace { +#ifndef VERSION_C +#define VERSION_C +constexpr auto versionC= "version"; +#endif +} static const int maxFoldersVersion = 1; namespace OCC { -- 2.30.2