Commit Graph

620 Commits

Author SHA1 Message Date
Thiago Macieira
1904970dad Work around what apparently is a GCC 4.6.0 bug
The QFlags::operator int() isn't being called, so GCC complains that
this isn't an integer expression.

Change-Id: I537d06fd4a52ecbcddf0ef67807b298c42d3e911
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-25 15:09:52 +02:00
João Abecasis
fe778b94bd Enable endianness conversions on q(u)int8
Lack of support for these types is not a real issue as endian
conversions on byte-sized types are no-ops. Still, the conversions are
useful as they facilitate writing of generic code. They can also be used
explicitly as a way to document in code an endian-specific binary
format:

     uchar *data;
     quint8 tag = qFromLittleEndian<quint8>(data++);
     quint32 size = qFromLittleEndian<quint32>(data);

This commit also adds a test for functions documented in the QtEndian
header.

Change-Id: I2f6c876ce89d2adb8c03a1c8a25921d225bf6f92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-25 13:12:24 +02:00
Jędrzej Nowacki
552e162a67 Update QLocale data from CLDR v1.8.1 to CLDR v1.9.1
Change-Id: Ic84bbc82b364b92605c1bba64b6ec815bff970cb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-24 18:32:16 +01:00
Thiago Macieira
d8ddc8ae89 Add the Q_CORE_EXPORT macros to unit-test-exported code
Change-Id: If21658bd5e4af0fdcc403b054fc1b8f46b5fcfb0
Reviewed-by: David Faure <faure@kde.org>
2012-03-23 19:43:00 +01:00
João Abecasis
accfdc85e5 Fallback implementation of Q_ALIGNOF
For all practical purposes, the fallback introduced here returns the
desired value. Having a fallback enables unconditional use of Q_ALIGNOF.

For compilers that provide native support for it, Q_ALIGNOF is otherwise
 #defined in qcompilerdetection.h.

Change-Id: Ie148ca8936cbbf8b80fe87771a14797c39a9d30c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 19:43:00 +01:00
Jędrzej Nowacki
98c3b8a442 Add test cases to tst_QByteArray
Internally we construct QByteArrays from QStaticByteArrays. For example
moc is generating QStaticByteArray structure for every string it saves.
New test cases check if a QByteArray constructed from a QStaticByteArray
behaves as a not statically constructed one.

Change-Id: Ia4aa9a1a5bc0209507636c683a782dda00eae85c
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-23 16:43:43 +01:00
Kent Hansen
3b512ae142 Merge master into api_changes
Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
2012-03-23 14:10:58 +01:00
Giuseppe D'Angelo
1fe7e557d7 Remove #if 0 sections from QRegExp autotest
Use QEXPECT_FAIL instead (QRegExp is bugged w.r.t. the specific
test data).

Task-number: QTBUG-22466
Change-Id: Id5af01fa0d5c0536845fd4db19d4264498a8675b
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-23 11:45:25 +01:00
Thiago Macieira
e20c473019 Move the UTF-8 data into a separate .cpp so I can use later
This allows me to keep the UTF-8 invalid data in one safe place. I
won't need to copy & paste it.

Change-Id: Icb909d08b7f8d0e1ffbc28e01a0ba0c1fa9dccf0
Reviewed-by: David Faure <faure@kde.org>
2012-03-23 11:22:40 +01:00
Marc Mutz
e5ef496b5b tst_qsharedpointer: don't inherit from QSharedPointer
QSharedPointer is about to be made final. Instead
of inheriting from it to gain access to the
d-pointer, cast it to a layout-compatible struct
and access the pointer from there.

Assert liberally to ensure layout compatibility.

Change-Id: Ifc0fa6a6608e861469286673844325663f4f7fcc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 11:22:40 +01:00
Lars Knoll
5cb0368516 Rewrite QMap to use a RB tree
QMap used to use a skiplist in Qt 4.x, which has variable
sized nodes and we can thus not optimise using custom
allocators.

The rewrite now uses a red-black tree, and all allocations
and tree operations happen in the cpp file. This will allow
us to introduce custom allocation schemes in later versions
of Qt.

Added some more tests and a benchmark. Memory consumption
of the new QMap implementation is pretty much the same as before.
Performance of insertion and lookup has increased by 10-30%. iteration
is slower, but still extremely fast and should not matter compared
to the work usually done when iterating.

Change-Id: I8796c0e4b207d01111e2ead7ae55afb464dd88f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 09:31:09 +01:00
David Faure
f89bf2c153 Make comment() work in the C locale too.
The parser makes the default language en_US, and no mimetype xml says
<comment xml:lang="C">, so use the en_US string for the C locale,
rather than returning an empty string.

Change-Id: Iad7c142e8078abe357773249416e7ce9b3e29a92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 13:29:50 +01:00
David Faure
5ec5ce3549 Return all expected paths in QStandardPaths::standardLocations
ApplicationsLocation and DataLocation were returning only the local path,
rather than system paths + local path.

Change-Id: I653d14e5bbe1e08c5fa1ecd5a6106336d1cd0369
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 13:29:27 +01:00
Jędrzej Nowacki
5ea56e93f7 Reserve more space for built-in types in id space.
We are running out of type ids for built-in types, 255 is not enough.
QMetaType already contains about ~70 types, situation is maybe not
tragic now, but there is a great chance that we will want to add more
built-in types from different modules like jsondb or declarative. Then
it might be tight, because we are not allowed to reorganize type ids
(it would be a binary incompatible change).

