Commit Graph

4063 Commits

Author SHA1 Message Date
Thiago Macieira
2bbd2262b3 Add a set of atomics based on GCC intrinsics
With this implementation, we can have Qt run on any architecture that
GCC supports without having to write specialised code. However, on
some architectures, the code that GCC generates is not optimal: it
uses locking on ARMv5 and it's always fully-ordered. For that reason,
it appears after the Qt native assembly implementations (it's a
fallback, not an override).

Since they all have fully-ordered memory semantics, we define only the
xxxRelaxed functions. The exception is __sync_lock_and_test, which has
acquire semantics, so we need to define the Release and Ordered
versions too.

On some architectures, GCC can support atomics on types different than
32-bit and pointer-sized (like x86, x86-64, ARM and even
MIPS). However, there's no standardised way of telling: GCC seems to
define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8} if those operations
are present, but I couldn't find it on the ARM compiler (it was there
for i386, x86-64, IA-64 and MIPS).

Change-Id: I55ff7a7c0cfc6388b7ad8e2c0dedecffdf2a3e01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-28 16:54:05 +01:00
Liang Qi
273715fc9b Put the generated <module>version.h into build tree
It was put in source tree before.

Task-number: QTBUG-20439
Change-Id: Ib52d9c2e83ae375aad259ddc74138bbc728b3ed0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 14:44:48 +01:00
Jonas M. Gastal
dd73365718 Making socketOption/setSocketOption virtual on QSslSocket.
Per ### Qt5 comment and the fact that it was already virtual on
QAbstractSocket.

Change-Id: If2d2b2f9cdec1ef4c5bf625e3ce0d6f2d9a7bdfd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 14:44:48 +01:00
Jędrzej Nowacki
7c853db642 Code cleanup, remove QVariant::nameToType usage.
It is better to use QMetaType::type  because it works well with custom
types too.

Change-Id: I30bc70d16b2aad4ba22682de1c215b917e64209b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 14:44:48 +01:00
Erik Verbruggen
1fee3304fd Do not suppress tr() methods when QT_NO_META_MACROS is defined.
The tr() methods are unrelated to the "meta" part, so disabling them
with that macro is not the proper way. They were originally included to
make static checks for string translation simpler, but it just results
in duplicating the definition every time QT_NO_META_MACROS is used.

Change-Id: I29eb9b83a09e1fd6c66c85c9e4ff23d8dbe65f15
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 14:44:48 +01:00
David Faure
27d9fef14a QUrl: deprecate setEncodedUrl() and fromEncoded(), add url().
setEncodedUrl() isn't necessary anymore now that setUrl can handle
encoded (and partially encoded) urls.
url() is added for symmetry with setUrl().

Change-Id: I4e671482a5635a86797421ca50882db9cd60d852
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 13:08:50 +01:00
David Faure
e650dd3b6d QUrl: use partially-decoded data in toString and QUrl(QString)
This fixes round-trip bugs. People expect to be able to do
QUrl u(...); QString s = u.toString(); QUrl u2(s); and have u==u2.
This was not true for paths containing a '#', for instance, which would
be parsed back as a fragment. The solution is to make toString output
partially decoded data (more readable than toEncoded, but not decoded
to the point of changing the meaning, if parsing it back later as a
QUrl), and to make the QUrl constructor work with partially decoded data.

Change-Id: I013c01e8947d538435f3c20fc4ec57cd9ccbba6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 13:08:50 +01:00
Jani Uusi-Rantala
00052b6449 Fix compilation problem in qjsonvalue.h
Extra ; after namespace was causing build failures with -pedantic.

Change-Id: I340252810a04815820964c625377a1dc0635783f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 11:35:28 +01:00
Denis Dzyubenko
3d84b592de Fixed includes in public headers
Change-Id: I360c94d41691a618f1bec97da8317c9dcee658c0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-27 22:48:58 +01:00
Denis Dzyubenko
6b46741876 Added $publicclassregexp variable to sync.profile
$publicclassregexp specifies the prefix for Qt classes in a qt5 module. For example
in QtJsonDb all classes have "JsonDb" prefix and forward include headers were
not generated properly - e.g. "jsondb-client.h" was generated in the include
folder, but "JsonDbClient" (which matches class name) was not.

