format code

This commit is contained in:
dranik
2026-05-29 22:40:24 +03:00
parent 9fa03e5387
commit 61afebcedb
3 changed files with 48 additions and 56 deletions
+3 -4
View File
@@ -295,7 +295,7 @@ if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
)
endif()
if(LINUX AND NOT ANDROID)
if(LINUX)
set(HEADERS ${HEADERS}
${CLIENT_ROOT_DIR}/platforms/linux/linuxutils.h
)
@@ -303,10 +303,8 @@ if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
${CLIENT_ROOT_DIR}/platforms/linux/linuxutils.cpp
)
endif()
endif()
if(APPLE AND MACOS_NE)
# Include only the tray notification handler in NE builds
if(APPLE AND MACOS_NE)
set(HEADERS ${HEADERS}
${CLIENT_ROOT_DIR}/ui/utils/systemTrayNotificationHandler.h
${CLIENT_ROOT_DIR}/ui/utils/platformTheme.h
@@ -316,4 +314,5 @@ if(APPLE AND MACOS_NE)
${CLIENT_ROOT_DIR}/ui/utils/systemTrayNotificationHandler.cpp
${CLIENT_ROOT_DIR}/ui/utils/platformTheme.cpp
)
endif()
endif()
-2
View File
@@ -150,8 +150,6 @@ void MacOSUtils::installInterfaceThemeObserver(std::function<void()> callback) {
return;
}
// Copy into block storage: capturing the parameter by reference would dangle
// once this function returns.
const std::function<void()> themeCallback = std::move(callback);
NSDistributedNotificationCenter *center = [NSDistributedNotificationCenter defaultCenter];
+8 -13
View File
@@ -51,10 +51,10 @@ namespace
}
} // namespace
constexpr const int WINDOWS_11_BUILD = 22000; // Build Number of the first release win 11 iso
constexpr const int WINDOWS_11_BUILD =
22000; // Build Number of the first release win 11 iso
QString WindowsUtils::getErrorMessage(quint32 code)
{
QString WindowsUtils::getErrorMessage(quint32 code) {
LPSTR messageBuffer = nullptr;
size_t size =
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
@@ -66,21 +66,18 @@ QString WindowsUtils::getErrorMessage(quint32 code)
return result;
}
QString WindowsUtils::getErrorMessage()
{
QString WindowsUtils::getErrorMessage() {
return getErrorMessage(GetLastError());
}
// A simple function to log windows error messages.
void WindowsUtils::windowsLog(const QString &msg)
{
void WindowsUtils::windowsLog(const QString& msg) {
QString errmsg = getErrorMessage();
logger.error() << msg << "-" << errmsg;
}
// Static
QString WindowsUtils::windowsVersion()
{
QString WindowsUtils::windowsVersion() {
QSettings regCurrentVersion("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
QSettings::NativeFormat);
@@ -92,14 +89,12 @@ QString WindowsUtils::windowsVersion()
}
// static
void WindowsUtils::forceCrash()
{
void WindowsUtils::forceCrash() {
RaiseException(0x0000DEAD, EXCEPTION_NONCONTINUABLE, 0, NULL);
}
// static
bool WindowsUtils::isDarkTheme()
{
bool WindowsUtils::isDarkTheme() {
QSettings settings(
QStringLiteral("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"),
QSettings::NativeFormat);