This change was not possible up to now. Old moc generated code assumes
that type id can be safely stored in 8 bits.

This is source compatible change.

Change-Id: Iec600adf6b6196a9f3f06ca6d865911084390cc2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-22 11:52:23 +01:00
Kurt Korbatits
d6d77d54aa Fixed path in qobject unittest
- Fixed path was failing to find sub program.

Change-Id: I86f1a6941e244c9bc25ad0441cc7a441607560b7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-22 06:49:08 +01:00
Kent Hansen
e1e0e83c5e Remove support for meta-object revisions < 7
For Qt5 we no longer want to support the older revisions due to the
dual codepaths that must be maintained, and because the format of the
meta-object data is quite different in revision 7.

The dual codepaths have been replaced by asserts that indicate the
revision in which the feature was introduced, and the older-revision
fallbacks have been removed.

It's not possible to build code generated by moc that has
revision <= 6 with Qt5 because the type of the
QMetaObject::stringdata member changed from const char * to const
QByteArrayData *. For the same reason it's not possible to build a
dynamic meta-object generator targeting revision <= 6 with Qt5.
Hence, too old meta-objects will be caught at compile time, and the
code will have to be ported to generate revision 7 (e.g., by running
Qt5's moc on the original class declaration).

Change-Id: I33f05878a2d3ee3de53fc7009f7a367f55c25e36
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-22 06:37:26 +01:00
Kent Hansen
22d621dd99 QMetaMethod::typeName() should return "void" if the return type is void
QMetaMethod::typeName() is documented to return an empty string if
the return type is void. But after the introduction of
QMetaType::UnknownType (where void was made a distinct type),
returning an empty string causes the idiom

   QMetaType::type(method.typeName())

to break; the result will be QMetaType::UnknownType rather than
the expected QMetaType::Void for methods that return void.

New code should use the new function QMetaMethod::returnType()
instead, but it would be good if existing code still did the right
thing.

The consequence of returning "void" instead of an empty string is
that it breaks existing logic that uses the typeName() length to
determine whether a method returns void. But we judge this as the
lesser of the two evils; it's better to have a typeName() function
that is consistent and keeps the QMetaType::type(method.typeName())
idiom working, than to force the typeName() inconsistency for void
only to keep code that does "strlen(method.typeName()) == 0"
working.

The places in Qt that were relying on a zero-length typeName()
(testlib, dbus, declarative) have already been changed to use
returnType().

Also adapt QMetaObjectBuilder, which is internal API.

Change-Id: I70249174029811c5b5d2a08c24b6db33b3723d19
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-21 18:55:51 +01:00
Kent Hansen
b8d71ed60b Fix QMetaObject::normalizedType() for "void" argument
Since the introduction of QMetaType::UnknownType, void is a proper
meta-type, and the normalized form of "void" should be "void", not
an empty string.

Add more tests to ensure that we do remove "void" in the one case
where it actually should be removed (e.g. "foo(void)").

Change-Id: I72dc2d24da67cf52da00c678f50213cff1b92e25
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-21 18:55:27 +01:00
Robin Burchell
0f9e98a586 Fix directories never being unwatched after deletion on Windows.
This causes all sorts of problems, but is also blocking the introduction of new,
more detailed signals, because the backend never correctly identified the removal.

The object handle appears to be woken up before the directory is actually
deleted, thus causing QFileInfo::exists() to return true, and not doing the
removal dance. This behaviour isn't exactly documented (as far as I was able to
find out), but also seems to happen consistently, and Chromium also contains
a comment noting a similar issue.

Task-number: QTBUG-2331
Change-Id: Icfb6219b78e688852d7863a666a0ffc31bb4d573
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-21 12:32:16 +01:00
Giuseppe D'Angelo
cb32450c47 QRegularExpression: add QObject::findChildren overload
This actually involved tiding up QObject sources a little bit
to clearly separate QString / QRegExp overloads of findChildren.

The corresponding qFindChildren overload for MSVC 6 compatibiltiy
was *not* added.

Change-Id: I84826b3df9275a9bda03608a5b66756890eda6f8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-21 11:43:38 +01:00
Giuseppe D'Angelo
8659495202 QRegularExpression: support for QStringList overloads
Change-Id: Ia9017348742e41187684185d04b56d27edd383b5
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-21 11:43:30 +01:00
Jędrzej Nowacki
bfd2b30faf Crash fix in ~QVariant
QVariant handlers can not be unregistered. We are not able to guarantee
that such operation is safe and we do not want to.

Change-Id: Id9a12e6a8c750110e4a08eab1de3e07e5c408675
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-21 11:43:14 +01:00
Jędrzej Nowacki
37b0a8e7e6 Fix qDebug stream for an invalid QVariant.
This patch changes invalid QVariant qDebug stream value from
"QVariant(, QVariant::Invalid)" to "QVariant(Invalid)"

New tests were added.

