Skip to content

Commit

Permalink
fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
benapetr committed Jul 19, 2024
1 parent 887bb8f commit 7b909cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/huggle/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/huggle_core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -457,7 +457,7 @@ qint64 Core::GetUptimeInSeconds()
return this->StartupTime.secsTo(QDateTime::currentDateTime());
}

CoreState Core::GetState()
Core::CoreState Core::GetState()
{
return Core::coreState;
}
Expand Down
28 changes: 14 additions & 14 deletions src/huggle_core/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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; }
Expand Down

0 comments on commit 7b909cc

Please sign in to comment.