Commit Graph

403 Commits

Author SHA1 Message Date
Miikka Heikkinen
7c081ba942 Fix qlogging test for release configuration
The helper process 'app' wasn't built in release configuration.

Also improved finding the helper executable to utilize
QFINDTESTDATA and print out a proper errors if it could not be
found or started.

Note that adding ".exe" to process name in Windows is unnecessary
as QProcess already does that for you, so removed the ifdeffing.

Task-number: QTBUG-24330
Change-Id: Ibe75e0ecd24181ab623d0a60f17ecaf92052b0dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 05:26:58 +01:00
David Faure
1209fccaf7 QMimeData: export URLs as text too
This allows to drop or paste them into lineedits and text widgets
(including such widgets in non-Qt applications)

Implementation note: this is done on-demand rather than in setUrls
so that it's still possible to setText explicitely; the new code
is only a fallback for when no text/plain data is available.

Change-Id: Ie90c43a30bfa64a6047b627e7351d20bf5ec8e03
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-17 05:26:47 +01:00
David Faure
b838170ceb QDebug: Add support for %{pid}, %{appname} and %{threadid}
Change-Id: I4add0a374e6524b615c6dc0ecfb010a90075b04f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 05:25:56 +01:00
Bradley T. Hughes
2193df65a3 Fix tst_QFileSystemWatcher failure on Mac OS X
The watchFileAndItsDirectory() test would fail due to atime updates for
the first watched file coming up to 2 seconds after the file was closed.
Observation shows that the atime has a 2 second resolution on Mac OS X
using HFS+, so add an appropriate delay to make sure that the atime
update from the kqueue based file system watcher can dispatch all
updates.

Task-number: QTBUG-22744
Change-Id: Ie79af20d6b4c154021307c8a8f6d336369720337
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-17 05:25:26 +01:00
Kurt Korbatits
857775f701 Changed qcryptographichash unittest to work from installation directory
- Changed qcryptographichash to use TESTDATA and QFINDTESTDATA

Change-Id: Ic3a1bdccc9f81605c648dab2a642421d17f7fe80
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-17 05:24:37 +01:00
Kurt Korbatits
32060c2115 Changed json unittest to work from installation directory
- Changed json unittest to use TESTDATA and QFINDTESTDATA

Change-Id: Id29f8257565f409fa184ba465f25bc8454e2b7fb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-16 04:23:20 +01:00
Jędrzej Nowacki
214e031d56 Implement new static less API for QMetaType.
Currently QMetaType API contains almost only static methods. This works
nice until someone needs more information or needs to do more operations
on a type. In this case every function call has to do type dispatch.

This API allows to avoid redundant type dispatching, by caching a
type information in a QMetaType instance. It gives significant
performance boost especially for custom types (up to 9x).

Change-Id: I223d066268402e072e41ca1d0a3e7bc160655d7f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-16 02:00:15 +01:00
Rohan McGovern
7a5bb18dc6 Fixed tst_QFile when redirecting stdin/stdout/stderr to/from files.
openStandardStreamsBufferedStreams would fail if standard streams were
redirected to a file (e.g. ./tst_qfile > testlog.txt).

openStandardStreamsFileDescriptors already has a workaround, so apply it
here too.

Change-Id: Iffe9d7864909e489e77c1114e80c4e3bc70a8722
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-16 01:57:27 +01:00
Jędrzej Nowacki
18965b1384 Add QMetaType::FirstCoreType enum value.
We should not assume that the first type id is 0.

Change-Id: I17ba6ba57e97ebd495904bfd11235fe458f214e5
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-16 01:56:05 +01:00
Kent Hansen
ded417b75a Add autotest for QMetaMethod introspection
This autotest checks that meta-methods can be properly inspected
(signature, return type, parameter types, etc.).

Change-Id: I13dc75ec5123280e94ec738dade3f54e427fdbaa
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-15 17:27:04 +01:00
Friedemann Kleint
0f0d8a5a8f Stabilize QFileSystemWatcher test.
- Run each test in a temporary directory, avoid writing test
  files in source/build tree and prevents tests being influenced
  by left-overs from previous runs and locks of the application
  on the current directory.
- Modify test to be able to use absolute paths to the temporary
  directory.
- Skip parts of test removeFileAndUnWatch if a race condition
  occurs.

