QCoreApplication: Remove app_compile_version

It's not used for anything, so remove the temptation of trying to use it
to make decisions at runtime about a behavior. It's the wrong tool for
the job: it might tell you the version of Qt the *application* was
compiled against, but not the version any of the Qt-using libraries
were.

Pick-to: 6.4
Change-Id: I175efddd75f24ae59057fffd16f70b77dd87faf4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Thiago Macieira 2022-06-09 12:46:37 -07:00
parent 6ae2bfad41
commit c4af4dcb5d
2 changed files with 2 additions and 10 deletions

View File

@ -108,12 +108,6 @@ using namespace Qt::StringLiterals;
extern QString qAppFileName(); extern QString qAppFileName();
#endif #endif
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
# error "Bump QCoreApplicatoinPrivate::app_compile_version to QT_VERSION_CHECK(7, 0, 0)"
#endif
// We don't know exactly, but it's at least 6.0.0:
Q_CONSTINIT int QCoreApplicationPrivate::app_compile_version = QT_VERSION_CHECK(6, 0, 0);
Q_CONSTINIT bool QCoreApplicationPrivate::setuidAllowed = false; Q_CONSTINIT bool QCoreApplicationPrivate::setuidAllowed = false;
#if !defined(Q_OS_WIN) #if !defined(Q_OS_WIN)
@ -399,7 +393,7 @@ static inline bool contains(int argc, char **argv, const char *needle)
} }
#endif // Q_OS_WIN #endif // Q_OS_WIN
QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint flags) QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint)
: :
#ifndef QT_NO_QOBJECT #ifndef QT_NO_QOBJECT
QObjectPrivate(), QObjectPrivate(),
@ -419,7 +413,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, q_ptr(nullptr) , q_ptr(nullptr)
#endif #endif
{ {
app_compile_version = flags & 0xffffff;
static const char *const empty = ""; static const char *const empty = "";
if (argc == 0 || argv == nullptr) { if (argc == 0 || argv == nullptr) {
argc = 0; argc = 0;

View File

@ -56,7 +56,7 @@ public:
Gui Gui
}; };
QCoreApplicationPrivate(int &aargc, char **aargv, uint flags); QCoreApplicationPrivate(int &aargc, char **aargv, uint);
// If not inheriting from QObjectPrivate: force this class to be polymorphic // If not inheriting from QObjectPrivate: force this class to be polymorphic
#ifdef QT_NO_QOBJECT #ifdef QT_NO_QOBJECT
@ -156,7 +156,6 @@ public:
static bool setuidAllowed; static bool setuidAllowed;
static uint attribs; static uint attribs;
static inline bool testAttribute(uint flag) { return attribs & (1 << flag); } static inline bool testAttribute(uint flag) { return attribs & (1 << flag); }
static int app_compile_version;
void processCommandLineArguments(); void processCommandLineArguments();
QString qmljs_debug_arguments; // a string containing arguments for js/qml debugging. QString qmljs_debug_arguments; // a string containing arguments for js/qml debugging.