Change-Id: Ia57d4fc2d775cc9fce28e03eba402c2173845b35
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-21 06:55:33 +01:00
Kent Hansen
83e055424a Add QtJson types to meta-type system
Make QJsonValue, QJsonObject, QJsonArray and QJsonDocument
first-class meta-types.
This is an enabler for a lightweight integration with QML.

Change-Id: I4725efdd2746cf97fd26d3632a99e8eee849f834
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-20 22:22:41 +01:00
Kent Hansen
95d6f8a4cf Merge master into api_changes
Conflicts:
	src/corelib/tools/qvector.h
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
2012-03-19 10:03:48 +01:00
Kent Hansen
3f64a7b67b Add autotests for QMetaType::load() and save()
These were not covered at all by tst_qmetatype.

Change-Id: Ic957470ac78b2c15fe449efe17e1f178a41c3690
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-18 21:06:57 +01:00
Jędrzej Nowacki
5e497111db Add new test cases to tst_QMetaType.
Change-Id: I405ab5df9d9de3a0a0a71276b172a27ee01392e3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-18 12:35:09 +01:00
Marc Mutz
d823646db3 containers: add C++11-style c{begin,end}() as alias for const{Begin,End}()
C++11 adds cbegin()/cend() functions for the same reason Qt has
constBegin()/constEnd(). This patch adds these functions to the
Qt containers with the same implementation as constBegin()/constEnd().

It also fixes the return types in the documentation of existing
constFind() functions (documentation only).

