File stellarium-minimum-qt-5_9.patch of Package stellarium
From 87b12dfbd2e4abb79de115fdaa7dce4699df11fd Mon Sep 17 00:00:00 2001
From: "Alexander V. Wolf" <alex.v.wolf@gmail.com>
Date: Tue, 28 Sep 2021 16:49:17 +0700
Subject: [PATCH] Minimal Qt is 5.9 now
---
CMakeLists.txt | 4 ++--
plugins/Oculars/src/Oculars.cpp | 2 +-
src/core/StelApp.cpp | 6 ------
src/core/StelModule.hpp | 4 ----
4 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa1dcaf3f7..77ab4d2dd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,8 +42,8 @@ ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}")
ADD_DEFINITIONS(-DCOPYRIGHT_YEARS="${COPYRIGHT_YEARS}")
ADD_DEFINITIONS(-DSTELLARIUM_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
-# currently Qt 5.9/5.12 is recommended
-SET(MINIMAL_QT_VERSION "5.7.0")
+# currently Qt 5.12 is recommended
+SET(MINIMAL_QT_VERSION "5.9.0")
# TODO: Check real minimal supported version of GPSD API
SET(MINIMAL_GPS_API_VERSION "6.0")
diff --git a/plugins/Oculars/src/Oculars.cpp b/plugins/Oculars/src/Oculars.cpp
index 0f1cae34bc..c3a5a0a85d 100644
--- a/plugins/Oculars/src/Oculars.cpp
+++ b/plugins/Oculars/src/Oculars.cpp
@@ -1227,7 +1227,7 @@ void Oculars::displayPopupMenu()
}
}
-#if QT_VERSION >= 0x050700 && defined(Q_OS_WIN)
+#ifdef Q_OS_WIN
popup->showTearOffMenu(QCursor::pos());
#endif
popup->exec(QCursor::pos());
diff --git a/src/core/StelApp.cpp b/src/core/StelApp.cpp
index 57f2a17599..0aaf750b96 100644
--- a/src/core/StelApp.cpp
+++ b/src/core/StelApp.cpp
@@ -434,9 +434,7 @@ void StelApp::init(QSettings* conf)
SplashScreen::showMessage(q_("Initializing network access..."));
networkAccessManager = new QNetworkAccessManager(this);
- #if QT_VERSION >= 0x050900
networkAccessManager->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
- #endif
SplashScreen::showMessage(q_("Initializing network disk cache..."));
// Activate http cache if Qt version >= 4.5
QNetworkDiskCache* cache = new QNetworkDiskCache(networkAccessManager);
@@ -1100,12 +1098,8 @@ QString StelApp::getViewportEffect() const
void StelApp::dumpModuleActionPriorities(StelModule::StelModuleActionName actionName) const
{
const QList<StelModule*> modules = moduleMgr->getCallOrders(actionName);
- #if QT_VERSION >= 0x050500
QMetaEnum me = QMetaEnum::fromType<StelModule::StelModuleActionName>();
qDebug() << "Module Priorities for action named" << me.valueToKey(actionName);
- #else
- qDebug() << "Module Priorities for action named" << actionName;
- #endif
for (auto* module : modules)
{
diff --git a/src/core/StelModule.hpp b/src/core/StelModule.hpp
index 83376e268b..0040f51ff4 100644
--- a/src/core/StelModule.hpp
+++ b/src/core/StelModule.hpp
@@ -120,9 +120,7 @@ class StelModule : public QObject
ReplaceSelection, //!< Set the StelObject as the new list of selected ones.
RemoveFromSelection //!< Subtract the StelObject from the current list of selected ones.
};
- #if QT_VERSION >= 0x050500
Q_ENUM(StelModuleSelectAction)
- #endif
//! Define the possible action for which an order is defined
enum StelModuleActionName
{
@@ -132,9 +130,7 @@ class StelModule : public QObject
ActionHandleMouseMoves, //!< Action associated to the handleMouseMoves() method
ActionHandleKeys //!< Action associated to the handleKeys() method
};
- #if QT_VERSION >= 0x050500
Q_ENUM(StelModuleActionName)
- #endif
//! Return the value defining the order of call for the given action
//! For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11,
//! the stars module will be drawn before the constellations