string: use better name
This commit is contained in:
parent
c6ca6cc794
commit
2f7a104ebd
|
@ -132,23 +132,23 @@ QT_END_NAMESPACE
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FRAMELESSHELPER_BYTEARRAY_VIEW
|
#ifndef FRAMELESSHELPER_BYTEARRAY
|
||||||
# define FRAMELESSHELPER_BYTEARRAY_VIEW(ba) ba
|
# define FRAMELESSHELPER_BYTEARRAY(ba) ba
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FRAMELESSHELPER_STRING_VIEW
|
#ifndef FRAMELESSHELPER_STRING
|
||||||
# if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
# if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
||||||
# define FRAMELESSHELPER_STRING_VIEW(str) str##_L1
|
# define FRAMELESSHELPER_STRING(str) str##_L1
|
||||||
# else
|
# else
|
||||||
# define FRAMELESSHELPER_STRING_VIEW(str) QLatin1String(str)
|
# define FRAMELESSHELPER_STRING(str) QLatin1String(str)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FRAMELESSHELPER_STRING_VIEW_TYPE
|
#ifndef FRAMELESSHELPER_STRING_TYPE
|
||||||
# if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
# if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
||||||
# define FRAMELESSHELPER_STRING_VIEW_TYPE QLatin1StringView
|
# define FRAMELESSHELPER_STRING_TYPE QLatin1StringView
|
||||||
# else
|
# else
|
||||||
# define FRAMELESSHELPER_STRING_VIEW_TYPE QLatin1String
|
# define FRAMELESSHELPER_STRING_TYPE QLatin1String
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -162,12 +162,12 @@ QT_END_NAMESPACE
|
||||||
|
|
||||||
#ifndef FRAMELESSHELPER_BYTEARRAY_CONSTANT2
|
#ifndef FRAMELESSHELPER_BYTEARRAY_CONSTANT2
|
||||||
# define FRAMELESSHELPER_BYTEARRAY_CONSTANT2(name, ba) \
|
# define FRAMELESSHELPER_BYTEARRAY_CONSTANT2(name, ba) \
|
||||||
[[maybe_unused]] static constexpr const auto k##name = FRAMELESSHELPER_BYTEARRAY_VIEW(ba);
|
[[maybe_unused]] static constexpr const auto k##name = FRAMELESSHELPER_BYTEARRAY(ba);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FRAMELESSHELPER_STRING_CONSTANT2
|
#ifndef FRAMELESSHELPER_STRING_CONSTANT2
|
||||||
# define FRAMELESSHELPER_STRING_CONSTANT2(name, str) \
|
# define FRAMELESSHELPER_STRING_CONSTANT2(name, str) \
|
||||||
[[maybe_unused]] static constexpr const auto k##name = FRAMELESSHELPER_STRING_VIEW(str);
|
[[maybe_unused]] static constexpr const auto k##name = FRAMELESSHELPER_STRING(str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FRAMELESSHELPER_BYTEARRAY_CONSTANT
|
#ifndef FRAMELESSHELPER_BYTEARRAY_CONSTANT
|
||||||
|
|
|
@ -48,8 +48,6 @@ static Q_LOGGING_CATEGORY(lcFramelessConfig, "wangwenx190.framelesshelper.core.f
|
||||||
|
|
||||||
using namespace Global;
|
using namespace Global;
|
||||||
|
|
||||||
FRAMELESSHELPER_STRING_CONSTANT2(ConfigFileName, ".framelesshelper.ini")
|
|
||||||
|
|
||||||
struct FramelessConfigEntry
|
struct FramelessConfigEntry
|
||||||
{
|
{
|
||||||
const char *env = nullptr;
|
const char *env = nullptr;
|
||||||
|
@ -133,7 +131,7 @@ void FramelessConfig::reload(const bool force)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
const QDir appDir(QCoreApplication::applicationDirPath());
|
const QDir appDir(QCoreApplication::applicationDirPath());
|
||||||
return std::make_unique<QSettings>(appDir.filePath(kConfigFileName), QSettings::IniFormat);
|
return std::make_unique<QSettings>(appDir.filePath(FRAMELESSHELPER_STRING_LITERAL(".framelesshelper.ini")), QSettings::IniFormat);
|
||||||
}();
|
}();
|
||||||
for (int i = 0; i != OptionCount; ++i) {
|
for (int i = 0; i != OptionCount; ++i) {
|
||||||
const bool envVar = (!g_framelessConfigData()->disableEnvVar
|
const bool envVar = (!g_framelessConfigData()->disableEnvVar
|
||||||
|
|
|
@ -66,18 +66,18 @@ static constexpr const std::array<ULONG_PTR, 10> g_registryKeyMap =
|
||||||
static constexpr const auto registryKeyCount = std::size(g_registryKeyMap);
|
static constexpr const auto registryKeyCount = std::size(g_registryKeyMap);
|
||||||
static_assert(registryKeyCount == (static_cast<int>(RegistryRootKey::PerformanceNlsText) + 1));
|
static_assert(registryKeyCount == (static_cast<int>(RegistryRootKey::PerformanceNlsText) + 1));
|
||||||
|
|
||||||
[[maybe_unused]] static constexpr const std::array<FRAMELESSHELPER_STRING_VIEW_TYPE, registryKeyCount> g_registryStrMap =
|
[[maybe_unused]] static constexpr const std::array<FRAMELESSHELPER_STRING_TYPE, registryKeyCount> g_registryStrMap =
|
||||||
{
|
{
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_CLASSES_ROOT"),
|
FRAMELESSHELPER_STRING("HKEY_CLASSES_ROOT"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_CURRENT_USER"),
|
FRAMELESSHELPER_STRING("HKEY_CURRENT_USER"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_LOCAL_MACHINE"),
|
FRAMELESSHELPER_STRING("HKEY_LOCAL_MACHINE"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_USERS"),
|
FRAMELESSHELPER_STRING("HKEY_USERS"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_PERFORMANCE_DATA"),
|
FRAMELESSHELPER_STRING("HKEY_PERFORMANCE_DATA"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_CURRENT_CONFIG"),
|
FRAMELESSHELPER_STRING("HKEY_CURRENT_CONFIG"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_DYN_DATA"),
|
FRAMELESSHELPER_STRING("HKEY_DYN_DATA"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_CURRENT_USER_LOCAL_SETTINGS"),
|
FRAMELESSHELPER_STRING("HKEY_CURRENT_USER_LOCAL_SETTINGS"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_PERFORMANCE_TEXT"),
|
FRAMELESSHELPER_STRING("HKEY_PERFORMANCE_TEXT"),
|
||||||
FRAMELESSHELPER_STRING_VIEW("HKEY_PERFORMANCE_NLSTEXT")
|
FRAMELESSHELPER_STRING("HKEY_PERFORMANCE_NLSTEXT")
|
||||||
};
|
};
|
||||||
|
|
||||||
RegistryKey::RegistryKey(const RegistryRootKey root, const QString &key, QObject *parent) : QObject(parent)
|
RegistryKey::RegistryKey(const RegistryRootKey root, const QString &key, QObject *parent) : QObject(parent)
|
||||||
|
|
Loading…
Reference in New Issue