C++11 only adds cbegin()/cend() (and crbegin()/crend(), which Qt doesn't have).
In particular, it doesn't add cfind(), so I didn't supply these, even though
Qt comes with constFind().

This is a forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1365.

Change-Id: Ida086b64246b24e25254eafbcb06c8e33388502b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-17 09:10:57 +01:00
Kent Hansen
440f452aa3 Merge master into api_changes
Conflicts:
	src/corelib/kernel/qmetatype.cpp
	src/gui/kernel/qplatformsurface_qpa.cpp
	tests/auto/corelib/tools/qtimeline/qtimeline.pro

Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
2012-03-16 10:01:29 +01:00
João Abecasis
c67efb6506 Fix invalid read, detected by valgrind
Commit 3fe1eed0 changed the QVERIFY in line 1354 to QCOMPARE. This was
done to work around a (not yet understood) compiler issue. That however
was wrong, as char pointers in QCOMPARE are assumed to point to
'\0'-terminated strings and will get dereferenced.

In this case the intent was to compare the actual pointer values, as the
pointers point past the end of the array and should not be dereferenced.

Explicitly casting to (void *) and using QCOMPARE will not only keep the
intent, it will hopefully also provide meaningful output on failures. As
such the fix was applied throughout the test.

Change-Id: Ib0968df492ccc11d7c391bb69037cd7241e55493
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-15 23:01:13 +01:00
Friedemann Kleint
1741f6890c UTF8-Codec test: Fix compilation with g++/C++0X.
Change-Id: I704f8d1b07ca371c36e4eecc52c80ac783e3da3c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-15 14:51:50 +01:00
Debao Zhang
65a2613e3e tst_qsharedpointer: Fix auto test fail under Windows 7
The tst_QSharedPointer generate another Process to test some invalid
codes, and it expect that the prcoess will crash and return a non-zero
value.

The process which is a console application was linked to windows
subsystem, and QProcess seems can not get its return value. This
cause the unit test fail.

In addition, when the process crash under debug mode, a debug error
report-dialog will appear, which is very annoying, so I suppress it too.

Task-number: QTBUG-24160
Change-Id: Ia1c872d4515c83b0aa516bcfe3783f59797d2d49
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-15 11:40:50 +01:00
Jason McDonald
07764b9c15 Verify expected warnings in QSettings autotest.
Use QTest::ignoreMessage() so that the warnings don't appear in the test
output and so that the test will fail if the warnings are not produced.

Change-Id: I418d78819fc9dbfd7da2a8b6c0a1ebfa967347e2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-15 06:00:52 +01:00
Rohan McGovern
aac68052af Mark tst_qtimeline as insignificant on Windows
This test has been repeatedly unstable.

Task-number: QTBUG-24796
Change-Id: I603965c0189ad6da0cdf48527c4919c55e1918b4
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-03-15 00:50:47 +01:00
Giuseppe D'Angelo
c005c75080 QRegularExpression: support for QString overloads
Added support for QString overloads taking a QRegularExpression.

Change-Id: I8608ab0b66e5fdd2e966992e1072cf1ef7883c8e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-15 00:37:56 +01:00
Giuseppe D'Angelo
08790636f2 QRegularExpression: QMetaType and QVariant support
Removed the Q_DECLARE_METATYPE in favour of first-class support
inside QMetaType and QVariant.

Change-Id: I904236822bfab967dc0fbd4d4cc2bcb68c741adc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-14 10:53:24 +01:00
Jędrzej Nowacki
22494ea8e8 Unify QMetaType::TypeFlags detection.
Duplicated code was removed. As an side effect:
- one runtime flag check was replaced by a compile time check.
- is enum flag can be used together with built-in types.

Change-Id: I54173e7b07ce7e487d3cc21ba24dcccd28b5d049
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-14 09:45:07 +01:00
Jason McDonald
f4dfb55243 Uncomment disabled code in QResourceEngine autotest.
Resource files are expected to be readable.

Change-Id: Ife2b624e69b58e2fb996bc3e210a6e6c5c6852fe
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-14 07:51:45 +01:00
Jason McDonald
16045184e3 Tidy the QSettings autotest.
- remove unnecessary includes
- remove undefined private functions
- remove commented-out test function
- fix indentation
- clarify why part of tst_QSettings::setValue() is commented-out

Change-Id: I09e1a33896536e702f7ba65f266415536b4f9e0b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-14 07:51:45 +01:00
João Abecasis
91248b0f3b Silence 'narrowing conversion' warning in test
Seen with gcc 4.6:

tst_qarraydata.cpp: In member function 'void tst_QArrayData::grow()':
tst_qarraydata.cpp:1445:29: error: narrowing conversion of 'i' from
'size_t {aka long unsigned int}' to 'int' inside { } [-fpermissive]

Change-Id: Iad55659554b64ee34655640d606153f058a8cd05
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-13 23:55:30 +01:00
João Abecasis
e104fe7266 Merge "Merge remote-tracking branch 'origin/master' into api_changes" into refs/staging/api_changes 2012-03-12 23:52:36 +01:00
Alexei Rousskikh
612040a0cd Trailing comma should result in an error during JSON parsing
1. QJsonParseError::MissingObject defined
2. QJsonDocument::fromJson() will result in defined error after parsing
of something like "{ 'key':1 , }" or "[ {'key':1}, ]"

Change-Id: I8e6234a03b8aca4e5ad6180f273f91066b86d7a1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-12 21:38:51 +01:00
Lars Knoll
d5098f2802 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
2012-03-12 21:03:49 +01:00
João Abecasis
e57e2f3e32 Fix QString:mid and midRef, again
In commit 75286739 it was assumed that negative positions shouldn't
influence the size of the returned substring. That however changes
behaviour that was depended on even inside Qt.

With this change, the old behaviour is reestablished.

A negative value of n is still taken to mean "all the way to the end",
regardless of position, and overflows are still avoided.

Change-Id: I7d6ed17cc5e274c7c7ddf0eb0c3238e1159ec4f6
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-12 19:53:59 +01:00
Jason McDonald
c4342ddea0 Fix indentation of QWaitCondition autotest.
No functional changes - cosmetic change only.

Change-Id: I7332eaab31720776c70a7ef813d55db44bab83f7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 13:14:05 +01:00
Jason McDonald
0e905e9138 Remove outdated assumption from QVariant autotest.
The test was assuming that "data()" is a special function in autotests,
but that hasn't been the case since early prototypes of testlib.

Change-Id: Ic24cf5dc539b55d12eba0a6ab17173e2ed698f21
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 05:26:21 +01:00
Jason McDonald
16a1d5c81b Fix compile warnings in QCoreApplication autotest.
- Use const_cast to avoid "deprecated conversion from string constant to
  'char*'" warning when building argv arrays from string literals.
- Use Q_UNUSED to avoid warnings on unused local variables.

Change-Id: Idd2c8279adc102b6ebc6af7486ba26fe9ed4e7c1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 05:26:21 +01:00
Jason McDonald
a71e12b170 Remove redundant and incorrect comment from QList autotest.
Change-Id: I3187d0d8ace120181a4c49bbc68f421ddf5acbe0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 01:50:20 +01:00
Glenn Watson
15c13b91e6 Add Q_IS_ENUM(), and provide as flag in QMetaType::typeFlags()
Add Q_IS_ENUM() macro to determine if a given type is an
enumeration. Use information from that in QMetaType::registerType()
to store whether custom registered metatypes are enums or not.
This information can then be accessed by calling
QMetaType::typeFlags(int type). This is used by the declarative
code to determine whether a custom type in a variant can be safely
cast to an integer, which is required to allow passing non-local
enums as signal/slot params.

Change-Id: I9733837f56af201fa3017b4a22b761437a3c0de4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-11 23:58:39 +01:00
Jędrzej Nowacki
e3429f764b Crash fix in QMetaType::typeFlags.
The function is public, so it should validate input instead of crashing

Change-Id: Id67463b0b61ab74a76c1ede7f052bdbed37822b6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-11 22:04:21 +01:00
Sergio Ahumada
865fbbddc9 Mark tst_qtimeline as insignificant on Windows
Change-Id: If8f699f867d3950cced17b150cb5f02fddd1f9a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-09 12:32:30 +01:00
Giuseppe D'Angelo
824cc94921 QRegularExpression: minor fix to captureIndexForName
Although passing a null pointer to pcre16_get_stringnumber for
the compiled pattern should simply make it error out, it's actually
an undocumented behaviour, so let's stay safe and add an explicit
check.

Tests for this codepath are added.

Change-Id: Ifd9c87874f6812ba487104ec1a5bbc83c3b16761
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-08 22:00:53 +01:00
Giuseppe D'Angelo
b543141992 QRegularExpression: improve JIT memory handling
PCRE's JIT uses by default 32K on the pcre_exec caller's stack. This
is fine for most situations, but in some cases (esp. patterns with
lot of recursion) more memory is required.

Therefore, if a match execution fails due to exhausting JIT memory,
we let PCRE allocate up to 512KB to be used for the JIT's stack.

The pointer to the allocated memory is put in thread local storage
(so it can be reused from the same thread, if needed, and automatically
goes away when the thread dies).

Change-Id: Ica5fb7d517068befff88ebb198a603a26ec5d8a7
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-08 22:00:47 +01:00
Lars Knoll
763790bb5c Fix a bug in the assignment operators for QJsonObject and Array
When objects or arrays where being used read only, several objects
can share the same d pointer, but will have different pointers into
the binary data. Correctly change the pointer into the binary
data even if the d-pointer is the same.

Change-Id: Ife0ea5ac5daf46586f855dccdf35b51ec696a623
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-08 16:06:48 +01:00
Jędrzej Nowacki
cf6dd5baca Crash fix in QMetaType::typeName.
The function is public, so it should validate input instead of crashing

Change-Id: Ifd9f1110f8631f942929d85db6a57eee7afffb6a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-08 16:04:02 +01:00
Jędrzej Nowacki
f71487da3a Fix crash in QVariant::canConvert.
The function was crashing when an unsupported type id was given
as an input argument.

Change-Id: I2b0e3e6d43f6f248dc71532f8e6485efe68e8120
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-08 16:03:52 +01:00
João Abecasis
8141e34280 Skip test when implicit move operators not available
Besides rvalue-references, this test depends on the compiler to generate
implicit move operators on a derived class, based on the ones available
on its base class.

At least Visual Studio 2010 and some variations of clang 3.0 are known
not to generate implicit move constructors and assignment operators. Gcc
4.6 and up seem to support the feature.

Change-Id: Ied464ef678f517321b19f8a7bacddb6cd6665585
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-08 12:10:29 +01:00
João Abecasis
79f2480c86 Merge remote-tracking branch 'origin/api_changes' into containters
Conflicts:
	src/corelib/kernel/qmetaobject.cpp
	src/corelib/kernel/qvariant.cpp
	src/tools/moc/moc.h

Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
2012-03-08 12:02:41 +01:00
João Abecasis
12f221410f Merge remote-tracking branch 'origin/master' into api_changes
Change-Id: I89dc2e193bd01624c1fb50484610d516e39b1538
2012-03-08 01:27:39 +01:00
Giuseppe D'Angelo
eb70933398 QRegularExpression: add optimizations autotest
Exporting the counter that controls the optimization of a compiled
pattern lets us to forcibly optimize all patterns. Therefore,
two tests are now run: one with default optimization values
and another one which always optimizes the pattern.

The counter itself was renamed with a qt_ prefix and put
inside the Qt compilation namespace
(thanks to rohanpm for pointing it out).

Change-Id: I56602433d37adc127772b2d0d2cdaf2e49d43c71
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-07 19:18:22 +01:00
David Faure
a6a7cabcd3 Add QUrl formatting option "PreferLocalFile".
For the readonly case (e.g. progress dialogs), where local file paths
look much nicer to end users than file:/// URLs.

Change-Id: I899fed27cfb73ebf565389cfd489d2d2fcbeac7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-07 16:13:44 +01:00
Olivier Goffart
5713dde8a1 Fix deadlock in QPropertyAnimation
Commit 1e6514a714 changed the mutex from
recursive to non-recursive, which could introduce dead lock if the
animation starts other animation (This is the case in QMainWindow
layouts)

Change-Id: I1b149b78a802748eb24b5700fffeca0b8555f005
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-07 12:48:49 +01:00
Lars Knoll
53bbea2328 Fix parsing of unicode escape sequences
Change-Id: I63a7cd3a571fb47c97157bcb2ca29c4239c600ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-07 00:03:07 +01:00
Giuseppe D'Angelo
6b78980593 QRegularExpression: fix autotest
Some minor fixes: obviously, a valid match always come from a
valid regular expression, but a valid regular expression can create
an invalid match (internal error during matching).

Also, testing an invalid iterator should silence the emitted
warnings.

Change-Id: I585bb99a81e22f108601fd66bf30b56e0229d68b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-07 00:02:39 +01:00
Giuseppe D'Angelo
efcd4d9470 QRegularExpression: add captureCount()
QRegularExpression::captureCount() returns the number of
capturing groups inside the regular expression pattern.

Change-Id: Ib90ce67c67d06ab2966f0c98bd91da21defc156d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-06 23:56:14 +01:00
Giuseppe D'Angelo
bd30234b59 QRegularExpression: improve operator==, add dedicated autotest
Trivial change: compare dpointers first, then the data.
Added test function for operator==.

Change-Id: I33ac64a59db4ccad56c30be17622187e42415f38
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-06 21:54:17 +01:00
Giuseppe D'Angelo
c7cb455a47 QRegularExpression: add QRegularExpression* set of classes
Added QRegularExpression, QRegularExpressionMatch and
QRegularExpressionMatchIterator as PCRE-enabled, regexp classes.
Documentation is included, as well as a first round of autotests.

Task-number: QTBUG-23489
Change-Id: Id47031b80602c913ccd2fd740070e3024ea06abc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-06 21:53:39 +01:00
David Faure
676304e706 Add test for QUrl::isLocalFile (there weren't any).
Change-Id: I839d2eee7b0651700516d6140635151a52a9fa40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-06 21:00:31 +01:00
Stephen Kelly
eb24dfcccb Add template specialization of QMetaType for QObject derived pointers.
This makes it possible to do things like

QVariant::fromValue(new SomeObject);

without first using Q_DECLARE_METATYPE(Something*)

This functionality was originally part of
http://codereview.qt-project.org/#change,11710 but was rejected
because the functionality was based on specialization of
QVariant::fromValue which could be dangerous.

This new implementation doesn't have such danger.

Change-Id: I83fe941b6984be54469bc6b9191f6eacaceaa036
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-06 13:37:17 +01:00
David Faure
c78957766a QMimeDatabase: Fix crash on empty filename
This is due to the search in the suffix tree starting at position
fileName.length() - 1.

Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1
Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru>
Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
2012-03-06 12:10:42 +01:00
Miikka Heikkinen
82fd18fe36 Windows: Make QSettings autotest significant again
The latest windows run of CI has QSettings test passing, so remove the
CONFIG += insignificant_test from it.

Task-number: QTBUG-24145
Change-Id: I35c0d8d4f72ad49f9f21dcd486ab33a37ab95e15
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-03-05 16:37:16 +01:00
João Abecasis
7e4f329934 Base QList::setSharable on RefCount::setSharable
Change-Id: I2acccdf9ee595a0eee33c9f7ddded9cc121412c1
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-05 15:15:44 +01:00
Lars Knoll
96232be146 Merge remote-tracking branch 'origin/api_changes'
Conflicts:
	dist/changes-5.0.0
	mkspecs/features/qt_module_config.prf
	qmake/project.cpp
	qmake/property.cpp

Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
2012-03-04 21:45:05 +01:00
David Faure
53229ec8f7 Add note about failing test when using shared-mime-info < 1.0
Change-Id: I3ba9d14d915a579b9e102114866f6c9e0344ba16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-02 14:44:44 +01:00
Stephen Kelly
fb8c95bac0 Automatic metatype registration of two-template-argument types.
This commit is complimentary to the commit which introduced a similar
partial specialization for single template argument types:
6b4f8a68c8

If T and U are available as metatypes, then QHash<T, U> is too.

Change-Id: I09097b954666418b424c8c23577032beb814343a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-02 13:22:54 +01:00
Jędrzej Nowacki
362bde8e8e Introduce QMetaType::UnknownType.
QMetaType::Void was ambiguous, it was pointing to a valid type (void)
and in the same time it was signaling errors in QMetaType. There was
no clean way to check if returned type was valid void or some
unregistered type.

This feature will be used by new QMetaObject revision which will
store type ids instead of type names. So it will be easy to
distinguish between:
 void mySlot();
 MyUnregisteredType mySlot();

Change-Id: I73ff097f75585a95e12df74d50c6f3141153e771
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-02 12:57:29 +01:00
Olivier Goffart
2658a52017 Fix tst_qregexp with QStringBuilder
Change-Id: I1ac2a5c9ea5657ad2916465b77271e3d53c67cde
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-01 16:58:33 +01:00
Bradley T. Hughes
d964981252 Remove ARMFPA support and Q_DOUBLE_FORMAT detection
Remove the -armfpa option the config.tests/unix/doubleformat*
detection. The places where we used QT_ARMFPA and Q_DOUBLE_FORMAT
has been removed as well.

Rationale: ARM FPA with GCC does not work with EABI. Qt currently
does not support compiling without EABI, making ARM FPA an
impossibility. It is unknown whether other compilers provide ARM FPA
support with EABI. Support for ARM FPA can be re-added in the future
should the need arise, but since ARM VFP is available for ARMv5 and up,
we should encourage implementors to instead use soft-floats or VFP.

Change-Id: I3671aba575118ae3e3e6d769759301c8f2f496f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-01 16:26:55 +01:00
Marc Mutz
15c141511f QPair: specialise QTypeInfo based on the typeinfos of its arguments
Specialise QTypeInfo<QPair<T1,T2>> based on the properties of
T1 and T2:

- If either T1 or T2 is Q_COMPLEX_TYPE, so is QPair<T1,T2>.
- Otherwise, if either T1 or T2 is Q_MOVABLE_TYPE, so is QPair<T1,T2>.
- Otherwise, QPair<T1,T2> is Q_PRIMITIVE_TYPE.

Change-Id: I8aecbd37e3b7924f77f38967498deabf1a19ca24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-01 14:26:06 +01:00
Marc Mutz
1cd4d6b181 QEvent (and subclasses): make ctors explicit
Do this regardless of whether the event subclass
is public API or only used in examples. Examples
are examples, used by others as templates or even
copied verbatim, so they should also follow sound
engineering rules.

Anyway, there's only one in examples/...

Change-Id: I586ff16407a956c9e89288fdd4377eed73f45c0f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-01 08:44:34 +01:00
Kurt Korbatits
95c5be8bc1 Changed qchar unittest to check return from QFINDTESTDATA
- Changed qchar unittest to check string QFINDTESTDATA
  returns is not empty.

Change-Id: Idb3997aaa5d5220272915c1e2538175205b3d6e8
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:39 +01:00
Kurt Korbatits
c5b928207e Fixed qlocale unittest to install subprogram syslocaleapp correctly
- It was trying to install syslocaleapp sub program as TESTDATA
  instead of an application.

Change-Id: I2117d11335bc2fd37a8ccc9a03b0337382f0177f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:19 +01:00
Kurt Korbatits
41b2992422 Changed qdir unittest remove() to check actual file removed
- Changed remove() test to check the file just removed is gone.

Change-Id: I0b6c176e624134402b5547866064f436ce063f16
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:17 +01:00
Kurt Korbatits
bc323b6fd3 Changed qlogging unittest to install subprogram
- Added install of app sub program so it works from install directory

Change-Id: Ia83643519752a3cbb59d6da2aed132d683a94bee
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:15 +01:00
Kurt Korbatits
5dd470aca6 Fixed qdir unittest rename() test to skip if run as root
- subtest not valid if run as root so added a check and skip

Change-Id: Iae993e20f272f9303a75062ef00d22b49df5e84a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:12 +01:00
Giuseppe D'Angelo
eafc667136 QRegExp: fix \i \I \c \C \p \P escape sequences
Those escape sequences have a special meaning in the XML Schema 1.1
regular expressions, but not in Perl-compatible ones.

An escape sequence that has no special meaning should match the
escaped character itself; this patch fixes QRegExp's behaviour in
that regard (previously, it added a character class matching
nothing).

Change-Id: I983f923baa7c2ec19938b96353f3a205e6c06d58
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-01 00:09:57 +01:00
Marc Mutz
ff004175bc QFlags: mark as Q_PRIMITIVE_TYPE
I originally tried to put Q_DECLARE_TYPEINFOs into
Q_DECLARE_OPERATORS_FOR_FLAGS, to declare not only
the flags type, but also the underlying enum as
primitive, but too many users (arguably correctly)
used Q_DECLARE_OPERATORS_FOR_FLAGS at (non-global)
namespace scope where QTypeInfo would have been
specialised in the wrong namespace.

So specialise QTypeInfo for QFlags<T> only.

Change-Id: I4af6e29aefbd9460a3d2bc6405f03cdf6b1096bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 23:36:47 +01:00
Friedemann Kleint
bcb0f28a4d Fix tests of QMimeDatabase.
- Use temporary directories to avoid instabilities
  due to remains of previous failed tests and locked
  directories.
- Replace SRCDIR by QFINDTESTDATA(), reference only
  the freedesktop.org.xml contained in the Qt source
  tree by $$QT.corelib.sources.
- Improve some error messages, test suite instructions
  for Windows.

Change-Id: Idee8e3767ef0a8299df3bdaaac20334164878db0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-02-29 16:52:19 +01:00
João Abecasis
7919c0529e Add AllocationOption::Grow
This is meant to reduce the number of allocations on growing containers.
It serves the same purpose as the existing qAllocMore which is currently
used by container classes.

While only a container knows when it is growing, it doesn't need to care
how that information is used. qAllocMore is currently treated as a
black-box and its result is (basically) forwarded blindly to an allocate
function. In that respect, container code using qAllocMore acts as an
intermediary.

By merging that functionality in the allocate function itself we offer
the same benefits without the intermediaries, allowing for simpler code
and centralized decisions on memory allocation.

Once all users of qAllocMore get ported to QArrayData and
QArrayData::allocate, qAllocMore can be moved or more closely integrated
into qarraydata.cpp and qtools_p.h can be dropped.

Change-Id: I4c09bf7df274b45c399082fc7113a18e4641c5f0
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-29 14:31:15 +01:00
João Abecasis
f947093662 Test setSharable with "raw data"
Change-Id: I91774685e84416407aa1fa136f27fedb82545a12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-29 14:31:03 +01:00
Stephen Kelly
e1cc0d6bbc Allow QChar::SpecialCharacter with QStringBuilder.
Change-Id: I3c91fd516bb13e5534aa6f26ee9df745c990dfb5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 14:08:43 +01:00
Kent Hansen
69e3e54486 Add QMetaMethodBuilder::parameterTypes() function
This function matches QMetaMethod::parameterTypes().
The implementation of QMetaMethod::parameterTypes() was moved to a
helper function in QMetaObjectPrivate, so that it can be shared with
QMetaMethodBuilder.

Change-Id: I4361713996dc4ea31a79c2fc74c813ee5e9c3069
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 12:50:14 +01:00
Kent Hansen
f95181c7bb Long live Qt5 meta-object method/property descriptors
This commit introduces two significant changes to the meta-object
data format:

1) Meta-type information (QMetaType type/name) information is
stored directly in the meta-data for both properties and methods;
2) The original signature (string) of a method is no longer stored
in the meta-data, since it can be reconstructed from the method
name and parameter type info.

