diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qglobal.h | 4 | ||||
-rw-r--r-- | src/corelib/io/qdatastream.h | 5 | ||||
-rw-r--r-- | src/corelib/kernel/qjni.cpp | 10 | ||||
-rw-r--r-- | src/corelib/kernel/qjni_p.h | 8 | ||||
-rw-r--r-- | src/corelib/plugin/qpluginloader.cpp | 26 | ||||
-rw-r--r-- | src/corelib/tools/qcommandlineoption.cpp | 30 | ||||
-rw-r--r-- | src/corelib/tools/qcommandlineoption.h | 3 | ||||
-rw-r--r-- | src/corelib/tools/qcommandlineparser.cpp | 2 |
8 files changed, 74 insertions, 14 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index a171f0894b..2d3a78db01 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -41,11 +41,11 @@ #include <stddef.h> -#define QT_VERSION_STR "5.5.0" +#define QT_VERSION_STR "5.6.0" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x050500 +#define QT_VERSION 0x050600 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index 436bf8dd57..b87dbe4784 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -83,10 +83,11 @@ public: Qt_5_3 = Qt_5_2, Qt_5_4 = 16, Qt_5_5 = Qt_5_4, -#if QT_VERSION >= 0x050600 + Qt_5_6 = Qt_5_5, +#if QT_VERSION >= 0x050700 #error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion #endif - Qt_DefaultCompiledVersion = Qt_5_5 + Qt_DefaultCompiledVersion = Qt_5_6 }; enum ByteOrder { diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp index 694463b9d8..2290a74c31 100644 --- a/src/corelib/kernel/qjni.cpp +++ b/src/corelib/kernel/qjni.cpp @@ -204,6 +204,15 @@ static jfieldID getCachedFieldID(JNIEnv *env, } } +void QJNILocalRefDeleter::cleanup(jobject obj) +{ + if (obj == 0) + return; + + QJNIEnvironmentPrivate env; + env->DeleteLocalRef(obj); +} + class QJNIEnvironmentPrivateTLS { public: @@ -2258,4 +2267,3 @@ bool QJNIObjectPrivate::isSameObject(const QJNIObjectPrivate &other) const } QT_END_NAMESPACE - diff --git a/src/corelib/kernel/qjni_p.h b/src/corelib/kernel/qjni_p.h index e79caed5b8..ae9c7c3a7e 100644 --- a/src/corelib/kernel/qjni_p.h +++ b/src/corelib/kernel/qjni_p.h @@ -51,6 +51,14 @@ QT_BEGIN_NAMESPACE +struct Q_CORE_EXPORT QJNILocalRefDeleter +{ + static void cleanup(jobject obj); +}; + +// To simplify this we only define it for jobjects. +typedef QScopedPointer<_jobject, QJNILocalRefDeleter> QJNIScopedLocalRef; + class Q_CORE_EXPORT QJNIEnvironmentPrivate { public: diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp index 8ed9199c60..2800656c13 100644 --- a/src/corelib/plugin/qpluginloader.cpp +++ b/src/corelib/plugin/qpluginloader.cpp @@ -273,6 +273,13 @@ bool QPluginLoader::isLoaded() const #if defined(QT_SHARED) static QString locatePlugin(const QString& fileName) { + const bool isAbsolute = QDir::isAbsolutePath(fileName); + if (isAbsolute) { + QFileInfo fi(fileName); + if (fi.isFile()) { + return fi.canonicalFilePath(); + } + } QStringList prefixes = QLibraryPrivate::prefixes_sys(); prefixes.prepend(QString()); QStringList suffixes = QLibraryPrivate::suffixes_sys(QString()); @@ -281,12 +288,18 @@ static QString locatePlugin(const QString& fileName) // Split up "subdir/filename" const int slash = fileName.lastIndexOf('/'); const QString baseName = fileName.mid(slash + 1); - const QString basePath = fileName.left(slash + 1); // keep the '/' + const QString basePath = isAbsolute ? QString() : fileName.left(slash + 1); // keep the '/' const bool debug = qt_debug_component(); - QStringList paths = QCoreApplication::libraryPaths(); - paths.prepend(QStringLiteral("./")); // search in current dir first + QStringList paths; + if (isAbsolute) { + paths.append(fileName.left(slash)); // don't include the '/' + } else { + paths = QCoreApplication::libraryPaths(); + paths.prepend(QStringLiteral(".")); // search in current dir first + } + foreach (const QString &path, paths) { foreach (const QString &prefix, prefixes) { foreach (const QString &suffix, suffixes) { @@ -337,12 +350,7 @@ void QPluginLoader::setFileName(const QString &fileName) did_load = false; } - QFileInfo fi(fileName); - QString fn; - if (fi.isAbsolute()) - fn = fi.canonicalFilePath(); - else - fn = locatePlugin(fileName); + const QString fn = locatePlugin(fileName); d = QLibraryPrivate::findOrCreate(fn, QString(), lh); if (!fn.isEmpty()) diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp index 7f898f68a8..51723f4a57 100644 --- a/src/corelib/tools/qcommandlineoption.cpp +++ b/src/corelib/tools/qcommandlineoption.cpp @@ -42,6 +42,7 @@ class QCommandLineOptionPrivate : public QSharedData { public: inline QCommandLineOptionPrivate() + : hidden(false) { } void setNames(const QStringList &nameList); @@ -58,6 +59,9 @@ public: //! The list of default values used for this option. QStringList defaultValues; + + //! Show or hide in --help + bool hidden; }; /*! @@ -362,4 +366,30 @@ QStringList QCommandLineOption::defaultValues() const return d->defaultValues; } +/*! + Sets whether to hide this option in the user-visible help output. + + All options are visible by default. Setting \a hidden to true for + a particular option makes it internal, i.e. not listed in the help output. + + \since 5.6 + \sa isHidden + */ +void QCommandLineOption::setHidden(bool hide) +{ + d->hidden = hide; +} + +/*! + Returns true if this option is omitted from the help output, + false if the option is listed. + + \since 5.6 + \sa setHidden() + */ +bool QCommandLineOption::isHidden() const +{ + return d->hidden; +} + QT_END_NAMESPACE diff --git a/src/corelib/tools/qcommandlineoption.h b/src/corelib/tools/qcommandlineoption.h index cf4160ecd2..85fc5ca6dd 100644 --- a/src/corelib/tools/qcommandlineoption.h +++ b/src/corelib/tools/qcommandlineoption.h @@ -77,6 +77,9 @@ public: void setDefaultValues(const QStringList &defaultValues); QStringList defaultValues() const; + void setHidden(bool hidden); + bool isHidden() const; + private: QSharedDataPointer<QCommandLineOptionPrivate> d; }; diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp index 21bc14a272..c1e40bf5cd 100644 --- a/src/corelib/tools/qcommandlineparser.cpp +++ b/src/corelib/tools/qcommandlineparser.cpp @@ -1062,6 +1062,8 @@ QString QCommandLineParserPrivate::helpText() const ++longestOptionNameString; for (int i = 0; i < commandLineOptionList.count(); ++i) { const QCommandLineOption &option = commandLineOptionList.at(i); + if (option.isHidden()) + continue; text += wrapText(optionNameList.at(i), longestOptionNameString, option.description()); } if (!positionalArgumentDefinitions.isEmpty()) { |