Task-number: QTBUG-24029
Change-Id: I215cc2e0fe6f92d2ffe597b01cdc9c9a39e3c5b4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-15 08:59:34 +01:00
Bradley T. Hughes
b9cf3dec90 tst_QVariant passes on Mac OS X
Do not mark with insignificant_test anymore.

Task-number: QTBUG-22747
Change-Id: I4ef6d5d7e1189b03fd1ab812a0839e3709686e1b
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-15 08:59:29 +01:00
Kent Hansen
e121d6d7e8 Test template-based connect() with qmetaobjectbuilder
For template-based connect(), the meta-object is resolved at
compile-time (the virtual metaObject() function isn't called).
But we can make it work by copying the members of the dynamically
constructed meta-object to the statically defined one.

Change-Id: Ia4d3263a89008e36e187c584db6d25d9042f32b3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-15 08:59:29 +01:00
Kent Hansen
58d6c856ec qmetaobjectbuilder: Add support for revisioned methods and properties
moc supports it, so qmetaobjectbuilder should too.

Change-Id: I01475794e928b5a1b659f0dab044933948186971
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-15 08:59:29 +01:00
Jason McDonald
ab9be7cc23 Eliminate duplicate data row names from corelib autotests.
Change-Id: I57a37f19746b76c6c9c3534f5c66c5a5478dae24
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 06:19:16 +01:00
Jason McDonald
1cda7678a6 Eliminate duplicate data row names in utf8 autotest.
Change-Id: I30dfd4b93ab1e5430b5bc7fc25fe6aea0e0cc551
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 02:48:35 +01:00
Jason McDonald
db0eacaa74 Fix duplicate data row name in tst_QTextCodec::utf8Codec test.
Rename rows using naming convention used elsewhere in this test.

Change-Id: I8e669cedcc2058cf84cee976c8a0a478bc1cea0a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 02:48:35 +01:00
Jason McDonald
b904576b37 Use meaningful data row names in tst_QTextCodec::fromUnicode test.
Use the codec name instead of just numbering the rows. This eliminates
some duplicate row names.  Two duplicate rows have also been removed --
for the WINSAMI2 row, the last value in the row is different, making one
copy do a subset of the testing done by the other, so the row that did
less testing was removed.

Change-Id: I859f681a627e8d3839ca8a4ba09d541bec43d9fb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 02:48:35 +01:00
João Abecasis
5c637e9171 Add QFileInfo::isNativePath
This function returns true if the file path can be used directly with
native APIs, modulo encoding and path separator conversions. This is
important for applications that interface with other libraries or simply
need to use native APIs together with Qt.

Traditionally, this information was available in QAbstractFileEngine and
forced users to explicitly create an engine or use internal API such as
QFile::fileEngine to access the underlying engine and this piece of
information.

Given its usefulness, exposing the information in a more visible place
is more appropriate. This reduces the need for people to know or care
about implementation details, like file engines...

The existing isLocalFs test was updated and repurposed to use the new
API, instead of relying on file engines and internal implementation
details of QFileInfo.

Change-Id: I65f497bb25741f6f7ea4d2c3b3562c8c4aab8bea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-14 02:48:35 +01:00
Bradley T. Hughes
3f74aea9bb Fix tst_QSocketNotifier on Mac OS X
Socket notifier behavior is very OS-dependent. QtNetwork uses non-
immediately (it will return -1 w/ errno=EINPROGRESS). We have to wait
with select(2) to indicate that the connection is ready, then call
connect(2) again. When this happens, we need another call to select(2)
to get notification on the listening socket so that we can call
accept(2) to complete the connection.

The mixingWithTimers() failure happens due to the test expecting a
single processEvents() call to be able to completely connect a TCP
socket. But as described above, this may not happen. The test should
QTRY_COMPARE() to give the test a chance to let all this happen.

The posixSockets() test can fail due to the same connect() behavior. The
test already has a comment about the write notifier behavior being very
OS dependent. This caused the first enterLoop() to return too early,
before the read notifier fired (which is what the test is checking for,
that the read notifier fired). Move creation of the write notifier to
where we expect it to fire, just before writing to the posix socket.

In the same test, the read notifier inside QTcpSocket may not fire after
the write notifier on the posix socket. Use the waitForReadyRead()
function to give the socket a chance to read the data written to the
posix socket.

Change-Id: I541e6ee9a39a92ce3acf6b9ffee51079febe43e4
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
2012-02-13 22:16:17 +01:00
Bradley T. Hughes
771a3f29f9 Remove HP PA-RISC atomic implementation.
This architecture is obsolete and discontinued.

Support for PA-RISC can be re-added if needed, but it would be preferred
to use the GCC intrinsic support from qatomic_gcc.h (on Linux/HPPA, for
example).

Change-Id: I952e521a2c8c68840df0d44843b5487d5c20b135
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-13 12:02:11 +01:00
David Faure
3791d3b0c2 Add QUrl::toDisplayString(), which is toString() without password.
And fix documentation of toString() which said this was the method to
use for displaying to humans, while this has never been true.

Change-Id: Iff6df92e32b2517e1481d4992d80cae2d58da427
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-11 11:02:01 +01:00
Olivier Goffart
497622cafe Make it possible to put QObject tracked with QWeakPointer inside QSharedPointer
Do that by keeping the QWeakPointer that track QObject independent of
the ones that track QSharedPointer.

QSharedPointer do not touch the sharedRefCount in QObjectPrivate anymore

When converting a QWeakPointer constructed from a QObject to a
QSharedPointer, it will display a warning saying one should not do that.

Task-number: QTBUG-22622
Change-Id: I3595e3e7401702410776c458687ab357ad9366ab
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-10 15:37:10 +01:00
Kai Koehne
dd119e14d0 Fix qlogging autotest for clang
Change-Id: Iac82c4847554534174b5419ec78319c9ac381628
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-10 15:28:22 +01:00
Bradley T. Hughes
8f8e3db6ae Test posted events in tst_QEventDispatcher with various flags
Add QEventLoop::ProcessEventsFlags test data for
tst_QEventDispatcher::sendPostedEvents() to test that posted events are
sent when waiting for events and when not waiting.

Change-Id: I99f9eb121d0b1ded725e19c5233922fc0a6b81e4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-10 15:22:11 +01:00
Bradley T. Hughes
358c14821b Run tst_QEventDispatcher with the GUI event dispatchers as well
Since some GUI event dispatchers are complete reimplementations and do
not build on the corelib ones, we want to run the same tests with the
other dispatcher.

Since this is a GUI test now, we need to make sure to drain system
events queued during application startup to make sure we can reliably
run the test functions.

Change-Id: I4905db70bc8f8584c4ef1f4d767824040281452c
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-10 15:22:03 +01:00
Bradley T. Hughes
c50f026a22 Add tst_QEventDispatcher to tests/auto/corelib/kernel
This will test the event dispatcher in corelib for proper timer and
posted event handling. The test makes sure all of the necessary virtual
functions are implemented and working as expected.

This test doesn't test socket notifiers or Win32 event notifiers, as
these are already covered in existing tests.

Change-Id: I5540ffc4e6d7f97bcd6c3725d7e74c0ab9c97015
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-10 15:21:55 +01:00
Olivier Goffart
482d96a0c5 Force -fPIE on ELF if Qt is built with reduced relocations
Put in qconfig.h whether qt is compiled with reduced relocations.

When using -Bsymbolic-functions (enabled by default on Qt)
but not -fPIE, the comparison of the function pointers fail
because the addresses are different in Qt, and in the executable.

Hence we now enable -fPIE by default on qmake, and force a compilation
error when it is not enabled and built with reduced relocations.

Done-with: Sune Vuorela <sune@vuorela.dk>
Change-Id: Ib3fdba06fab6e8a93b75b4c6cf16cc973ab335db
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-10 11:42:31 +01:00
Kurt Korbatits
6e3c4de94f Fixed qlibrary unittest to work on mac
- Changed unload_after_implicit_load() to use full path
- Turned off app_bundle

Change-Id: Ibdf3ae0dc833d97eba64298715eb88c70408fff6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-10 03:02:07 +01:00
Kurt Korbatits
c5618fd880 Fixed qsharedpointer unittest to run from installation directory
- Only run invalidConstructs() tests if not cross compiled

Change-Id: If99fccdf9bca339507ca60c49aa89dc35c535d3d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-10 03:02:07 +01:00
Kai Koehne
be98fa32c7 Allow customization of qDebug output at runtime
Check the QT_OUTPUT_PATTERN environment variable in the default
message handler to customize the output of messages. Following
place holders are right now supported:
 %{message}, %{type}, %{file}, %{line}, %{function}

The original cleanupFuncinfo was written by Thiago Macieira.

Change-Id: I6ad25baaa0e6a1c9f886105d2a93ef3310e512a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure <faure@kde.org>
2012-02-09 18:11:21 +01:00
Miikka Heikkinen
581f079b04 Make "nmake check" pass for corelib tests in Windows.
- Marked four tests insignificant due to failures, these need to be
  fixed later and then re-enabled:
  - tst_qfilesystemwatcher
  - tst_qsettings
  - tst_qlibrary
  - tst_qsharedpointer
- Skipped one invalid case (tst_QCoreApplication::argc())
- Ifdeffed around vsprintf issue in MSVC (tst_QByteArray::qvsnprintf())

Task-number: QTBUG-24157
Task-number: QTBUG-24146
Task-number: QTBUG-24128
Change-Id: I4db957a65fbf0093f5ae3dc1a04d792492818104
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-09 12:52:28 +01:00
Rohan McGovern
5cd73e5088 Fixed tst_qfileinfo::group crash if getgrgid fails
QVERIFY2 and gracefully fail with an error message, rather than
crashing, if getgrgid() fails.

Change-Id: I82a7290f83208486577988cc831d5d3cba20f98e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-09 10:47:33 +01:00
Rohan McGovern
adfca27ac0 Fixed tst_qobject::property for clang
The test was failing at:

  QCOMPARE(property.userType(), qMetaTypeId<CustomType*>());

The CustomType* metatype was not registered before this part of the
test.

qMetaTypeId<T> will register the metatype for T before returning it if
it is not yet registered, while QMetaProperty::userType() returns 0 if
the metatype is not yet registered.  However, the order of evaluation of
these two expressions in the above statement is technically undefined.

Apparently, gcc evaluates the arguments in order from right to left,
allowing the test to pass, while clang evaluates the arguments in order
from left to right, causing the test to fail.

Change-Id: I5059556e860cec29b57c31e4e26f46cf9e6055da
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-09 10:45:38 +01:00
Kurt Korbatits
805d895978 Fixed qstandardpaths unittest to handle being run as root
- testCustomRuntimeDirectory test skips if run as root

Change-Id: Idcc2a1db5d8a96b2ec0248b8b1c392fffc0b2e11
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:10 +01:00
Kurt Korbatits
951c0b7afa Fixed qdir unittest to handle being run as root
- Added checks to see if running as root and skip as needed

Change-Id: I4f94d5bfe511c6dfda315854b7cd1f64efe6e4f4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:05 +01:00
Kurt Korbatits
7f403f368e Fixed qfile unittest rename() failing as root
When run as root was able to move file to /etc directory but was
expecting a failure.

Change-Id: Ic2ac5506253f2a3395ed56e88a856542bf82ad6d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:00 +01:00
João Abecasis
0c97840708 Introduce Q_DECLARE_OPAQUE_POINTER
To hide the IsPointerToTypeDerivedFromQObject monstruosity :-)