The motivation for this change is to enable direct access to method
names and type information (avoiding string-based lookup for types
if possible), since that's typically the information language
bindings (e.g. QML) need. (moc already had all the desired
information about methods, but it threw it away!)

This change keeps support for the older (6 and below) meta-object
revisions, but the support will be removed after a short grace
period.

The following public QMetaMethod functions have been added:

name() : QByteArray
returnType() : int
parameterCount() : int
parameterType(int index) : int

The following internal QMetaMethod function has been added:

getParameterTypes(int *types) : void

This commit extends the meta-method data to include explicit
type/name data for methods. The new data follows the existing
(5-word) method descriptors in the meta-data. The method descriptor
format was modified to enable this. First, the descriptor now
contains the meta-data index where the method's type/name information
can be found. Second, the descriptor contains the number of
parameters. Third, the descriptor has a reference to the name of the
method, not the full signature.

Each entry of a method's type/name array contains either the type id
(if it could be determined at meta-object definition time), or a
reference to the name of the type (so that the type id can be
resolved at runtime).

Lastly, instead of storing the method parameter names as a
comma-separated list that needs to be parsed at runtime (which was
how it was done prior to this commit), the names are now stored as
separate entries in the meta-object string table, and their indexes
are stored immediately after the method type info array. Hence,
parameter names can be queried through the public API without
parsing/allocating/copying, too.

