From 7b909ccfcf8630a71fe296273bc141d542b415f3 Mon Sep 17 00:00:00 2001 From: Petr Bena Date: Fri, 19 Jul 2024 21:43:04 +0200 Subject: [PATCH] fixed warnings --- src/huggle/main.cpp | 4 ++-- src/huggle_core/core.cpp | 4 ++-- src/huggle_core/core.hpp | 28 ++++++++++++++-------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/huggle/main.cpp b/src/huggle/main.cpp index 133931d7e..0501a0f18 100644 --- a/src/huggle/main.cpp +++ b/src/huggle/main.cpp @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) Huggle::Exception::ExitBreakpad(); return ReturnCode; } -#if QT_VERSION >= 0x050600 +#if QT_VERSION >= 0x050600 && !defined(QT6_BUILD) // This should make fonts look normal on high DPI screens QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) a.setStyleSheet("QMessageBox { messagebox-text-interaction-flags: 5; }"); QApplication::setApplicationName("Huggle"); QApplication::setOrganizationName("Wikimedia"); -#if QT_VERSION >= 0x050100 +#if QT_VERSION >= 0x050100 && !defined(QT6_BUILD) // enable HiDPI support (available since Qt 5.1, but off by default) a.setAttribute(Qt::AA_UseHighDpiPixmaps); #endif diff --git a/src/huggle_core/core.cpp b/src/huggle_core/core.cpp index aa0942b64..2f8716c18 100644 --- a/src/huggle_core/core.cpp +++ b/src/huggle_core/core.cpp @@ -40,7 +40,7 @@ using namespace Huggle; // definitions -CoreState Core::coreState = CoreState::Initializing; +Core::CoreState Core::coreState = Core::CoreState::Initializing; Core *Core::HuggleCore = nullptr; void Core::Init() @@ -457,7 +457,7 @@ qint64 Core::GetUptimeInSeconds() return this->StartupTime.secsTo(QDateTime::currentDateTime()); } -CoreState Core::GetState() +Core::CoreState Core::GetState() { return Core::coreState; } diff --git a/src/huggle_core/core.hpp b/src/huggle_core/core.hpp index 2d87fcf8c..9aa0f056c 100644 --- a/src/huggle_core/core.hpp +++ b/src/huggle_core/core.hpp @@ -17,20 +17,6 @@ namespace Huggle { - /*! - * \brief This is a helper enum that is always statically allocated and existing that we can use to - * safely determine which application state we are currently in, to avoid segfaults by accessing - * objects that are already deleted or not constructed yet - */ - enum CoreState - { - None, - Initializing, - Running, - ShuttingDown, - Terminated - }; - // Predeclaring some types class Configuration; class Exception; @@ -64,6 +50,20 @@ namespace Huggle */ class HUGGLE_EX_CORE Core { + /*! + * \brief This is a helper enum that is always statically allocated and existing that we can use to + * safely determine which application state we are currently in, to avoid segfaults by accessing + * objects that are already deleted or not constructed yet + */ + enum CoreState + { + None, + Initializing, + Running, + ShuttingDown, + Terminated + }; + public: static CoreState GetState(); static bool IsRunning() { return Core::GetState() == CoreState::Running || Core::GetState() == CoreState::Initializing; }