Documentation for Q_DECLARE_METATYPE and qRegisterMetaType was updated
to mention requirements on registered types and how they can be
circumvented for pointer types with the new macro.

Change-Id: If83b037a8e2f28761eb903525e87008107298801
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-09 00:32:41 +01:00
Stephen Kelly
ae85d7c965 Treat pointers to QObject derived types in QVariant specially.
It is possible to do this for example:

QVariant v = QVariant::fromValue<MyCustomQObject*>();
QObject *object = v.value<QObject*>();

This means that if a QVariant contains a pointer to a QObject
derived type, third parties can extract a QObject* and use its
properties without knowing the concrete type.

This is a source compatible change.

Change-Id: Iee9a9437e99cc2f40d1a4bfea47275482ef7161f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-08 14:43:18 +01:00
Andrew den Exter
979cb5a09e Initialize dynamic meta object extradata.
QMetaObject::invokeMethod attempts to deference the extradata for
meta objects versions 6 and greater which is causing a crash in some
of the qtquick1 tests.

Change-Id: If5b2ca83b15de2cd558976c6b681dd5457c404d1
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-08 09:53:23 +01:00
Rohan McGovern
3ae3aa0e51 Improved stability of tst_qsemaphore (especially on mac)
Timers are not entirely precise; if we ask for a timeout of
10000 milliseconds, we might time out in 9999 instead.
Also, we know the expected elapsed time in each case, so do a fuzzy
comparison against that time.