Change-Id: I6b57a799d926254e2ab3fd00fa6e38f95b8eb96c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
2012-01-27 22:48:41 +01:00
Giuseppe D'Angelo
e1149349c1 QHash benchmark: improve Java's hash
Added a bit of documentation to the Java-like hashing function.

Change-Id: I3f44eee305d91b76f0f89cd1acf21f6430b9482b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-27 22:48:12 +01:00
Giuseppe D'Angelo
071561f0eb QHash benchmark: remove unused variables
Change-Id: Ib5abc171fb8fb70e2f73ac92ca22dc09146d8a55
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-27 22:48:12 +01:00
Mark Brand
2eaccc08d3 improvements to ModifiedRow
-remove unnecessary explicit copy constructor
-explicitly inline constructor
-more convenient initialization

Change-Id: I78b275ef9d5413f95278a044345e42303dc35624
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-01-27 22:48:12 +01:00
Mark Brand
7785227214 use nameToIndex() instead of duplicating code
Change-Id: If55541aa8a2345f90984d8b82bee0c3ebb01a605
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-01-27 22:48:12 +01:00
Mark Brand
42d1cf0bbe fix identation and style
Change-Id: I18e9e752e8dc0cf980f424264f274177b98a98be
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-27 22:48:12 +01:00
Friedemann Kleint
12b88cc7bb QSizeGrip: Fix Windows.
Reactivate the old Windows code.

Change-Id: Ied467cf83d89c76a0fa8edf3c76bb207cc2a70e0
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
2012-01-27 21:18:54 +01:00
Friedemann Kleint
692a1babe5 Decouple QPlatformTheme from QDialog.
- Use an enumeration for the dialog type.
- Implemented on Windows and Mac

Reviewed-by:  Morten Johan Sorvig <morten.sorvig@nokia.com>

Change-Id: I213748a08168efbabc2ac0106308e97ff19d19c0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-27 21:17:14 +01:00
Friedemann Kleint
b3dda7c5bf WindowsXP-Style: Draw on DC of backing store for widgets only.
- Check the device type pof the painter passed in.
- Introduce convenience functions for retrieving the DC for
  widgets that default to the top level.

Change-Id: I18a8db02c8ffd7a249310a5ffaf3a530f0a3df40
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
2012-01-27 21:16:11 +01:00
Friedemann Kleint
69b9943d94 Windows: Fix exit crash related to deletion of platform screens.
Do not delete screens in the destructor as this might call
back to the Windows and use QWindowsContext.

Change-Id: I5e66e480d4b6ddb8b17cc92e4bef93013e336be6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-27 21:12:35 +01:00
Samuli Piippo
d21f28956e Add concurrent to QT_CONFIG also on Windows
It was forgotten in 7c64ab4966

Change-Id: I1ed9a60983f978d89615ae91c99f5c02ffe57f7c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-27 13:56:27 +01:00
Simon Hausmann
a120f1a733 Fix compilation of MeeGo/Maliit related code after Qt::ScreenOrientation API changes
Qt::UnknownOrientation is now Qt::PrimaryOrientation.

Change-Id: I2846a90bd11ecd1416c29b7bd861f180ccb129a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
2012-01-27 13:55:55 +01:00
Oswald Buddenhagen
11eefaf0f7 remove bogus comment
Change-Id: Ibd2d974ac46f80953f628e8d7c93e742e4c8eb23
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-01-27 13:55:43 +01:00
Oswald Buddenhagen
e924143a90 delete handling of dead -base-dir argument
Change-Id: I4f69ea213f996f99d2ad8b00efbaf85882e59e27
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-01-27 13:55:36 +01:00
Oswald Buddenhagen
a29180a455 update readme to current reality
Change-Id: I330702f197c8b558f0a00b90f5e147dbef731abd
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-01-27 13:55:27 +01:00
Jonas M. Gastal
ed429ebfc9 Gives QNetworkCookieJar a virtual API.
QNetworkCookieJar now has the following virtual methods:
    virtual bool validateCookie(QNetworkCookie &cookie);
    virtual bool insertCookie(const QNetworkCookie &cookie, const QUrl &url);
    virtual bool updateCookie(const QNetworkCookie &cookie);
    virtual void deleteCookie(const QNetworkCookie &cookie);
