The issue is already fixed in 5.0 but let's be nice and ensure the issue
won't be reintroduced later.
Task-number: QTBUG-30931
Change-Id: Ia6944acaf6e7217f8d0f1fa75d0e9977db11d892
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
During a call to QDir::mkpath(), the same path could be created
by another process, in which case the OS mkdir will fail with EEXIST.
But the docs for mkpath() state that it's not an error if it
already exists, whereas for mkdir() it is an error. So
QFileSystemEngine::createDirectory should accept the EEXIST error
silently if it occurs while creating the sequence of parent directories
and the final leaf directory, but should fail if EEXIST happens when
it was called from QDir::mkdir(), which is when the createParents
parameter is false. We assume the operating system mkdir() and
CreateDirectory() are atomic, so there should be no race condition
in QDir::mkdir(). It's not necessary for mkpath() to call stat()
at each level, only to check whether an existing entry is a directory
or a file. Also added to the autotest to verify that if the
path is an existing file, creating a dir with the same name will
fail in either mkdir or mkpath.
Task-number: QTBUG-30046
Change-Id: I926352f10654fdf3b322c8685bb85ad8b8844874
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
There is a mismatch how QML and C++ converts QJsonValue. This patch
unifies conversions by adding QJsonValue support in QVariant::convert().
Change-Id: I8a1db3d77c517945ef48064b4b66ba03aa4f2fd0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
BlackBerry OS does not allow for explicitly controlling the locale through the
"LANG" environment variable. Locale is controlled by the underlying PPS
Service instead.
Change-Id: I22154e39f81a9467ad7fdb90a042396390398b1b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
In Qt 5, we declared that throwing from event handlers is undefined
behavior. So stop testing this.
We will try our best to capture and pass along std::bad_alloc, but even
that might not work, depending on compiler settings. In particular,
after the upgrade to MinGW/GCC 4.8 with DW2, this test stopped working.
Task-number: QTBUG-31615
Change-Id: Ibf5fb2ce0c48b983549096bf7aac434b6ed3ac2e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
qt_nameprep is tested by tst_qurlinternal. We just need to be sure that
QUrl handles them correctly.
Change-Id: Ic563004870d2cf2fa7a31ce49fff7280d5ffb5f3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Edge case: a > that should have been >=. Without it, we never ran the
rest of the IDN nameprepping.
Change-Id: I2276d660de3a70d0c561bb18816820d9a0f47e77
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
RFC 3454 says about prohibited characters (section 2, "Preparation
Overview"):
3) Prohibit -- Check for any characters that are not allowed in the
output. If any are found, return an error. This is described in
section 5.
In other words, we mustn't simply strip the output of prohibited
characters. We must generate an error if they are present. We do that by
clearing the data.
We already had tests for prohibited output, but they were
indistinguishable from being stripped. So instead add some extra
characters so that we can tell whether the label was cleared.
Change-Id: I2d95217c27be5e2d54deed0036cb009e3b7f4886
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Because tests are usually run as root on some setups, it does not
make sense to test for the right permissions of a readonly file.
Change-Id: I484f88722d3a9ce7123edc0fb57acae528fa194e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Latin1 strings are usually stored as 8 bit data in the json binary
format. But that data structure has a size limitation of 16bit, so
we need to fall back to storing the string as 16 bit data if it is
too long.
Task-number: QTBUG-30946
Change-Id: I0069b1367030b0b2f819fd1f04e34c9e2534a2a3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Return the codec if one was found by QTextCodec::codecForUtfText,
instead of returning the default (UTF-8).
Task-number: QTBUG-31293
Change-Id: I95e3260376c00537006b7fbfdc3df5850e1ba657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The optimisation done in cbaf52b099 for Qt
5.0 got the order wrong of the comparison. The queue must be sorted in
decreasing priority order. But since higher numbers mean higher
priority, that means the queue must be sorted in decreasing priority
number order.
Task-number: QTBUG-29163
Change-Id: Iaf3424b9bb445bf5c71518927f37253cead454f3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
In JSON, any number is stored in double. We need to make sure we
keep the maximum possible number precision for integer number. In
IEEE 754 double format, the significand precision is 53 bits(52
explicityly stored).
Autotest is included. qint64 and double work fine.
Task-number: QTBUG-28467
Change-Id: I7f857671c50e4334e9329c778f9b4f090f490540
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix connection to pointer to member signal that belongs to the base
class, but whose type is a pointer to a member of the derived class.
The current code only use the QMetaObject of the type coming from the
function type to look up the signal id. But if the signal was casted
to a pointer to member function of a derived type, then we also need to
look in the base classes
Change-Id: Ib98fc38f63942946acb34d9f83c100991d58e4e5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In Qt 5, I managed to break the guarantee that a deserialised local
datetime is the same time of day (potentially different UTC time),
regardless of which timezone it was serialised in. This happened after
I fixed QTBUG-4057 with If650e7960dca7b6ab44b8233410a6369c41df73a,
which serialised datetimes as UTC.
This patch reverts QDateTime serialisation to pre-Qt 5 behaviour to
restore the guarantee and consequently re-opens QTBUG-4057.
Change-Id: Iea877f7ed886f530b928067789b53534e89fe8cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If a process dies before all output is read into the internal buffer
of QProcess, we might lose data. Therefore we must drain the output
pipes like we already do in the synchronous wait functions.
Task-number: QTBUG-30843
Change-Id: I8bbc5265275c9ebd33218ba600267ae87d93ed61
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Test locale-based formatting of numbers when we pass field width, base
and fill characters. This now tests the fact that we replace a '0' for
the locale's zero character.
Change-Id: Ib872a592fd9a754e3ef11495a9497a6947056631
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Task-number: QTBUG-30346
Change-Id: I3d6dbe1e88bb5e2748eadabb2663f30be16f8d18
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Windows Embedded Compact does not have drive letters like desktop
Windows => do not try to build drive letter related test code for WEC7.
Change-Id: I2c3659220a001510c0555e2dd773b4dd68e9c2cc
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
We don't need to keep an internal QBuffer position, we can just use the
one from QIODevice::pos(). It will keep track of goings ahead and
backwards for us, plus it will make the default bytesAvailable() work
out-of-the-box too.
This error was reported on IRC.
Change-Id: I8559e8ee56edaa01ca8732c1f1012082ebe3a3f2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Auto tests using CET expect there to be no Daylight Time before 1980,
but Windows does apply Daylight Time. Fix expected test results to
match.
Task-number: QTBUG-30420
Change-Id: I7080598fa0a20c1cd5680782606ab983e714e546
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
By calling itemData() of the source model directly, the result cannot
contain data provided by the proxy model itself. The base class
implementation however will call data() on the proxy instead.
Change-Id: Ib0ef5f5621457adbfa4bd896a756dfcb98d0ae54
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Calling clear_mapping causes the persistent indexes to be queried, and
mapped using map_to_source, so that they can be restored later. That
is not the appropriate response to the source model being deleted
because there won't be anything to restore.
Simply clear the stored mapping information instead so that the source model
actually exists when mapToSource is called by the framework.
Change-Id: I99692ee7aa9c6714aec45c68fe4a2d62be189d60
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The only way to make this possible is to disable the
atomic-rename-from-temp-file behavior. This is not done by default,
but only if the application allows this to happen.
https://bugs.kde.org/show_bug.cgi?id=312415
Change-Id: I71ce54ae1f7f50ab5e8379f04c0ede74ebe3136d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Changelog: http://pcre.org/changelog.txt
Amongst other things, the Unicode tables were upgraded to 6.2.0
and case folding support was added, which also fixes a QString
autotest (marked as XFAIL).
Qt still requires 8.30, not 8.32.
Change-Id: I4056c1dc1d949d33443bb8ca280de4c8c363ac74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Say hello to Interlingua and Mongolian once again.
Change-Id: I735fbc5793f34620be1f6932a251224b9ded02e3
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
When QTemporaryFile attempts to create a new file in
createFileFromTemplate, it fails if the filename exists and is a
directory. Windows returns error code 5 (ERROR_ACCESS_DENIED) in this
case - rather than ERROR_FILE_EXISTS - which is not handled.
This patch handles ERROR_ACCESS_DENIED in addition to the already
handled ERROR_FILE_EXISTS, meaning that QTemporaryFile will continue
to look for unique names when a directory with the same name exists.
Task-number: QTBUG-30058
Change-Id: I42339887d7f5483e3dc6a03a9da15111c350da8f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
When variadic templates and decltype are supported, detect the best
overload of operator() to call.
Currently, the code takes the type of the operator(), which requires that
the functor only has one, and that it has no template parameter.
This feature is required if we want to connect to c++1y generic lambda
(N3418)
Change-Id: Ifa957da6955ea39ab804b58f320da9f98ff47d63
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
OpenProcess + WaitForSingleObject is supposed to fail after the process exits,
but this seems to take some time until Windows notices.
Change-Id: I942a9b4a458c23fc4ac33b28386e28821128e991
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Remove all trailing whitespace from the following list of files:
*.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README
excluding 3rdparty, test-data and auto generated code.
Note A): the only non 3rdparty c++-files that still
have trailing whitespace after this change are:
* src/corelib/codecs/cp949codetbl_p.h
* src/corelib/codecs/qjpunicode.cpp
* src/corelib/codecs/qbig5codec.cpp
* src/corelib/xml/qxmlstream_p.h
* src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
* src/tools/uic/ui4.cpp
* tests/auto/other/qtokenautomaton/tokenizers/*
* tests/benchmarks/corelib/tools/qstring/data.cpp
* util/lexgen/tokenizer.cpp
Note B): in about 30 files some overlapping 'leading tab' and
'TAB character in non-leading whitespace' issues have been fixed
to make the sanity bot happy. Plus some general ws-fixes here
and there as asked for during review.
Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Change the data type of PI from qreal to double, because qreal is defined as float and not as double on arm.
The testcase however expects PI to be a double value.
Change-Id: I003481071ecb2c1f54e6dcee9b450da2f1654969
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
While adding a test case for the new behavior, two issues
with the connectSlotsByName implementation came up:
1. for auto-connected slots that don't exactly match a signal,
a 'compatible' one is searched. There might be more than
one of those. The implementation randomly picks any.
2. The "No matching signal for %s" warning gets printed even for
slots that can never be connected via connectSlotsMyName
anyway (e.g. "on_something"). This is inconsistent.
This fixed both: an explicit warning is printed if more than one
'compatible' signal is found and the "No matching signal for %s"
warning is only printed if the slot adheres to the full
"on_child_signal()" naming convention.
In the process I added comments and changed the code slightly to
make it more readable and explicitly hint at non-obvious behavior.
Change-Id: Icc8e3b9936188d2da8dfff9f0373c8e5c776eb14
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
The problem was that the elapsed timer was not restarted,
causing the currentTime() not being adjusted for the time
it was paused.
Task-number: QTBUG-30108
Change-Id: Ib9b2c5a0dea52762109e0b25f1068dd7c88e15ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>