Previously the test was verifying that the elapsed time was greater than
or equal to the timeout in the case where a timeout was expected, which
means the test would not detect bugs which incorrectly caused the
timeout to occur later than it should.

(cherry picked from qt4 commit 9a2573dc13b3e8df6cd15bef64370ea407480fc7)

Change-Id: I91d0c81f989ab43a3c48f6abbb4c5b28e2b35402
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-08 02:10:51 +01:00
Jonas Gastal
63f634322b Don't allow cd'ing to above root.
Task-number: QTBUG-23893
Change-Id: Ifc6e22f135a1f6bff7c0fa8bef3ea7e1042ae819
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2012-02-07 22:05:51 +01:00
Shane Kearns
deea48ef6a Fix QFile autotest not to require elevated privilege to pass
The open test case tests opening a device path on windows.
As this requires privilege elevation, the test fails when running
nmake check from a console.
As the CI machines appear to run tests with admin privileges, first
check opening the device using the windows API. If that succeeds, then
opening using QFile should succeed. If that fails, the opening using
QFile should fail.
(Since Windows vista, members of the "administrators" group do not run
at elevated privilege all the time. The user needs to opt in via a
UAC prompt or "run as administrator". This is similar to using the
sudo command on unix)

Ran the test as administrator and normally. Now passes in both cases.