Their implementation is such that the behavior the class previously
had(in memory storage of the cookies) is mantained.

Task-number: QTBUG-23145
Change-Id: I1420894d31e8072eca6903c3c7ffd6f06205a257
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Alexis Menard <alexis.menard@openbossa.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
2012-01-27 13:29:14 +01:00
Pekka Vuorela
1166ad8603 QWidgets to use QGuiApplication focus object change notifications
Moving away from deprecated QInputPanel inputItem.

Small behavioral changes:
- On focus proxy widgets, disabling WA_InputMethodEnabled on
proxy will no longer disable input method for proxy target.
- setEnabled(false) on proxy widget will no longer disable
input method for target as a special case.

Change-Id: Ifb5b7144d29bd3aefdde7cf4a0bd396db06e67e2
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-27 13:28:03 +01:00
Pekka Vuorela
dd565d2d4c QGuiApplication::focusObject() to replace QInputPanel::inputItem()
* Deprecated QInputPanel::inputWindow() which is already
  just returning QGuiApplication::activeWindow()
* Deprecated QInputPanel::inputItem() and introduced
  QGuiApplication::focusObject(). Input methods can check
  input method support by Qt::ImEnabled query.

Change-Id: I70a9c1c3f79aadb75c839d0489a9428f7a221df5
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-27 13:27:54 +01:00
Giuseppe D'Angelo
e7d0d54084 QRegularExpression: infrastructure for importing PCRE in 3rdparty/
Added the necessary files for importing and compiling PCRE under
3rdparty/, including a small shell script to ease the import
and the update of PCRE from its dist tarball.

PCRE's config.h is used, but it is assumed that a global
  s/HAVE_CONFIG_H/PCRE_HAVE_CONFIG_H/g