Task-number: QTBUG-24154
Change-Id: Idb7ab81f12d4bfd658b74e18a0fce594f580cba3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-29 12:50:14 +01:00
Kent Hansen
96f2365cf4 Rename QMetaMethod::signature() to methodSignature()
In Qt5 the meta-data format will be changed to not store the
method signature string explicitly; the signature will be
reconstructed on demand from the method name and parameter type
information.

The QMetaMethod::signature() method returns a const char pointer.
Changing the return type to QByteArray can lead to silent bugs due to
the implicit conversion to char *. Even though it's a source-
incompatible change, it's therefore better to introduce a new
function, methodSignature(), and remove the old signature().

Task-number: QTBUG-24154
Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 12:50:14 +01:00
Kent Hansen
3f7a222414 Change the representation of meta-object string data
Up to and including meta-object revision 6, string data have been
stored as 0-terminated C-style strings, that were made directly
accessible as const char pointers through the public API
(QMetaMethod and friends).

This commit changes moc to generate an array of QByteArrayData
instead, and adapts the QObject kernel accordingly.

Generating an array of QByteArrayData (byte array literals)
means that the strings can now be returned from public (or private)
API as QByteArrays, rather than const char *, with zero allocation or
copying. Also, the string length is now computed at compile time
(it's part of the QByteArrayData).

This commit only changes the internal representation, and does
not affect existing public API. The actual (C) string data that the
byte array literals reference still consists of zero-terminated
strings. The benefit of having the QByteArrayData array will only
become apparent in the upcoming meta-object data format change, which
changes the format of property and method descriptors.

Support for the old meta-object string data format was kept; the
codepaths for old revisions (6 and below) will be removed in a
separate commit, once all the other meta-object changes are done and
affected code has been adapted accordingly.

Task-number: QTBUG-24154
Change-Id: I4ec3b363bbc31b8192e5d8915ef091c442c2efad
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-29 12:50:14 +01:00
João Abecasis
c4ad58ed22 Merge remote-tracking branch 'gerrit/master' into containers
Change-Id: I97ba222435ff50a9e5422e6f2c73e4bb8d1b865c
2012-02-29 00:58:13 +01:00
Friedemann Kleint
f3b68e352e Skip QLocale test on Windows, improve process handling.
- Skip the failing windowsDefaultLocale() test.
- Improve the handling of the subprocess, locate
  the binary in initTestCase instead of repeatedly searching it.
- Make all applications console/non-app bundles.

Task-number: QTBUG-24543

Change-Id: I79dfaa3320cd5698f02e74a3fe53477d4a79d4fb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-28 16:52:02 +01:00
Miikka Heikkinen
b491d02eb3 Fix QLibrary autotest for Windows
The libraries were built into wrong directory in Windows. Fixed it so
that the libraries are built into debug and release directories like
the test executable.

Also fixed QMAKE_CLEAN statement, which was using incorrect separator.

Task-number: QTBUG-24151
Change-Id: Iade656af5f83ef2b79c2b9c4177df4a16b2f6821
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-28 12:45:28 +01:00
Olivier Goffart
0d9714f445 moc: Only generate IndexOfMethod for signals.
moc is currently generating code to convert from a pointer to member
function of a slot or signal to its index.

The idea was that it could be usefull for slots to have the new syntax
do the same as the old one (connecting signal index to slot index). But
in practice, the new syntax do not use the IndexOfMethod for slots.

Also, it does not work for all the slots (no Q_PRIVATE_SLOT,
no static slots)

So since it is not used, and that it would take room in the binaries to
generate all the code to get the index of slots, we remove it.

If ever we need it, we can still add it later.

Change-Id: Ia417e3e524d7915ca86433ea86c66ac2b299c81a
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-28 12:36:40 +01:00
Bradley T. Hughes
b51296c064 Add SHA-224, SHA-256, SHA-384, and SHA-512 support to QCryptographicHash
This adds Sha224, Sha256, Sha384, and Sha512 enum values to
QCryptographicHash::Algorithm. The implementation comes from RFC 6234,
http://tools.ietf.org/html/rfc6234, which is added to
src/3rdparty/rfc6234. Only the headers and SHA-2 code is included in
src/3rdparty/rfc6234 (the SHA1, HMAC, and HKDF code is not included).

Change-Id: I85139fd118291f15efc22899a5ddd1cc83810cfb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-27 22:24:00 +01:00