Change-Id: Ibd7682eceb61e35d4912fa0392df536f4331f6ed
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-07 20:03:43 +01:00
João Abecasis
5a92dd6124 Detect incompatibilities in repeated type registration
QMetaType used to register a typeName and factory functions for
creation/destruction of objects. While it would be possible for a single
type name to be registered matching different actual types and memory
layouts, there was little that could be done about it.

Now that QMetaType is tracking type information with a direct impact on
data layout and ABI (size and type flags) it is important that we check
and detect binary incompatibilities as early as possible.

[Such incompatibilities could arise from type name re-use (technically,
ODR violations) or, more commonly, as version mismatch between different
shared libraries or plugins.]

Only type size and flags are checked as function pointers to inline and
template or otherwise non-exported functions could trivially differ
across translation units and shared libraries.

When registering typedef types, a check is made to ensure the same name
doesn't get registered as different types.

Change-Id: I8211c3de75d4854ce8fafdb620d3a931c206e0c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-07 09:47:51 +01:00
Jędrzej Nowacki
b8cf1d6bdc Remove QMetaType::unregisterType().
The function hasn't been working properly. It was not well tested, for
example it is undefined how QVariant should behave if it contains an
instance of an unregistered type.

Concept of unregistering types was inspired by plug-in system, but in
most supported platforms we do not unload plug-ins.

Idea of type unregistering may block optimizations in meta object
system, because it would be not possible to cache a type id.
QMetaType::type() could return different ids for the same name.

Currently QMetaType::unregisterType() is not used in Qt.

Change-Id: I878b6e8d91de99f9bcefeab73af2e2ba0bd0cba0
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-07 08:53:18 +01:00
Jędrzej Nowacki
56265031b7 Align QVariant::UserType and QMetaType::User
There is no point in keeping separate values which should mean the
same.

QVariant::UserType was used also to construct a valid, null QVariant,
containing an instance of unknown custom type. The concept was strange
and useless as there was no operation that could be done on such
QVariant. Therefore it was dropped.

Please note that the patch slightly changes behavior of different
functions accepting a type id as parameter. Before QVariant::UserType
was an invalid type from QMetaType perspective (id 127 was not assigned
to any built-in type), but QMetaType::User points to the first registered
custom type.

Change-Id: I5c7d541a9affdcdacf53a4eda2272bdafaa87b71
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-02-07 08:52:32 +01:00
John Layt
23457bd6d9 SIC: QLocale: Make QSystemLocale a private class
As discussed on list and approved by Lars and Thiago.

Make QSystemLocale private to give us time and space to change it to a
better implementation.

Change-Id: Ifd806972f3996c43a876f544f78c6557ad71cd75
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-05 17:50:04 +01:00
John Layt
1e3833bed8 QString: Make convert to number methods only use C locale
Ensure consistent conversions by not using the system default locale.

Change-Id: I60db9fc4f465c0254f3213419e57d7879aaddd65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-05 17:49:42 +01:00
Lars Knoll
96501b0a18 Move QtConcurrent into its own module
Task-number: QTBUG-20892

Change-Id: I614500aafb6428915509983608bbb0ade4e4f016
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-05 17:49:16 +01:00
Jędrzej Nowacki
92b1124752 Add movability tests for QByteArray.
QByteArray is declared as movable but it was not tested before.

Change-Id: I4fb636f8705c3fd792a768872206203ee5fd4ddb
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-05 13:07:56 +01:00