Commit Graph

3436 Commits

Author SHA1 Message Date
Friedemann Kleint
54684f10e9 QSaveFile: Fix changing the file name after hitting on readonly file
The call to QFileDevice::unsetError() in QSaveFile::open() does
not clear QSaveFilePrivate::writeError. Clear it in addition.

Fixes: QTBUG-77007
Change-Id: I5e5009750f1726d1c74c1b4eb1c33f3a5393fe4f
Reviewed-by: David Faure <david.faure@kdab.com>
2019-07-11 22:00:10 +02:00
Tor Arne Vestbø
7940791f47 Report correct state change when destroying QAbstractAnimation
Change-Id: Ibe5310e20268d1baa5b329a4d02a3dc38d875008
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-20 12:46:30 +02:00
Jan Arve Sæther
8c7589d992 Do not strip off the fragment and query in the qfileselector
This is needed for cases where we use e.g. "file:///test.html?query#Fragment".
The fragment and query were already preserved for the qrc scheme. This
fixes it for the file scheme.

Change-Id: I5713e4a25372fdd55ac255b1c6228b4dea419244
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-03 12:29:49 +00:00
Edward Welbourne
c3571d2922 Correct qfloat16's 1/inf == 0 test
It should have been qfloat16(1)/qfloat16(infinity) in any case.
Sadly, that behaves no better than qfloat16(1.f/qfloat16(infinity)),
which was promoting the infinity back to float.  So retain the check
for over-optimization (but make the comment more accurate).

This is a follow-up to d441f6bba7.

Change-Id: Iec4afe4b04081b0ebfbf98058da606dc3ade07f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-27 11:52:22 +02:00
Giuseppe D'Angelo
b9f96cacc9 QRegExp: remove an out of bounds access into QString
... spotted with the brand-new checks for that in QCharRef.

The rx[i] == ~~~ check is clearly wrong, as rx is the regexp
we're building and `i` was not supposed to index into it.

The intended meaning was wc[i] == ~~~, testing if we were seeing
the closing bracket of a character set. We need to check for
that immediately for dealing with the special syntax of []...] where
the ] belongs to the character set (it can't be the closing one
as character sets cannot be empty).

Fix and add a regression test. Bonus: this code was almost
unchanged since 2009.

Change-Id: I958cd87fc25558e9d202d18b3dd4a35d0db16d8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 17:33:30 +00:00
Ryan Chu
cc4c0b43a5 QDataStream: Fix inconsistent results of iostream with QPalette objects
The value of NColorRoles got changed since 5.11. It introduced one more
role called "PlaceholderText" in the ColorRole enumeration.

When using QDataStream (5.12) to read QPalette objects from a file
written by 5.9 (<5.11), the processing results are inconsistent.

Fixes: QTBUG-74885
Change-Id: I14d57f9603a26e5890b4fd57c7e464c5b38eb3f2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-05-20 22:33:33 +02:00
Edward Welbourne
d441f6bba7 Skip flaky qfloat16 1/inf == 0 test on QEMU/Arm64
It's not clear why this test fails - and only does so sometimes - but
fail it does, so we ned to skip it to let development keep going.  As
it happens, the same platform over-optimizes various computations
using qfloat16; which can at least be used to test for this platform,
since it wrongly distinguishes two qfloat16 values that theory and all
other platfomrs agree should coincide.

Fixes: QTBUG-75812
Change-Id: Ie9463d7dc21bca679337b475d13417b9f42bbf9b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-05-15 19:06:52 +00:00
Konstantin Shegunov
c6bee8e4b2 Fix integer overflows in QDeadlineTimer
If the deadline is far in the future, the conversions to nanoseconds
or internal arithmetic may overflow and give an invalid object, thus
the deadline may end up in the past. Added a test to the testlib
selftest for sleep.

[ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows
leading to immediate timeouts.

Task-number: QTBUG-69750
Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-08 17:19:44 +00:00
Edward Welbourne
43abe86e2f Update locale data to CLDR v35.1
The formatting of times in Norwegian has reverted to using dots in
place of colons, as it did before v31 (commit 82deb0ad1), so reverted
the tests to their state before that.

Change-Id: I8a09ce253731bb0f0f3caca117f06ad568940a81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-07 09:29:51 +00:00
Volker Hilsheimer
78d0b6e975 Ignore failing test for free space on APFS
The file system appears to cache too aggressively, so if the reported
storage size doesn't change after flushing to disk, ignore the failure.

Change-Id: Iba7dce79591447fac296bfe92c2dc993d36d0c2a
Fixes: QTBUG-69868
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-30 10:58:13 +00:00
Joerg Bornemann
0e4326d717 Remove cruft from testProcessEOF.pro
TEMPLATE_PREFIX is gone since Qt 5.0.0.

Change-Id: I181962b942191187baf62f13d0abd17e7ebdcce1
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-30 10:51:02 +00:00
Hugo Beauzée-Luyssen
2a815855a9 corelib: invokeMethod: Allow non copyable functors to be used
[ChangeLog][QtCore][QMetaObject] Non-copyable lambdas can now be used
with invokeMethod(). For consistency reasons, the functor object is
now always moved.

Fixes: QTBUG-69683
Change-Id: I66ff5e21d6d1926f0f7c5f8c304bed1a90b69917
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-04-12 20:18:20 +00:00
Volker Hilsheimer
3f17029aa1 Fix resolving NTFS symbolic links that point to UNC shares
Without this change, the target of a symbolic link that points to a UNC
share would include UNC in the target path, and not be correctly made
absolute.

Add a relevant test case, and use the opportunity to factor out the
helper code that creates NTFS symlinks into a function that takes
care of error handling.

The file created with the new test case only gets cleaned up correctly
when passing the file path into QDir::rmdir, which is either way the
right thing to do.

[ChangeLog][QtCore][QFileInfo] Fixed resolving of symbolic links to UNC
shares on NTFS file systems.

Change-Id: I9ba75d627aedf7c4cc289f0cb71088d795d30d8a
Fixes: QTBUG-73688
Task-number: QTBUG-63970
Task-number: QTBUG-30401
Task-number: QTBUG-20791
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-10 04:53:52 +00:00
Milian Wolff
5f2afe18cc Fix QMetaObject::newInstance on non-QObject meta object
QMetaObject::newInstance returns a QObject, thus it's not possible to
create a new instance of a Q_GADGET using this function. Previously, we
returned a non-null QObject pointer for such scenarios, which then
leads to crashes when one tries to use it. Now, we check whether the
meta object inherits QObject's meta object, and error out early
otherwise.

Change-Id: I7b1fb6c8d48b3e98161894be2f281a491963345e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-09 15:46:35 +00:00
Friedemann Kleint
f7949df243 tst_QUrl: Fix left-over temporary directory on Windows
The test changes the current directory to the test directory
in fromUserInputWithCwd(), but did not restore it, causing:

Totals 898 passed, 0 failed, 1 skipped, 0 blacklisted, 368ms
********* Finished testing of tst_QUrl *********
QTemporaryDir Unable to remove "C:\\TEMP\\tst_qurl-ryVxqu" most likely due to the presence of read-only files.

Restore the old directory at the end to fix this.

Change-Id: I62669868f3c6d97dd38ebac76515428c14b7e1e7
Reviewed-by: David Faure <david.faure@kdab.com>
2019-04-08 18:44:25 +00:00
Edward Welbourne
82ad4be4a2 Fix various uncommon cases in QTzTimeZonePrivate backend
Includes a fixup for 03fadc26e7, which
removed the check on empty transition list, needed when no data are
available.  Ensured that such a data-free zone would in fact be
noticed as invalid during init().

Fixed handling of times before the epoch (we still want to consult a
POSIX rule, if that's all that's available) while ensuring we (as
documented) ignore DST for such times.

Fixed handling of large times (milliseconds since epoch outside int
range) when looking up POSIX rules.  Gave QTimeZonePrivate a YearRange
enum (to be moved to QTimeZone once this merges up to dev) so as to
eliminate a magic number (and avoid adding another).  Moved
year-munging in POSIX rules after the one early return, which doesn't
need the year range.

Added test-cases for the distant past/future (just checking UTC's
offsets; SLES has a minimal version of the UTC data-file that triggers
the bugs fixed here for them).

Fixes: QTBUG-74666
Fixes: QTBUG-74550
Change-Id: Ief7b7e55c62cf11064700934f404b2fc283614e1
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 20:31:26 +00:00
Edward Welbourne
954b73445c Refine underflow check in QLocaleData::convertDoubleToFloat()
A string can parse as a non-zero double that's smaller than the
smallest float yet be a faithful representation of the smallest float.
So rather than testing for non-zero doubles less than the smallest
float, test for non-zero doubles that cast to float zero; these
underflow.  This means small values close below the smallest float
shall round up to it, rather than down to zero, requiring a tweak to
an existing test.  Added a test for the boundary case (and tidied the
test data).

Fixes: QTBUG-74833
Change-Id: I4cb30b3c0e54683574b98253505607caaf88fbfb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-01 14:40:14 +00:00
Albert Astals Cid
85a9009f25 QPixmap: More safe failing if qApp is not a QGuiApplication
It can happen that QDataStream is fed a QVariant that contains a QPixmap
representation, that will make the application crash when trying to
restore it

This is specially important for cases in which applications expose dbus
interfaces with QVariantMaps

Change-Id: Ife4feaef30f30e7e27d88464bd6b2a247f743123
Reported-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-22 08:06:43 +00:00
Friedemann Kleint
b01248ebbd Fix tree recursion in QAbstractItemModel::match()
Recurse down the sibling at column 0 of the index instead down the
index.

Change-Id: Ie78d8b28eab7438ca3f83ee0df177115ca82806e
Fixes: QTBUG-73864
Reviewed-by: David Faure <david.faure@kdab.com>
2019-03-22 08:01:35 +00:00
Edward Welbourne
03fadc26e7 Fix broken data for time-zones with no transitions
While an invalid time-zone shall have no transitions, so may various
constant zones, like UTC.  The TZ data may include only the POSIX rule
for such a zone, in which case we should use it, even if there are no
transitions.

Broke out a piece of repeated code as a common method, in the process,
since I was complicating it further.

Added test for the case that revealed this; and made sure we see a
warning if any of the checkOffset() tests gets skipped because its
zone is unsupported.

Fixes: QTBUG-74614
Change-Id: Ic8e039a2a9b3f4e0f567585682a94f4b494b558d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-22 07:32:52 +00:00
Friedemann Kleint
c45f2eab85 Silence the item model tests
Introduce a logging category for the qDebug()-output.

Add a meta type registration for QList<QPersistentModelIndex>, fixing
numerous warnings like:
WARN  : tst_QItemModel::remove(QStandardItemModel:invalid start, valid count 5) QSignalSpy: Unable to handle parameter 'parents' of type 'QList<QPersistentModelIndex>' of method 'layoutChanged', use qRegisterMetaType to register it.

Fix a Clang warning about potential misuse of operator ,

Task-number: QTBUG-73864
Change-Id: I60998403a44f5df8767926951ee13d1ed1e93c37
Reviewed-by: David Faure <david.faure@kdab.com>
2019-03-21 13:39:01 +00:00
Qt Forward Merge Bot
a1808c5dbe Merge remote-tracking branch 'origin/5.12.2' into 5.12
Change-Id: I5f9d8090a07056411fb65d7de60eb679d00e99a3
2019-03-15 11:10:10 +01:00
Kai Koehne
097bf6fdd2 Fix compilation of qCDebug("", ...) with QT_NO_DEBUG_OUTPUT
... and fix QT_NO_INFO_OUTPUT, QT_NO_WARNING_OUTPUT alongside.

Fixes: QTBUG-74359
Change-Id: I2167dc943ae8c52602e08e24ca815d95f82a5db8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-14 17:15:53 +00:00
Alex Richardson
47bb74fd15 Fix build with -no-gui on macOS
Some directories that depend on QtGui were being included without the
appropriate check for qtHaveModule(gui).

Change-Id: I7c348c74464d44cbd35a027f188f8a23bb2021d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-04 12:25:53 +00:00
Juha Karjalainen
0f163887b5 Fix blacklisting tst_QTimer::basic_chrono()
Blacklisting did not work as blacklist should have contained osx
instead macos

Change-Id: Ifd76a38d371ccce545eb5df030aaa819b00a5b48
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-02-21 05:18:00 +00:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".

Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-02-18 07:12:14 +00:00
Edward Welbourne
c066656aff Avoid read-outside-array error by QStringRef over-reach
Constructing a QStringRef directly from the string, offset and a
length is UB if the offset + length exceeds the string's length.
Thanks to Robert Loehning and libFuzzer for finding this.
QString::midRef (as correctly used in both changed uses of QStringRef,
since 432d3b6962) takes care of that for us.  Changed one UB case and
a matching but correct case, for consistency.

In the process, deduplicate a QStringList look-up.
Added tests to exercise the code (but the one that exercises the
formerly UB case doesn't crash before the fix, so isn't very useful;
the invalid read is only outside the array it's scanning, not outside
allocated memory).

Change-Id: I7051bbbc0267dd7ec0a8f75eee2034d0b7eb75a2
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-08 13:56:25 +00:00
Tony Sarajärvi
5d885c8325 Blacklist qtimer/basic_chrono on macos due to flakiness
Task-number: QTBUG-73168
Change-Id: I56b45b7f474bdad73f6cd8514b42475e6107b6be
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-01-30 10:10:19 +00:00
Tony Sarajärvi
49ca66583a Expand blacklisting of qthreadpool to cover linux distros
Task-number: QTBUG-38594
Change-Id: I07dccf8ac6ab07e61ddf6090037ea344449724f8
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2019-01-30 10:10:17 +00:00
Kai Koehne
112278d3d7 Avoid test failures in tst_qtimezone.cpp and Windows 10 1809
The test started to fail now also for latest Windows 10 Update
Restone 2. It's unclear why the test was succeeding before, since this
seems a generic Windows API issue.

Task-number: QTBUG-64985
Task-number: QTQAINFRA-2255
Change-Id: I804f6a61c63ea70157353d1aee9027d0735073ab
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-28 15:02:52 +00:00
Qt Forward Merge Bot
e3da05f39a Merge remote-tracking branch 'origin/5.12.1' into 5.12
Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
2019-01-23 10:13:29 +01:00
Christian Ehrlicher
9f8589befe tst_QString: fix localeAwareCompare() when using ICU
tst_QString::localeAwareCompare() is failing since
ab448f731e because the 'C' locale no
longer initializes ICU and falls back to simple QString comparison.
Fix it by explicitly setting the locale for the testdata to en_US so the
QCollator is properly initialized.

Task-number: QTBUG-73116
Change-Id: I9d4d55e666c5c52f93298dedb7e22da01a25318d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9d2923c1b0)
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-01-21 16:47:32 +00:00
Edward Welbourne
76dfda1ad1 Use RAII to handle setting of default locale in tst_QString
Various tests were setting the default locale and relying on cleanup()
to "restore" the C locale; which needn't actually be the locale we
started out in and, in any case, was the wrong locale for some tests.
So handle this via an RAII class that records the actual prior locale
and restores it on destruction.

