diff --git a/desktop/toolkit/qt5/qt5-base/files/add docs for QPlatformTheme.patch b/desktop/toolkit/qt5/qt5-base/files/add docs for QPlatformTheme.patch new file mode 100644 index 0000000000..99f7f5387e --- /dev/null +++ b/desktop/toolkit/qt5/qt5-base/files/add docs for QPlatformTheme.patch @@ -0,0 +1,46 @@ +From c71fc3860b0947c3c793578117e9eb0a3eb3fb31 Mon Sep 17 00:00:00 2001 +From: Shawn Rutledge +Date: Thu, 24 Nov 2016 11:58:19 +0100 +Subject: [PATCH] add docs for QPlatformTheme::WheelScrollLines, + MouseDoubleClickDistance +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf8 +Content-Transfer-Encoding: 8bit + +These theme hints were added in fac71528 and 4a2e297b respectively. + +Change-Id: Ic39f32dae4d0843b1b2398beb27081ad07d75772 +Reviewed-by: Jan Arve Sæther +(cherry picked from commit 847a152474550e0952d31f15069fb346565938df) +Reviewed-by: Simo Fält +--- + src/gui/kernel/qplatformtheme.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp +index 7f74959..2379b23 100644 +--- a/src/gui/kernel/qplatformtheme.cpp ++++ b/src/gui/kernel/qplatformtheme.cpp +@@ -79,6 +79,10 @@ QT_BEGIN_NAMESPACE + \value MouseDoubleClickInterval (int) Mouse double click interval in ms, + overriding QPlatformIntegration::styleHint. + ++ \value MouseDoubleClickDistance (int) The maximum distance in logical pixels which the mouse can travel ++ between clicks in order for the click sequence to be handled as a double click. ++ The default value is 5 logical pixels. ++ + \value MousePressAndHoldInterval (int) Mouse press and hold interval in ms, + overriding QPlatformIntegration::styleHint. + +@@ -88,6 +92,9 @@ QT_BEGIN_NAMESPACE + \value StartDragTime (int) Start drag time in ms, + overriding QPlatformIntegration::styleHint. + ++ \value WheelScrollLines (int) The number of lines to scroll a widget, when the mouse wheel is rotated. ++ The default value is 3. \sa QApplication::wheelScrollLines() ++ + \value KeyboardAutoRepeatRate (int) Keyboard auto repeat rate, + overriding QPlatformIntegration::styleHint. + +-- +2.7.4 diff --git a/desktop/toolkit/qt5/qt5-base/files/fix the JPEG EXIF reader.patch b/desktop/toolkit/qt5/qt5-base/files/fix the JPEG EXIF reader.patch new file mode 100644 index 0000000000..f4b877dcfe --- /dev/null +++ b/desktop/toolkit/qt5/qt5-base/files/fix the JPEG EXIF reader.patch @@ -0,0 +1,167 @@ +From a55f36211efe1bb0d6717c8545366120bd6dfd9f Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Mon, 21 Nov 2016 15:17:03 -0800 +Subject: Fix the JPEG EXIF reader to deal with some broken/corrupt files + +We parse the EXIF header in order to get the proper orientation, so +let's be a bit more careful in what we accept. This patch adds better +handling for reading past the end of the stream, plus it limits the +number of IFDs read (to avoid processing too much data) and deals with a +pathological case of the EXIF file format: EXIF (due to its TIFF +origins) permits the offset to the next IFD to be backwards in the file, +which means it could result in a loop or pointing to plain corrupt data. +We disallow any backwards pointers, since it seems that's what other +decoders do (libexif, for example). + +Change-Id: Iaeecaffe26af4535b416fffd1489332db92e3888 +(cherry picked from 5.6 commit 02150649f95b8f46f826e6e002be3fa0b6d009bc) +Reviewed-by: Allan Sandfeld Jensen +--- + src/gui/image/qjpeghandler.cpp | 31 ++++++++++++++------- + .../jpeg_exif_invalid_data_back_pointers.jpg | Bin 0 -> 910 bytes + .../images/jpeg_exif_invalid_data_past_end.jpg | Bin 0 -> 910 bytes + .../jpeg_exif_invalid_data_too_many_ifds.jpg | Bin 0 -> 964 bytes + .../jpeg_exif_invalid_data_too_many_tags.jpg | Bin 0 -> 910 bytes + tests/auto/gui/image/qimage/tst_qimage.cpp | 17 +++++++++-- + 6 files changed, 35 insertions(+), 13 deletions(-) + create mode 100644 tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_back_pointers.jpg + create mode 100644 tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_past_end.jpg + create mode 100644 tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_ifds.jpg + create mode 100644 tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_tags.jpg + +diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp +index 52e8b39..f3ba303 100644 +--- a/src/gui/image/qjpeghandler.cpp ++++ b/src/gui/image/qjpeghandler.cpp +@@ -786,6 +786,10 @@ static bool readExifHeader(QDataStream &stream) + */ + static int getExifOrientation(QByteArray &exifData) + { ++ // Current EXIF version (2.3) says there can be at most 5 IFDs, ++ // byte we allow for 10 so we're able to deal with future extensions. ++ const int maxIfdCount = 10; ++ + QDataStream stream(&exifData, QIODevice::ReadOnly); + + if (!readExifHeader(stream)) +@@ -793,7 +797,8 @@ static int getExifOrientation(QByteArray &exifData) + + quint16 val; + quint32 offset; +- const qint64 headerStart = stream.device()->pos(); ++ const qint64 headerStart = 6; // the EXIF header has a constant size ++ Q_ASSERT(headerStart == stream.device()->pos()); + + // read byte order marker + stream >> val; +@@ -804,7 +809,7 @@ static int getExifOrientation(QByteArray &exifData) + else + return -1; // unknown byte order + +- // read size ++ // confirm byte order + stream >> val; + if (val != 0x2a) + return -1; +@@ -812,18 +817,22 @@ static int getExifOrientation(QByteArray &exifData) + stream >> offset; + + // read IFD +- while (!stream.atEnd()) { ++ for (int n = 0; n < maxIfdCount; ++n) { + quint16 numEntries; + +- // skip offset bytes to get the next IFD + const qint64 bytesToSkip = offset - (stream.device()->pos() - headerStart); +- +- if (stream.skipRawData(bytesToSkip) != bytesToSkip) ++ if (bytesToSkip < 0 || (offset + headerStart >= exifData.size())) { ++ // disallow going backwards, though it's permitted in the spec + return -1; ++ } else if (bytesToSkip != 0) { ++ // seek to the IFD ++ if (!stream.device()->seek(offset + headerStart)) ++ return -1; ++ } + + stream >> numEntries; + +- for (; numEntries > 0; --numEntries) { ++ for (; numEntries > 0 && stream.status() == QDataStream::Ok; --numEntries) { + quint16 tag; + quint16 type; + quint32 components; +@@ -847,12 +856,14 @@ static int getExifOrientation(QByteArray &exifData) + + // read offset to next IFD + stream >> offset; ++ if (stream.status() != QDataStream::Ok) ++ return -1; + if (offset == 0) // this is the last IFD +- break; ++ return 0; // No Exif orientation was found + } + +- // No Exif orientation was found +- return 0; ++ // too many IFDs ++ return -1; + } + + static QImageIOHandler::Transformations exif2Qt(int exifOrientation) +diff --git a/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_back_pointers.jpg b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_back_pointers.jpg +new file mode 100644 +index 0000000..164d308 +Binary files /dev/null and b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_back_pointers.jpg differ +diff --git a/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_past_end.jpg b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_past_end.jpg +new file mode 100644 +index 0000000..7e2451e +Binary files /dev/null and b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_past_end.jpg differ +diff --git a/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_ifds.jpg b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_ifds.jpg +new file mode 100644 +index 0000000..52c6a93 +Binary files /dev/null and b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_ifds.jpg differ +diff --git a/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_tags.jpg b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_tags.jpg +new file mode 100644 +index 0000000..6a080aa +Binary files /dev/null and b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_too_many_tags.jpg differ +diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp +index 85d258d..26772d5 100644 +--- a/tests/auto/gui/image/qimage/tst_qimage.cpp ++++ b/tests/auto/gui/image/qimage/tst_qimage.cpp +@@ -183,7 +183,8 @@ private slots: + void exifOrientation(); + + void exif_QTBUG45865(); +- void exif_invalid_data_QTBUG46870(); ++ void exifInvalidData_data(); ++ void exifInvalidData(); + + void cleanupFunctions(); + +@@ -3028,10 +3029,20 @@ void tst_QImage::exif_QTBUG45865() + QCOMPARE(image.size(), QSize(5, 8)); + } + +-void tst_QImage::exif_invalid_data_QTBUG46870() ++void tst_QImage::exifInvalidData_data() ++{ ++ QTest::addColumn("$never used"); ++ QTest::newRow("QTBUG-46870"); ++ QTest::newRow("back_pointers"); ++ QTest::newRow("past_end"); ++ QTest::newRow("too_many_ifds"); ++ QTest::newRow("too_many_tags"); ++} ++ ++void tst_QImage::exifInvalidData() + { + QImage image; +- QVERIFY(image.load(m_prefix + "jpeg_exif_invalid_data_QTBUG-46870.jpg")); ++ QVERIFY(image.load(m_prefix + "jpeg_exif_invalid_data_" + QTest::currentDataTag() + ".jpg")); + QVERIFY(!image.isNull()); + } + +-- +cgit v1.0-4-g1e03 + diff --git a/desktop/toolkit/qt5/qt5-base/files/qsettings_XDG_CONFIG_DIRS.patch b/desktop/toolkit/qt5/qt5-base/files/qsettings_XDG_CONFIG_DIRS.patch new file mode 100644 index 0000000000..e7edee182b --- /dev/null +++ b/desktop/toolkit/qt5/qt5-base/files/qsettings_XDG_CONFIG_DIRS.patch @@ -0,0 +1,280 @@ +From 4758555f3e44af3425f0b691dc38fb40f3c9413d Mon Sep 17 00:00:00 2001 +From: Palo Kisa +Date: Wed, 24 Aug 2016 02:29:59 +0200 +Subject: QSettings: Add proper support for XDG_CONFIG_DIRS + +Update fallback mechanism for Q_XDG_PLATFORM based systems to follow the +Xdg specification. + +[ChangeLog][QtCore][QSettings] Added proper support for system-wide +configuration file lookup based on Xdg spec (XDG_CONFIG_DIRS) on Unix +based systems + +Task-number: QTBUG-34919 +Change-Id: Ieddee1c0b3b1506bf19aa865bdab87fc81d58cfd +Reviewed-by: Thiago Macieira +--- + src/corelib/io/qsettings.cpp | 94 +++++++++++++++++------ + tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 73 ++++++++++++++++++ + 2 files changed, 145 insertions(+), 22 deletions(-) + +diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp +index c3b2176..b67afe0 100644 +--- a/src/corelib/io/qsettings.cpp ++++ b/src/corelib/io/qsettings.cpp +@@ -136,7 +136,18 @@ Q_DECLARE_TYPEINFO(QConfFileCustomFormat, Q_MOVABLE_TYPE); + + typedef QHash ConfFileHash; + typedef QCache ConfFileCache; +-typedef QHash PathHash; ++namespace { ++ struct Path ++ { ++ // Note: Defining constructors explicitly because of buggy C++11 ++ // implementation in MSVC (uniform initialization). ++ Path() {} ++ Path(const QString & p, bool ud) : path(p), userDefined(ud) {} ++ QString path; ++ bool userDefined; //!< true - user defined, overridden by setPath ++ }; ++} ++typedef QHash PathHash; + typedef QVector CustomFormatVector; + + Q_GLOBAL_STATIC(ConfFileHash, usedHashFunc) +@@ -1065,22 +1076,22 @@ static void initDefaultPaths(QMutexLocker *locker) + */ + #ifdef Q_OS_WIN + pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), +- windowsConfigPath(CSIDL_APPDATA) + QDir::separator()); ++ Path(windowsConfigPath(CSIDL_APPDATA) + QDir::separator(), false)); + pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope), +- windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator()); ++ Path(windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator(), false)); + #else + const QString userPath = make_user_path(); +- pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), userPath); +- pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope), systemPath); ++ pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), Path(userPath, false)); ++ pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope), Path(systemPath, false)); + #ifndef Q_OS_MAC +- pathHash->insert(pathHashKey(QSettings::NativeFormat, QSettings::UserScope), userPath); +- pathHash->insert(pathHashKey(QSettings::NativeFormat, QSettings::SystemScope), systemPath); ++ pathHash->insert(pathHashKey(QSettings::NativeFormat, QSettings::UserScope), Path(userPath, false)); ++ pathHash->insert(pathHashKey(QSettings::NativeFormat, QSettings::SystemScope), Path(systemPath, false)); + #endif + #endif // Q_OS_WIN + } + } + +-static QString getPath(QSettings::Format format, QSettings::Scope scope) ++static Path getPath(QSettings::Format format, QSettings::Scope scope) + { + Q_ASSERT((int)QSettings::NativeFormat == 0); + Q_ASSERT((int)QSettings::IniFormat == 1); +@@ -1090,14 +1101,23 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope) + if (pathHash->isEmpty()) + initDefaultPaths(&locker); + +- QString result = pathHash->value(pathHashKey(format, scope)); +- if (!result.isEmpty()) ++ Path result = pathHash->value(pathHashKey(format, scope)); ++ if (!result.path.isEmpty()) + return result; + + // fall back on INI path + return pathHash->value(pathHashKey(QSettings::IniFormat, scope)); + } + ++#if defined(QT_BUILD_INTERNAL) && defined(Q_XDG_PLATFORM) && !defined(QT_NO_STANDARDPATHS) ++// Note: Suitable only for autotests. ++void Q_AUTOTEST_EXPORT clearDefaultPaths() ++{ ++ QMutexLocker locker(&settingsGlobalMutex); ++ pathHashFunc()->clear(); ++} ++#endif // QT_BUILD_INTERNAL && Q_XDG_PLATFORM && !QT_NO_STANDARDPATHS ++ + QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, + QSettings::Scope scope, + const QString &organization, +@@ -1117,16 +1137,44 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, + QString orgFile = org + extension; + + if (scope == QSettings::UserScope) { +- QString userPath = getPath(format, QSettings::UserScope); ++ Path userPath = getPath(format, QSettings::UserScope); + if (!application.isEmpty()) +- confFiles.append(QConfFile::fromName(userPath + appFile, true)); +- confFiles.append(QConfFile::fromName(userPath + orgFile, true)); ++ confFiles.append(QConfFile::fromName(userPath.path + appFile, true)); ++ confFiles.append(QConfFile::fromName(userPath.path + orgFile, true)); + } + +- QString systemPath = getPath(format, QSettings::SystemScope); +- if (!application.isEmpty()) +- confFiles.append(QConfFile::fromName(systemPath + appFile, false)); +- confFiles.append(QConfFile::fromName(systemPath + orgFile, false)); ++ Path systemPath = getPath(format, QSettings::SystemScope); ++#if defined(Q_XDG_PLATFORM) && !defined(QT_NO_STANDARDPATHS) ++ // check if the systemPath wasn't overridden by QSettings::setPath() ++ if (!systemPath.userDefined) { ++ // Note: We can't use QStandardPaths::locateAll() as we need all the ++ // possible files (not just the existing ones) and there is no way ++ // to exclude user specific (XDG_CONFIG_HOME) directory from the search. ++ QStringList dirs = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation); ++ // remove the QStandardLocation::writableLocation() (XDG_CONFIG_HOME) ++ if (!dirs.isEmpty()) ++ dirs.takeFirst(); ++ QStringList paths; ++ if (!application.isEmpty()) { ++ paths.reserve(dirs.size() * 2); ++ for (const auto &dir : qAsConst(dirs)) ++ paths.append(dir + QLatin1Char('/') + appFile); ++ } else { ++ paths.reserve(dirs.size()); ++ } ++ for (const auto &dir : qAsConst(dirs)) ++ paths.append(dir + QLatin1Char('/') + orgFile); ++ ++ // Note: No check for existence of files is done intentionaly. ++ for (const auto &path : qAsConst(paths)) ++ confFiles.append(QConfFile::fromName(path, false)); ++ } else ++#endif // Q_XDG_PLATFORM && !QT_NO_STANDARDPATHS ++ { ++ if (!application.isEmpty()) ++ confFiles.append(QConfFile::fromName(systemPath.path + appFile, false)); ++ confFiles.append(QConfFile::fromName(systemPath.path + orgFile, false)); ++ } + + initAccess(); + } +@@ -2169,9 +2217,10 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, + \list 1 + \li \c{$HOME/.config/MySoft/Star Runner.conf} (Qt for Embedded Linux: \c{$HOME/Settings/MySoft/Star Runner.conf}) + \li \c{$HOME/.config/MySoft.conf} (Qt for Embedded Linux: \c{$HOME/Settings/MySoft.conf}) +- \li \c{/etc/xdg/MySoft/Star Runner.conf} +- \li \c{/etc/xdg/MySoft.conf} ++ \li for each directory in $XDG_CONFIG_DIRS: \c{/MySoft/Star Runner.conf} ++ \li for each directory in $XDG_CONFIG_DIRS: \c{/MySoft.conf} + \endlist ++ \note If XDG_CONFIG_DIRS is unset, the default value of \c{/etc/xdg} is used. + + On \macos versions 10.2 and 10.3, these files are used by + default: +@@ -2206,9 +2255,10 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, + \list 1 + \li \c{$HOME/.config/MySoft/Star Runner.ini} (Qt for Embedded Linux: \c{$HOME/Settings/MySoft/Star Runner.ini}) + \li \c{$HOME/.config/MySoft.ini} (Qt for Embedded Linux: \c{$HOME/Settings/MySoft.ini}) +- \li \c{/etc/xdg/MySoft/Star Runner.ini} +- \li \c{/etc/xdg/MySoft.ini} ++ \li for each directory in $XDG_CONFIG_DIRS: \c{/MySoft/Star Runner.ini} ++ \li for each directory in $XDG_CONFIG_DIRS: \c{/MySoft.ini} + \endlist ++ \note If XDG_CONFIG_DIRS is unset, the default value of \c{/etc/xdg} is used. + + On Windows, the following files are used: + +@@ -3360,7 +3410,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) + PathHash *pathHash = pathHashFunc(); + if (pathHash->isEmpty()) + initDefaultPaths(&locker); +- pathHash->insert(pathHashKey(format, scope), path + QDir::separator()); ++ pathHash->insert(pathHashKey(format, scope), Path(path + QDir::separator(), true)); + } + + /*! +diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +index 2f039cb..0e8a784 100644 +--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp ++++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +@@ -159,6 +159,7 @@ private slots: + void iniCodec(); + void bom(); + ++ void testXdg(); + private: + void cleanupTestFiles(); + +@@ -3397,5 +3398,77 @@ void tst_QSettings::consistentRegistryStorage() + } + #endif + ++#if defined(QT_BUILD_INTERNAL) && defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) && !defined(Q_OS_ANDROID) && !defined(QT_NO_STANDARDPATHS) ++QT_BEGIN_NAMESPACE ++extern void clearDefaultPaths(); ++QT_END_NAMESPACE ++#endif ++void tst_QSettings::testXdg() ++{ ++#if defined(QT_BUILD_INTERNAL) && defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) && !defined(Q_OS_ANDROID) && !defined(QT_NO_STANDARDPATHS) ++ // Note: The XDG_CONFIG_DIRS test must be done before overriding the system path ++ // by QSettings::setPath/setSystemIniPath (used in cleanupTestFiles()). ++ clearDefaultPaths(); ++ ++ // Initialize the env. variable & populate testing files. ++ const QStringList config_dirs = { settingsPath("xdg_1st"), settingsPath("xdg_2nd"), settingsPath("xdg_3rd") }; ++ qputenv("XDG_CONFIG_DIRS", config_dirs.join(':').toUtf8()); ++ QList xdg_orgs, xdg_apps; ++ for (const auto & dir : config_dirs) { ++ xdg_orgs << new QSettings{dir + "/software.org.conf", QSettings::NativeFormat}; ++ xdg_apps << new QSettings{dir + "/software.org/KillerAPP.conf", QSettings::NativeFormat}; ++ } ++ Q_ASSERT(config_dirs.size() == 3 && xdg_orgs.size() == 3 && xdg_apps.size() == 3); ++ for (int i = 0; i < 3; ++i) { ++ xdg_orgs[i]->setValue("all", QString{"all_org%1"}.arg(i)); ++ xdg_apps[i]->setValue("all", QString{"all_app%1"}.arg(i)); ++ xdg_orgs[i]->setValue("all_only_org", QString{"all_only_org%1"}.arg(i)); ++ xdg_apps[i]->setValue("all_only_app", QString{"all_only_app%1"}.arg(i)); ++ ++ if (i > 0) { ++ xdg_orgs[i]->setValue("from2nd", QString{"from2nd_org%1"}.arg(i)); ++ xdg_apps[i]->setValue("from2nd", QString{"from2nd_app%1"}.arg(i)); ++ xdg_orgs[i]->setValue("from2nd_only_org", QString{"from2nd_only_org%1"}.arg(i)); ++ xdg_apps[i]->setValue("from2nd_only_app", QString{"from2nd_only_app%1"}.arg(i)); ++ } ++ ++ if (i > 1) { ++ xdg_orgs[i]->setValue("from3rd", QString{"from3rd_org%1"}.arg(i)); ++ xdg_apps[i]->setValue("from3rd", QString{"from3rd_app%1"}.arg(i)); ++ xdg_orgs[i]->setValue("from3rd_only_org", QString{"from3rd_only_org%1"}.arg(i)); ++ xdg_apps[i]->setValue("from3rd_only_app", QString{"from3rd_only_app%1"}.arg(i)); ++ } ++ } ++ qDeleteAll(xdg_apps); ++ qDeleteAll(xdg_orgs); ++ ++ // Do the test. ++ QSettings app{QSettings::SystemScope, "software.org", "KillerAPP"}, org{QSettings::SystemScope, "software.org"}; ++ ++ QVERIFY(app.value("all").toString() == "all_app0"); ++ QVERIFY(org.value("all").toString() == "all_org0"); ++ QVERIFY(app.value("all_only_org").toString() == "all_only_org0"); ++ QVERIFY(org.value("all_only_org").toString() == "all_only_org0"); ++ QVERIFY(app.value("all_only_app").toString() == "all_only_app0"); ++ QVERIFY(org.value("all_only_app").toString() == QString{}); ++ ++ QVERIFY(app.value("from2nd").toString() == "from2nd_app1"); ++ QVERIFY(org.value("from2nd").toString() == "from2nd_org1"); ++ QVERIFY(app.value("from2nd_only_org").toString() == "from2nd_only_org1"); ++ QVERIFY(org.value("from2nd_only_org").toString() == "from2nd_only_org1"); ++ QVERIFY(app.value("from2nd_only_app").toString() == "from2nd_only_app1"); ++ QVERIFY(org.value("from2nd_only_app").toString() == QString{}); ++ ++ QVERIFY(app.value("from3rd").toString() == "from3rd_app2"); ++ QVERIFY(org.value("from3rd").toString() == "from3rd_org2"); ++ QVERIFY(app.value("from3rd_only_org").toString() == "from3rd_only_org2"); ++ QVERIFY(org.value("from3rd_only_org").toString() == "from3rd_only_org2"); ++ QVERIFY(app.value("from3rd_only_app").toString() == "from3rd_only_app2"); ++ QVERIFY(org.value("from3rd_only_app").toString() == QString{}); ++#else ++ QSKIP("This test is performed in QT_BUILD_INTERNAL on Q_XDG_PLATFORM with use of standard paths only."); ++#endif ++} ++ + QTEST_MAIN(tst_QSettings) + #include "tst_qsettings.moc" +-- +cgit v1.0-4-g1e03 + diff --git a/desktop/toolkit/qt5/qt5-base/files/qt5-base-firebird.patch b/desktop/toolkit/qt5/qt5-base/files/qt5-base-firebird.patch new file mode 100644 index 0000000000..58740cbf77 --- /dev/null +++ b/desktop/toolkit/qt5/qt5-base/files/qt5-base-firebird.patch @@ -0,0 +1,45 @@ +diff -up qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp.than qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp +--- qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp.than 2016-11-28 11:53:02.621749003 -0500 ++++ qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.cpp 2016-11-28 11:53:17.072001489 -0500 +@@ -37,7 +37,7 @@ + ** + ****************************************************************************/ + +-#include ++#include + + int main(int, char **) + { +diff -up qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro.than qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro +--- qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro.than 2016-11-29 08:00:35.270039482 -0500 ++++ qtbase-opensource-src-5.7.1/config.tests/unix/ibase/ibase.pro 2016-11-29 08:00:41.280142713 -0500 +@@ -1,3 +1,3 @@ + SOURCES = ibase.cpp + CONFIG -= qt dylib +-LIBS += -lgds ++LIBS += -lfbclient +diff -up qtbase-opensource-src-5.7.1/src/plugins/sqldrivers/ibase/ibase.pro.than qtbase-opensource-src-5.7.1/src/plugins/sqldrivers/ibase/ibase.pro +diff -up qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri.than qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri +--- qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri.than 2016-11-29 08:04:26.344004252 -0500 ++++ qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase.pri 2016-11-29 08:04:56.684523066 -0500 +@@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_ibase_p.h + SOURCES += $$PWD/qsql_ibase.cpp + + unix { +- !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds ++ !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lfbclient + } else { + !contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) { + LIBS += -lgds32_ms +diff -up qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h.than qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h +--- qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h.than 2016-11-29 08:27:25.917767879 -0500 ++++ qtbase-opensource-src-5.7.1/src/sql/drivers/ibase/qsql_ibase_p.h 2016-11-29 08:27:53.338244987 -0500 +@@ -52,7 +52,7 @@ + // + + #include +-#include ++#include + + #ifdef QT_PLUGIN + #define Q_EXPORT_SQLDRIVER_IBASE diff --git a/desktop/toolkit/qt5/qt5-base/files/qt5-base-hdpi-scale.patch b/desktop/toolkit/qt5/qt5-base/files/qt5-base-hdpi-scale.patch new file mode 100644 index 0000000000..6bcd5a1ae5 --- /dev/null +++ b/desktop/toolkit/qt5/qt5-base/files/qt5-base-hdpi-scale.patch @@ -0,0 +1,11 @@ + --- qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp.orig 2017-01-11 11:42:59.544860428 +0100 ++++ qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp 2017-01-11 11:43:51.142956762 +0100 +@@ -633,7 +633,7 @@ void QXcbScreen::updateGeometry(const QR + m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi()); + + qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4); +- m_pixelDensity = qRound(dpi/96); ++ m_pixelDensity = (int) (dpi/96); // instead of rounding at 1.5, round at 2.0 (same as GNOME) + m_geometry = QRect(xGeometry.topLeft(), xGeometry.size()); + m_availableGeometry = xGeometry & m_virtualDesktop->workArea(); + QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry); diff --git a/desktop/toolkit/qt5/qt5-base/files/qt5-base-libpng.patch b/desktop/toolkit/qt5/qt5-base/files/qt5-base-libpng.patch new file mode 100644 index 0000000000..c6afdc41ef --- /dev/null +++ b/desktop/toolkit/qt5/qt5-base/files/qt5-base-libpng.patch @@ -0,0 +1,33 @@ +--- qtbase-opensource-src-5.7.1/src/src.pro.orig 2016-10-05 19:33:26.000000000 +0200 ++++ qtbase-opensource-src-5.7.1/src/src.pro 2016-11-09 12:31:35.781935319 +0100 +@@ -135,8 +135,10 @@ + contains(QT_CONFIG, zlib)|cross_compile { + SUBDIRS += src_qtzlib + contains(QT_CONFIG, zlib) { +- src_3rdparty_libpng.depends += src_corelib +- src_3rdparty_freetype.depends += src_corelib ++ !contains(QT_CONFIG, system-png) { ++ src_3rdparty_libpng.depends += src_corelib ++ src_3rdparty_freetype.depends += src_corelib ++ } + } + } + SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc +@@ -167,10 +169,13 @@ + SUBDIRS += src_angle + src_gui.depends += src_angle + } +- contains(QT_CONFIG, png) { +- SUBDIRS += src_3rdparty_libpng +- src_3rdparty_freetype.depends += src_3rdparty_libpng +- src_gui.depends += src_3rdparty_libpng ++ ++ !contains(QT_CONFIG, system-png) { ++ contains(QT_CONFIG, png) { ++ SUBDIRS += src_3rdparty_libpng ++ src_3rdparty_freetype.depends += src_3rdparty_libpng ++ src_gui.depends += src_3rdparty_libpng ++ } + } + contains(QT_CONFIG, freetype) { + SUBDIRS += src_3rdparty_freetype diff --git a/desktop/toolkit/qt5/qt5-base/pspec.xml b/desktop/toolkit/qt5/qt5-base/pspec.xml index ecf802ec63..fb1bec3b68 100644 --- a/desktop/toolkit/qt5/qt5-base/pspec.xml +++ b/desktop/toolkit/qt5/qt5-base/pspec.xml @@ -65,12 +65,18 @@ freetype-devel pulseaudio-libs-devel alsa-lib-devel + libproxy-devel gst-plugins-base-next-devel wayland-devel mkspecs.patch + add docs for QPlatformTheme.patch + + qt5-base-firebird.patch + qt5-base-hdpi-scale.patch + qt5-base-libpng.patch @@ -88,6 +94,8 @@ glib2 icu4c libSM + >firebird-client + libproxy libXi libICE libX11 @@ -233,7 +241,7 @@ libdrm-32bit libpng-32bit sqlite-32bit - + icu4c openssl-32bit freetype-32bit harfbuzz-32bit