From 96ef82272b25f30f87c892c69e9284f8034a3bd5 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 10 Feb 2023 11:39:13 +0400 Subject: [PATCH] Use QT_DEPRECATED_WARNINGS_SINCE --- Telegram/SourceFiles/core/launcher.cpp | 3 +++ Telegram/SourceFiles/platform/mac/launcher_mac.h | 1 - Telegram/SourceFiles/platform/mac/launcher_mac.mm | 5 ----- Telegram/cmake/lib_tgcalls.cmake | 13 ++++++------- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index 652e759e3..112c7915b 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -324,7 +324,10 @@ void Launcher::initHighDpi() { qputenv("QT_DPI_ADJUSTMENT_POLICY", "AdjustDpi"); #endif // Qt < 6.2.0 +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); +#endif // Qt < 6.0.0 + if (OptionFractionalScalingEnabled.value()) { QApplication::setHighDpiScaleFactorRoundingPolicy( Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); diff --git a/Telegram/SourceFiles/platform/mac/launcher_mac.h b/Telegram/SourceFiles/platform/mac/launcher_mac.h index b4fd5c123..edb966a01 100644 --- a/Telegram/SourceFiles/platform/mac/launcher_mac.h +++ b/Telegram/SourceFiles/platform/mac/launcher_mac.h @@ -17,7 +17,6 @@ public: private: void initHook() override; - void initHighDpi() override; bool launchUpdater(UpdaterLaunch action) override; diff --git a/Telegram/SourceFiles/platform/mac/launcher_mac.mm b/Telegram/SourceFiles/platform/mac/launcher_mac.mm index 2902c78a6..f16420eee 100644 --- a/Telegram/SourceFiles/platform/mac/launcher_mac.mm +++ b/Telegram/SourceFiles/platform/mac/launcher_mac.mm @@ -27,11 +27,6 @@ void Launcher::initHook() { base::RegisterBundledResources(u"Telegram.rcc"_q); } -void Launcher::initHighDpi() { - // macOS Retina display support is working fine. - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); -} - bool Launcher::launchUpdater(UpdaterLaunch action) { if (cExeName().isEmpty()) { return false; diff --git a/Telegram/cmake/lib_tgcalls.cmake b/Telegram/cmake/lib_tgcalls.cmake index 3a426c93d..94cfdb856 100644 --- a/Telegram/cmake/lib_tgcalls.cmake +++ b/Telegram/cmake/lib_tgcalls.cmake @@ -241,13 +241,12 @@ elseif (APPLE) ) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_options(lib_tgcalls - PRIVATE - -Wno-deprecated-volatile - -Wno-ambiguous-reversed-operator - ) -endif() +target_compile_options_if_exists(lib_tgcalls +PRIVATE + -Wno-deprecated-volatile + -Wno-ambiguous-reversed-operator + -Wno-deprecated-declarations +) remove_target_sources(lib_tgcalls ${tgcalls_loc} platform/android/AndroidContext.cpp