Fixes: QTBUG-73116
Change-Id: If44f7cb8c6e0ce81be396ac1ea8bab7038a86729
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-22 16:42:29 +00:00
Christian Ehrlicher
9d2923c1b0 tst_QString: fix localeAwareCompare() when using ICU
tst_QString::localeAwareCompare() is failing since
ab448f731e because the 'C' locale no
longer initializes ICU and falls back to simple QString comparison.
Fix it by explicitly setting the locale for the testdata to en_US so the
QCollator is properly initialized.

Task-number: QTBUG-73116
Change-Id: I9d4d55e666c5c52f93298dedb7e22da01a25318d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-20 13:39:45 +00:00
Oswald Buddenhagen
c365fa49d8 fix out-of-bounds access on trailing percent sign in tr() argument
tr() recognizes %n and %Ln. it offers no way to escape lone percent
signs, which implies that they must be interpreted verbatim, which is
what the code actually does. except that it would run off the end if the
% appeared at the end of the string.

Fixes: QTBUG-57171
Done-with: Mateusz Starzycki <mstarzycki@gmail.com>
Change-Id: Icf81925c482be1ea66ec8daafb3e92ad17ea7fab
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-01-14 08:52:15 +00:00
Edward Welbourne
dd5e7f1a52 Use a more robust test for absolute paths in QDir
Its filePath() and absoluteFilePath() don't trust its own
isAbsolute(), due to some infelicities on MS-Win; and kludged round a
consequent problem with resource paths; but other virtual file systems
weren't catered for.  Replace the convoluted test there with a static
bool function (so that future kludges in this area shall only need to
edit one place; and can document why they're needed) and use a more
robust test that handles all virtual file systems (by asking
QFileInfo) but falls back to QFileSystemEntry to work round the known
infelicities on MS-Win.  Add regression test for asset library paths
issue on iOS.  Ammends 27f1f84c1c.

Moved a couple of local variables to after the early return, since it
doesn't need them, in the process.

Task-number: QTBUG-70237
Change-Id: Ib3954826df40ccf816beebe5c3751497e3bf6433
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-01-13 18:18:10 +00:00
Liang Qi
0e96b5fe48 Merge remote-tracking branch 'origin/5.12' into 5.12.1
Conflicts:
	src/widgets/kernel/qtooltip.cpp

Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
2019-01-08 09:34:24 +01:00
Jędrzej Nowacki
ecdccce8e4 Fix warnings about uninitialized variables
qtbase/src/corelib/kernel/qmetatype.cpp: In static member function ‘static void QMetaType::destroy(int, void*)’:
qtbase/src/corelib/kernel/qmetatype.cpp:2599:27: error: ‘info.QMetaType::m_destructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (m_typedDestructor && !m_destructor)
         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_destructor’ was declared here
     QMetaType info(type);
               ^~~~
qtbase/src/corelib/kernel/qmetatype.cpp:2600:26: error: ‘info.QMetaType::m_typedDestructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         m_typedDestructor(m_typeId, data);
         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_typedDestructor’ was declared here
     QMetaType info(type);
               ^~~~

The extended (not inlined) function may be called on a half
initialized invalid instance.

Change-Id: I26d677a8ad2bd0c5846233f06393e774d377936d
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-06 10:14:36 +00:00
Tony Sarajärvi
8c2ca29045 Revert "Blacklist tst_QTimer::basic_chrono on macOS"
Incorrectly blacklisted.

This reverts commit 40a7c57ba9.

Task-number: QTBUG-61013
Change-Id: I7d9dc4a4b1c8d7ff77ab75c61027b908ffb74552
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-01-04 09:45:41 +00:00
Luca Beldi
ff835a5030 Fix QStringListModel::setData to check for actual changes
QStringListModel::setData documentation states that
"The dataChanged() signal is emitted if the item is changed."
This patch actually respects the doc. setData will check that the data
actually changed before sending the dataChanged signal.

[ChangeLog][QtCore][QStringListModel] setData will now emit the
dataChanged() signal only if the string set is different from
the one already contained in the model

Change-Id: I4308a6f3b4851203fb899c5e29a36076e0c32f2f
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-24 08:07:36 +00:00
Samuel Gaist
649ee12aba QRegularExpression: anchor wildcard pattern
The current implementation of wildcardToRegularExpression doesn't
anchor the pattern which makes it not narrow enough for globbing
patterns. This patch fixes that by applying anchoredPattern before
returning the wildcard pattern.

[ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression
method now returns a properly anchored pattern.

Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5
Fixes: QTBUG-72539
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-15 13:24:16 +00:00
Joni Poikelin
eaf4438b35 Make url normalization closer to common browser behavior
Firefox, Chrome and various http libraries normalize /./ and /../ from
urls, but retain multiple adjacent slashes as is. Qt removes
duplicated slashes which makes it impossible to access some web
resources that rely on those.

Fixes: QTBUG-71973
Change-Id: Ie18ae6ad3264acb252fcd87a754726a8c546e5ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-13 05:23:12 +00:00
Edward Welbourne
ab448f731e Handle QCollator with locale C by delegating to QString
Previously, the C locale was treated as English because each back-end
takes the locale's bcp47Name(), which maps C to en. However, the C
locale has its own rules; which QString helpfully implements; so we
can delegate to it in this case. Extended this to sort keys, where
possible. Clean up existing implementations in the process.

Extended tst_QCollator::compare() with some cases to check this. That
required wrapping the test's calls to collator.compare() in a sign
canonicalizer, since it can return any -ve for < or +ve for >, not
just -1 and +1 for these cases (and it'd be rash to hard-code specific
negative and positive values, as they may vary between backends).

[ChangeLog][QtCore][QCollator] Added support for collation in the C
locale, albeit this is only well-defined for ASCII. Collation sort
keys remain unsupported on Darwin.

Fixes: QTBUG-58621
Change-Id: I327010d90f09bd1b1816f5590cb124e3d423e61d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-11 19:05:07 +00:00
Thiago Macieira
962bded90f Fix QSettings parsing of spaces after comment lines
[ChangeLog][QtCore][QSettings] Fixed QSettings parsing of blank spaces
after comment lines in INI-style configuration files.

Fixes: QTBUG-72007
Change-Id: Idd0c85a4e7b64f9c9c7dfffd156c5b219f3b5c0a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-12-07 18:53:34 +00:00
Edward Welbourne
4ee59cf96d Remove one out-of-date comment, refine another that was imprecise
The former is a follow-up to c17563eca8.

Change-Id: I3cd41e6e38f740de67605f785a804ffd879b9e67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-07 15:59:38 +00:00
Ville Voutilainen
c0dd445564 Fix a nullptr compile error with gcc 4.8
template argument deduction/substitution failed:
qtbase/tests/auto/corelib/kernel/qobject/tst_qobject.cpp:6756:71: note:   mismatched types ‘const typename QtPrivate::FunctionPointer<Func2>::Object*’ and ‘std::nullptr_t’

Change-Id: I8e7872457d1fc30c4b29e96c16091915264f9bce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-30 14:50:00 +00:00
Ulf Hermann
042707a633 Avoid invalid qmake code in macOS-specific pluginloader test
You cannot manipulate variables in custom target dependencies, so the
following code was invalid:

i386_d.depends = EXPORT_VALID_ARCHS=i386

In order to still build the fat binary, we split the project in four,
one for each architecture, plus one to create the final package.

Change-Id: If08cf54e2e4098a7e10df41b7ea8d2bf699f58be
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-30 14:47:29 +00:00
Qt Forward Merge Bot
1b5bbacdb0 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
2018-11-27 01:00:09 +01:00
Sami Nurmenniemi
71bd06d516 Make developer build tests pass for boot2qt
Some tests were fixed and others were skipped/blacklisted.

Task-number: QTBUG-63152
Change-Id: Ica7df555f8d152ee589865911130525101d4b941
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-11-26 07:06:59 +00:00
Edward Welbourne
d8b401959f Recognize E along with e as exponent character in asciiToDouble
Fixed a misguided condition in the check for bogus texts in the sscanf
branch of the decoder; it checked for 'e' but neglected 'E', which is
just as valid.

Change-Id: I9236c76faea000c92df641930e401bce445e06c8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:33 +00:00