was run on PCRE source files to avoid polluting QtCore
compilation with -DHAVE_CONFIG_H (the aforementioned shell script
performs this substitution; therefore, -DPCRE_HAVE_CONFIG_H
is added instead to the compiler's command line).

Change-Id: Ic0f23526ebf5f770aefdffc8f688e5816c28fd8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-27 11:35:07 +01:00
Samuel Rødal
7f9b624e12 Fall back on glXChooseVisual() if glXChooseFBConfig() doesn't work.
Some older drivers don't fully support glXChooseFBConfig(). As a bonus,
fix some memory leaks here and there.

Task-number: QTBUG-21880
Change-Id: Ie306dee27f616927a6aa55fd71601569b828afcc
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-27 11:01:14 +01:00
Samuel Rødal
2d39471897 Introduced QOpenGLContext::defaultFramebufferObject().
Also add some debugging helpers to make sure applications are correctly
written even on less restrictive platforms.

Change-Id: Ie92e497c32e07b2b83662f7ab5540d8f37777fd0
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-27 10:58:32 +01:00
Oswald Buddenhagen
365b5f7a92 "cache" is used only locally, so move it into scope
Change-Id: I0ba45d5620a8e5a79fdc6a1854245a0bfcc489f0
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-01-27 10:54:48 +01:00
Jędrzej Nowacki
259388157c Remove qDBusNameToTypeId function.
The function is redundant and can be replaced by QMetaType::type().

Change-Id: I131a7fd285a60d8bd0f3b958668a43bd5da2d6c4
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-27 10:51:40 +01:00
Jonas M. Gastal
bd5881b460 Style fix for QSslCertificate constructor.
Change-Id: I1f128eb9f99ef4d25590bd034762cb8a0e68b075
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-01-27 10:47:19 +01:00
Jonas M. Gastal
f347a33115 Removing ### that would cause needless SC brekage.
Change-Id: Iaa9cfd709c0ca4192760117ba5ec6d3992804d6a
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-01-27 10:40:48 +01:00
Anselmo L. S. Melo
76a5ce8acb Implement QWindow::close()
Implement the public slot QWindow::close() and add the correspondent test.

Change-Id: If3f07cce3b26640f06fc52d0e4dca875d9894b3d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-27 08:57:58 +01:00
Jędrzej Nowacki
43270da01a Give a more verbose warning during QVariant serialization.
Change-Id: Ia3c0736284afbd4acd8cc86538f5a5399964a589
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-01-26 23:10:52 +01:00
Giuseppe D'Angelo
d6fccc69f3 QRegularExpression: configure support for PCRE
Added PCRE config.tests, and logic and command line options
(-qt-pcre and -system-pcre) for configure and configure.exe.

Change-Id: I5da2658191198dbcf48c07d7c5de1be1b884a7a5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-26 23:10:52 +01:00
Oswald Buddenhagen
3f91558d40 fix grammar in error message
Change-Id: I3fe4e0fa6da1467a4572e7f1dec1be7294632e34
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-26 21:42:08 +01:00
Oswald Buddenhagen
d0adf75a74 use warnings instead of -w
that way invocation via perl (c.f. syncqt.bat) does not need options.

Change-Id: I5d8e0d1f0ffe1b7cf280fe97d4f70968a3dbbb22
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-26 21:42:08 +01:00
Rafael Roquetto
43a48ad218 Add mkspecs for Blackberry Playbook NDK
mkspecs for QNX qcc, armv7le and x86 targets

Change-Id: Ie4b0ec46a8837ad63f5aea8429cfdd516531e09a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-26 20:12:21 +01:00
Joerg Bornemann
dcdab683d6 QProcess/Win: use asynchronous I/O for reading stdout and stderr
This saves us from using the 100 ms polling timer to read process output.

Task-number: QTBUG-23012
Change-Id: I3f9398d7a4d30826d2d89ac04bd2fd031500ff57
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-26 18:45:14 +01:00
Joerg Bornemann
9efbc9f60a QProcess/Win: use named pipes for redirecting standard I/O
Named pipes allow us to make use of overlapped I/O for
redirected stdin, stdout and stderr.

Change-Id: I50191b036bce696147139b200ddbc6c31c16112b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-26 18:45:14 +01:00
Jędrzej Nowacki
389fc8885b Fix a typo in tst_qtreewidget autotest.
Change-Id: I573467c3fdfc4b3d059b216258d39944ac546061
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-26 17:22:03 +01:00
Simon Hausmann
6b85acd515 Fix virtual keyboard on Harmattan not following window content orientation changes
Track the input item's window and notify the input method server when the content
orientation changes.

Change-Id: I401c4fd677ed2eebd8b85968d4a2b3692517e097
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
2012-01-26 15:45:19 +01:00
Denis Dzyubenko
0818fce01a Made it possible to run tst_qtjson test from shadow build directory.
Change-Id: I167737c91e01f055a2ce14db54dfcc6b74ad8c28
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-26 15:38:33 +01:00
David Faure
cd7326c16f QStandardPaths: remove unused includes (leftovers from qdesktopservices)
Change-Id: I6fe23ecd04adc7dd68573dd0d6d01888c0cf71b6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-26 15:38:25 +01:00
David Faure
e7c0fcbec4 QUrl: Implement a number of ## Qt5 TODOs (merging overloads)
Change-Id: I629c20f10e3667937d488ea30f93bf86f980ee1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-26 15:23:36 +01:00
David Faure
4408bae29a Convert tst_qurl.cpp to UTF-8 (to make it editable in QtCreator)
Change-Id: I9baa445b11f65b28596e5b88746b72c5cf04fe77
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-26 15:23:25 +01:00
Frederik Gladhorn
c7cb935b92 Send text selection changes for accessibility.
Change-Id: I3c50510ae9f995101d6e2c977c5138713389d71e
(cherry picked from commit 2cf1f24f93fa0f3f5bd7d38e160160a2c91d87f5)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-26 13:34:50 +01:00
Denis Dzyubenko
e62fe9ed4f Fixed QString::operator<(QLatin1String)
QLatin1String now has a constructor that takes explicit length, which makes it
possible to create QLatin1String that do not have null-termination character.
Fixed QString::operator> and < to be safe in that case.

In the same patch fixed qtjson which had operator< implemented in the same way.

QString::compare(QLatin1String) is still broken and will be fixed separately.

Change-Id: I48ec1183a6f44034129cc17312af854795085408
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-26 13:28:16 +01:00