profile/ivi/qtbase.git
11 years agoprintsupport: Include own headers first
Sergio Ahumada [Tue, 18 Sep 2012 22:39:16 +0000 (00:39 +0200)]
printsupport: Include own headers first

cpp files should include their own headers first (but below config.h)

Change-Id: I32a2c76a39d03f543c3eb8393b5e3015276f0622
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Sergey Hambardzumyan <sergey.hambardzumyan@digia.com>
11 years agodbus: Include own headers first
Sergio Ahumada [Tue, 18 Sep 2012 22:06:49 +0000 (00:06 +0200)]
dbus: Include own headers first

cpp files should include their own headers first (but below config.h)

Change-Id: I4115604aee3211118e2ecf604067f3559dbb9f4c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoRemove casting of QStyleOptionViewItems to set data.
Stephen Kelly [Wed, 19 Sep 2012 15:34:12 +0000 (17:34 +0200)]
Remove casting of QStyleOptionViewItems to set data.

The correct values are already set inside setOptions, because the
multiple versions of QStyleOptionViewItem were squashed in Qt 5.

Change-Id: If0faf4b35bbf476e00905905376868814b8b095a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
11 years agoRotate non maximized windows
Rafael Roquetto [Wed, 12 Sep 2012 13:53:46 +0000 (15:53 +0200)]
Rotate non maximized windows

There are two types of rotation to be considered:
1. Rotation of native widgets
The corresponding window should be rotated and resized proportionally to the
new screen geometry.

2. Rotation of toplevel windows.
The window will be only rotated. It will be only moved or resized if it
becomes clipped, in order to be fitted on the screen properly.

Change-Id: Ice92427ac07a9bea284e68917ff3e0f436722bc0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
11 years agomake src/tools/ compile without CamelCase headers
Oswald Buddenhagen [Tue, 18 Sep 2012 17:24:51 +0000 (19:24 +0200)]
make src/tools/ compile without CamelCase headers

so the build works with syncqt -minimal

Change-Id: Ief5e8eb9a504dd6c84cff76cc3e5257450386a0f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agodon't require a fake qconfig.h for the configure bootstrap
Oswald Buddenhagen [Tue, 18 Sep 2012 15:24:21 +0000 (17:24 +0200)]
don't require a fake qconfig.h for the configure bootstrap

Change-Id: I3d1224ad19b9e5278e35cf7c5142a29ccb589140
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agosyncqt only the QtCore headers for the bootstrap
Oswald Buddenhagen [Tue, 18 Sep 2012 15:20:36 +0000 (17:20 +0200)]
syncqt only the QtCore headers for the bootstrap

Change-Id: I26e19805823bfe987c721f6a274803e54f0e4003
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agomove the module validation below the loading of sync.profile
Oswald Buddenhagen [Tue, 18 Sep 2012 15:19:31 +0000 (17:19 +0200)]
move the module validation below the loading of sync.profile

otherwise the -module option will always die.

Change-Id: I023ea5681a03a2848e1084eedbbcc66f8d060b69
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agosimplify forwarding include() statement in default specs
Oswald Buddenhagen [Tue, 18 Sep 2012 10:20:03 +0000 (12:20 +0200)]
simplify forwarding include() statement in default specs

Change-Id: Ie584491a5f0355ef3f4457d9b4b9734e6e8fdc47
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agoresolve only one level of symlinks, and only for the default specs
Oswald Buddenhagen [Tue, 18 Sep 2012 07:32:46 +0000 (09:32 +0200)]
resolve only one level of symlinks, and only for the default specs

otherwise we end up in the source tree, which is counterproductive.

Task-number: QTBUG-26869
Change-Id: Id44a94f827dc285c75b9b243c8ef6478e668e3ff
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agofold m_qmakespecFull back into m_qmakespec
Oswald Buddenhagen [Tue, 18 Sep 2012 08:54:52 +0000 (10:54 +0200)]
fold m_qmakespecFull back into m_qmakespec

the original value is not used any more after the final resolution.

Change-Id: Icadc219f045a1bbfd20506c4c72c53d1fb352969
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agomake 'make check' work with non-installed prefix builds
Oswald Buddenhagen [Fri, 14 Sep 2012 13:39:49 +0000 (15:39 +0200)]
make 'make check' work with non-installed prefix builds

add the appropriate environment to the command lines

Change-Id: Ic9d3c60255be88f431213acd8c5e0ff55e014f5b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agofactor out qtAddTargetEnv()
Oswald Buddenhagen [Fri, 14 Sep 2012 13:38:56 +0000 (15:38 +0200)]
factor out qtAddTargetEnv()

Change-Id: Ib0517da54da98de4b1f2ee7d80bee22316231091
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agoremove pointless conditionals+branches
Oswald Buddenhagen [Fri, 14 Sep 2012 10:28:06 +0000 (12:28 +0200)]
remove pointless conditionals+branches

the surrounding TEMPLATE == vc* scope already implies vcproj, as dsp is
not supported any more.

Change-Id: I68363aca62e21135f42572040ccc7b189dcf32c8
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agoremove mentions of borland from project files
Oswald Buddenhagen [Fri, 14 Sep 2012 10:13:55 +0000 (12:13 +0200)]
remove mentions of borland from project files

Change-Id: I3049b24ae287bee50aca1de06664a2309df69edf
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agodon't make the outputs depend on $$QMAKE_DUMPCPP
Oswald Buddenhagen [Thu, 13 Sep 2012 18:45:19 +0000 (20:45 +0200)]
don't make the outputs depend on $$QMAKE_DUMPCPP

the variable can contain a complex command which would make a mess of
the makefile.
also, the tool doesn't change all that often, so it's not particularly
useful to depend on the binary.

Change-Id: I965d6555cb22bd6d5306b324f5cad0d747128e99
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agoremove now unnecessary indirections
Oswald Buddenhagen [Thu, 13 Sep 2012 18:42:44 +0000 (20:42 +0200)]
remove now unnecessary indirections

qmake's new parser can deal with this much more readable code.

Change-Id: I772c9da4c9d049e2b332305f41496ed1196f60eb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
11 years agoFix typo in docs.
Frederik Gladhorn [Wed, 19 Sep 2012 07:06:07 +0000 (09:06 +0200)]
Fix typo in docs.

Change-Id: Icfafa00062b442903579dd7993c75fffb60187f9
Reviewed-by: Peter Hartmann <phartmann@rim.com>
11 years agoMake QStatusBar text available via accessibility.
Tilman Sauerbeck [Tue, 21 Aug 2012 17:16:08 +0000 (19:16 +0200)]
Make QStatusBar text available via accessibility.

UNTESTED cause the build fails for me (unrelated to this patch).

Change-Id: Ie6836596b6fbaf93baa21d7008509774f1379f5c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
11 years agoFixed potential use of uninitialized variable in qgl.cpp
Samuel Rødal [Wed, 19 Sep 2012 15:01:01 +0000 (17:01 +0200)]
Fixed potential use of uninitialized variable in qgl.cpp

If glGetBooleanv fails this variable is left uninitialized.

Task-number: QTBUG-26952
Change-Id: Idb42833f2907bb66fd87c5cdb39753fca04e7438
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
11 years agoSplit the qt_message_output function in two
Thiago Macieira [Sun, 22 Apr 2012 19:35:10 +0000 (21:35 +0200)]
Split the qt_message_output function in two

This way, I can ensure that the noreturn qFatal function calls a
noreturn function as its last action.

Change-Id: I6db7aa2539af430414645f386d7fce87cdb97186
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
11 years agoQFileInfoGatherer: remove unused members userId/groupId
Marc Mutz [Tue, 7 Aug 2012 17:33:11 +0000 (19:33 +0200)]
QFileInfoGatherer: remove unused members userId/groupId

None of the code references these, so remove.

Change-Id: Ie48d30b49c644f093df9f42c8d087751c4e980ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoQFileInfoGatherer: fix race conditions pt.1: abort
Marc Mutz [Tue, 7 Aug 2012 17:17:09 +0000 (19:17 +0200)]
QFileInfoGatherer: fix race conditions pt.1: abort

Fix a race on the 'abort' variable. While there was a mutex lock around
the code that sets the variable in ~QFileInfoGatherer, there was no
protection in getFileInfos(), where it is read:

   // T:this->thread()  // T:*this
                        // in getFileInfos(), after last mutex.unlock()
   mutex.lock();
   abort = true;        while (!abort...
   // ...               // ...

Fix by making 'abort' an atomic. This means that we can drop the mutex
locker in the destructor, too. We still mostly access 'abort' under
protection of the mutex, because we need to protect other variables that
just happen to be accessed together with 'abort', but we avoid the mutex
lock/unlock on each iteration of the while loop in getFileInfos().

Also cleaned up the logic in run():

- by using the canonical form of condition.wait() (in a loop that
  checks the condition), we can ensure that !path.isEmpty() and avoid
  having to use the updateFiles boolean.
- by checking for abort.load() after we return from
  condition.wait(), we minimise the waiting time for thread
  exit.
- by using different local names, we avoid having to this->qualify members.

Also changed one condition.wakeOne() to wakeAll() for consistency
with fetchExtendedInformation().

Change-Id: If35f338fe774546616ec287c1c37e2c32ed05f1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
11 years agoPass correct argument to QShortcutEvent ctor in tst_qabstractbutton.cpp
Mitch Curtis [Mon, 17 Sep 2012 15:11:16 +0000 (17:11 +0200)]
Pass correct argument to QShortcutEvent ctor in tst_qabstractbutton.cpp

The QShortcutEvent constructor takes "int shortcutId" as its second
argument, not a bool. Since the default shortcutId is 0, this test
passed, since false == 0.

Change-Id: I43bbae4613f3badb1578dccec76dcdd3c96a3a2f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
11 years agoQVarLengthArray: provide STL-compatible member function names
Marc Mutz [Thu, 24 May 2012 06:35:39 +0000 (08:35 +0200)]
QVarLengthArray: provide STL-compatible member function names

This allows, among other things, to use QVarLengthArray as the target of
a std::back_insert_iterator.

Change-Id: I507f612a23da854bf865780aa0a7e6312f4a896b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoOpenGL: Make use of the requested version and profile in QGLWidget
Sean Harmer [Wed, 19 Sep 2012 13:09:16 +0000 (14:09 +0100)]
OpenGL: Make use of the requested version and profile in QGLWidget

When instatiating a QGLWidget in Qt5 at present it ignores the version
and profile information in the QGLFormat meaning that we always end up
with an OpenGL 2.x profile rather than what we asked for. This commit
properly takes the version and profile into account.

Change-Id: I097f10e397c23f5d97c5fcd8d5354667da286896
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
11 years agoOpenGL: Add flags and logic for newer versions of OpenGL in QGLFormat
Sean Harmer [Wed, 19 Sep 2012 12:46:36 +0000 (13:46 +0100)]
OpenGL: Add flags and logic for newer versions of OpenGL in QGLFormat

Change-Id: Iad57286c36c7fd205f06abc40cca5f568d572e81
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
11 years agoOpenGL: Request latest GL version when using QGLTemporaryContext
Sean Harmer [Wed, 19 Sep 2012 11:07:46 +0000 (12:07 +0100)]
OpenGL: Request latest GL version when using QGLTemporaryContext

This is necessary so that QGLFormat::openGLVersionFlags() returns the
complete set of versions. Without this patch the temporary context
ends up obtaining an OpenGL 2.x context as the QPA plugins now prefer
to use the ARB {wgl,glx}CreateContextAttribsARB function which creates
contexts of the specified version (2.0 for a default QSurfaceFormat).

Change-Id: I2c3e02c9d7b77d4ee0484f9e8786f41675f8a439
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
11 years agoMake QTimer::singleShot take a pointer-to-const QObject
Giuseppe D'Angelo [Thu, 13 Sep 2012 18:23:10 +0000 (19:23 +0100)]
Make QTimer::singleShot take a pointer-to-const QObject

The obvious idea is that a connect() happens behind the scenes.
As QObject::connect takes a pointer-to-const, singleShot should
do that as well.

Change-Id: I36433c723441294b2088b23f0c37724ab43d9503
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoRemove qUpperBound usages from qtbase
Giuseppe D'Angelo [Tue, 18 Sep 2012 21:41:59 +0000 (22:41 +0100)]
Remove qUpperBound usages from qtbase

Replace them with std::upper_bound; this allows for deprecation of
qUpperBound.

Change-Id: Idef01d2228b9a70eee3d52931d7aedb5bb6ba902
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
11 years agoRemove qLowerBound usages from qtbase
Giuseppe D'Angelo [Tue, 18 Sep 2012 21:41:59 +0000 (22:41 +0100)]
Remove qLowerBound usages from qtbase

Replace them with std::lower_bound; this allows for deprecation of
qLowerBound.

Change-Id: I536e7338eb85ea6c7c1a5bf23121292767927e0b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
11 years agoconfigure.exe: Improve help output
Kai Koehne [Wed, 19 Sep 2012 10:08:56 +0000 (12:08 +0200)]
configure.exe: Improve help output

Add line breaks where it's looking awkward in cmd.exe , and new lines
where needed. Also adapt some descriptions to the configure shell script
output.

Change-Id: Ie784e715f51f7ff692ee85f7c960dc4583b65b23
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
11 years agoFix configure.exe output
Kai Koehne [Wed, 19 Sep 2012 09:42:44 +0000 (11:42 +0200)]
Fix configure.exe output

Fix help output for -no-fontconfig, introduced in commit 1838a6c2.

Change-Id: I686000d51c56fde56179dcebef31b0783c0dfc29
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
11 years agosql: Include own headers first
Sergio Ahumada [Tue, 18 Sep 2012 22:31:08 +0000 (00:31 +0200)]
sql: Include own headers first

cpp files should include their own headers first (but below config.h)

Change-Id: I225bc0f09988167ae7f938f7f21a77d05a3d191b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
11 years agoDoc: Use QStyledItemDelegate and frameless spinboxes in spinbox delegate example
Geir Vattekar [Fri, 7 Sep 2012 09:58:34 +0000 (11:58 +0200)]
Doc: Use QStyledItemDelegate and frameless spinboxes in spinbox delegate example

Task-number: QTBUG-18847
Change-Id: I5347a1028b6f45a60e43fb75f6d362efecb6880b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
11 years agoFix tab navigation in windowflags example
Gabriel de Dietrich [Tue, 18 Sep 2012 14:24:00 +0000 (16:24 +0200)]
Fix tab navigation in windowflags example

Change-Id: Ia0e3087ea60262546cd1a21614591ad3626469d3
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
11 years agoIntroducing NoDropShadowWindowHint window flag
Gabriel de Dietrich [Fri, 6 Jul 2012 14:26:52 +0000 (16:26 +0200)]
Introducing NoDropShadowWindowHint window flag

Added suppport on QCocoaWindow.

Also we deprecate WA_MacNoShadow since it isn't used anywhere, and updated
the 'windowflags' example app.

Change-Id: Id0b453ba15a23b768b0615838597bca139f507ad
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
11 years agofix non-bootstrapped $$system()'s line end conversions on windows
Oswald Buddenhagen [Mon, 17 Sep 2012 19:18:10 +0000 (21:18 +0200)]
fix non-bootstrapped $$system()'s line end conversions on windows

Change-Id: I026da1312bc28619dc7aa5974b7f4c00710517ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agoCore: Fix gcc warning about signed/unsigned integer comparison
Kai Koehne [Mon, 17 Sep 2012 09:15:29 +0000 (11:15 +0200)]
Core: Fix gcc warning about signed/unsigned integer comparison

Fix warning: 'comparison between signed and unsigned integer expressions'

Change-Id: I5ce2857115137f9a06eddc74fda55ae49e37d345
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoNetwork: Fix mingw-gcc warning
Kai Koehne [Mon, 17 Sep 2012 10:49:48 +0000 (12:49 +0200)]
Network: Fix mingw-gcc warning

Fix warning: missing braces around initializer for 'BYTE [6] {aka unsigned char [6]}'

Change-Id: Ic247ff0721955c4562ed027fad7cb3786809a840
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoNetwork: Fix gcc warning about qDebug format
Kai Koehne [Mon, 17 Sep 2012 10:10:00 +0000 (12:10 +0200)]
Network: Fix gcc warning about qDebug format

Fix gcc warnings: 'unknown conversion type character 'l' in format' , and
'too many arguments for format'.

Change-Id: Ic7547a5bd5ba0d4c9f115004f250a0f7d3b378cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoQElapsedTimer: Fix typo in restart() documentation
Jonathan Liu [Tue, 18 Sep 2012 11:00:16 +0000 (21:00 +1000)]
QElapsedTimer: Fix typo in restart() documentation

Change-Id: Iac5df9edbe16ec841f783bc5266091a6e34e9cab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoFix mapping to/from global coordinates for child/embedded windows.
Miikka Heikkinen [Thu, 13 Sep 2012 09:14:13 +0000 (12:14 +0300)]
Fix mapping to/from global coordinates for child/embedded windows.

QWidget's mapToGlobal() and mapFromGlobal() functions assumed that
if the widget reports it's a window or if it has no parent widget, it
must be a top level window whose coordinates are in global coordinates.
This is not true for child QWindows or embedded native windows
(QAxWidgets).

Changed the logic for mapping coordinates to use equivalent methods
from QWindow if widget has a window handle, and changed QWindow's
methods to map coordinates using native methods if window is embedded.

Also fixed newly failing accessibility autotest. The geometry related
failures there popped up because now the position of the rect returned
by accessible interface is actually correct while widget geometry still
reports position 0,0 before widget has shown up.

Task-number: QTBUG-26436
Change-Id: I658fafd0ce01eb1604ba255efeeba3073ca0189f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
11 years agoX11 (xcb) support for QScreen-per-output and runtime changes
Shawn Rutledge [Wed, 5 Sep 2012 11:44:44 +0000 (13:44 +0200)]
X11 (xcb) support for QScreen-per-output and runtime changes

QScreen has notifiers for its properties, but they were not being
emitted when one changes the resolution or arrangement of individual
outputs, e.g. via xrandr.  Also there should be one QScreen per
"output", e.g. laptop LCD + external monitor means 2 QScreens
which will be siblings, rather than just 1 QScreen to represent
the whole desktop.

Change-Id: Ia61bbc5e6a3506f813ab11f87c03d14cf7f4ce85
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
11 years agoDisable SSL compression by default.
Richard Moore [Tue, 11 Sep 2012 21:49:55 +0000 (22:49 +0100)]
Disable SSL compression by default.

Disable SSL compression by default since this appears to be the a likely
cause of the currently hyped CRIME attack.

Change-Id: I515fcc46f5199acf938e9e880a4345f2d405b2a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
11 years agoFix thread-safety of qt_ignore_sigpipe
Thiago Macieira [Tue, 11 Sep 2012 13:36:54 +0000 (15:36 +0200)]
Fix thread-safety of qt_ignore_sigpipe

The testAndSet operation would mean another thread could see the value
of 1 and proceed to write(2)/sendto(2) before SIGPIPE had been ignored.
If the pipe or socket were already closed by then, a SIGPIPE would be
delivered to the application with its default action: terminate.

Change-Id: I62dc8f5fa14c1dd453d13e4053c642bd78fbc468
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
11 years agodon't allow overloading of built-in functions
Oswald Buddenhagen [Mon, 3 Sep 2012 18:57:59 +0000 (20:57 +0200)]
don't allow overloading of built-in functions

the functions are not versioned or scoped, so user-defined overloads would
mess up qmake's own feature files. it seems safer to break user projects
than to allow the user to break qmake.

Change-Id: I020a2e6416bbb6e2fd2ece339629d848c00c8398
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
11 years agoremove the entirely insane whitespace compression
Oswald Buddenhagen [Mon, 3 Sep 2012 15:05:33 +0000 (17:05 +0200)]
remove the entirely insane whitespace compression

it was merely an artifact of using QString::simplified() on the
unparsed (!) project code. there is no reason why anyone should actually
rely on it, so just remove it.

Change-Id: If9b957c4b1263f3990a2331f8851bb1c06154ea8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
11 years agoBuild tools in release mode if using -debug-and-release option
Yuchen Deng [Mon, 17 Sep 2012 23:33:03 +0000 (07:33 +0800)]
Build tools in release mode if using -debug-and-release option

Change-Id: I1d4b69e6954526b4f999e248f4f2cde6a9da26cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
11 years agoPrevent buffer overflow in QXcbWindow.
Samuel Rødal [Mon, 17 Sep 2012 15:18:58 +0000 (17:18 +0200)]
Prevent buffer overflow in QXcbWindow.

Thanks to Janne Kulmala for noticing this and informing about the fix.

Task-number: QTBUG-27123
Change-Id: Idd3cfd74fb7be277b6d805446aea5784b8fdf2f6
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoMake qdoc read multiline macros in files with CRLF endings
Jan-Arve Saether [Tue, 11 Sep 2012 11:16:27 +0000 (13:16 +0200)]
Make qdoc read multiline macros in files with CRLF endings

This caused qdoc for instance to not being able to parse qglobal.h
correctly. (On windows, it stopped to parse anything meaningful after
the line with this macro:)

  #define Q_INIT_RESOURCE_EXTERN(name) \
      extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) ();

It worked on linux just because on linux a line continuation 'token' is
the sequence "\\\n" (on windows it is "\\\r\n")

So for files with CRLF line endings, it treated *only* the first line
as a macro, potentially causing the subsequent lines to affect the
state of the tokenizer.

Change-Id: If7c80ee7eb317f2d324ace7ff540ced7c31185dc
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Martin Smith <martin.smith@nokia.com>
11 years agofix QMAKE_MANIFEST for shadow builds
Oswald Buddenhagen [Fri, 14 Sep 2012 15:10:27 +0000 (17:10 +0200)]
fix QMAKE_MANIFEST for shadow builds

Change-Id: Iea71f4a4d483e9465b3a7f0ce4560b2e9fa6cd63
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agoproperly C-quote the manifest file name in the rc file
Oswald Buddenhagen [Fri, 14 Sep 2012 15:29:13 +0000 (17:29 +0200)]
properly C-quote the manifest file name in the rc file

Change-Id: I8c8eb85d412becc8c4029c2aa393abf6f8e949b6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agorewrite *_manifest.rc unconditionally
Oswald Buddenhagen [Fri, 14 Sep 2012 15:19:38 +0000 (17:19 +0200)]
rewrite *_manifest.rc unconditionally

the file has no dependency tracking, so changes to the source would get
missed and cause hard to debug build issues.
and as nothing does dependency tracking on that file, this change
doesn't even cause a noticable performance regression.

Change-Id: I108b490b71a43018e0c7ef5d7c0b11d79a8e726b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agofactor out qtAddToolEnv()
Oswald Buddenhagen [Thu, 13 Sep 2012 16:13:13 +0000 (18:13 +0200)]
factor out qtAddToolEnv()

so it's available for other users as well

Change-Id: I2d5a14ae427575c07321ac532b13ee03308b837f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agoremove 3rd parameter from qtPrepareTool()
Oswald Buddenhagen [Thu, 13 Sep 2012 15:34:35 +0000 (17:34 +0200)]
remove 3rd parameter from qtPrepareTool()

it's been superseded by the QTTOOL.* module stuff.

Change-Id: I01c9fc3ebbb22111bfb03f82693c7cf08b5fc9d4
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
11 years agodefine QT_OPEN_LARGEFILE
John Peterson [Mon, 17 Sep 2012 19:59:22 +0000 (21:59 +0200)]
define QT_OPEN_LARGEFILE

it must be defined, even if zero

Task-number: QTBUG-27232
Change-Id: I950ef61ede197af9c2d8aedddd712cc6d4cc745b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoAdd Q_PRINTSUPPORT_EXPORT to qdoc ignores.
Frederik Gladhorn [Wed, 5 Sep 2012 14:05:33 +0000 (16:05 +0200)]
Add Q_PRINTSUPPORT_EXPORT to qdoc ignores.

Change-Id: I0b8676a14133baf818ec12cda77dcb0670b5ee85
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
11 years agoLet qVersion() be extern "C" if this is not a namespace build
Thiago Macieira [Wed, 29 Aug 2012 10:09:31 +0000 (12:09 +0200)]
Let qVersion() be extern "C" if this is not a namespace build

This allows one to even dlopen() QtCore and call qVersion, to figure
out which version it is. A bit crazy, but someone might want to do it.

Change-Id: I932460515d07bed3f0e41c8ab2b46fc268ca73ff
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoHTTP header may be damaged - fix, unit test
Tomasz Duda [Thu, 6 Sep 2012 20:15:26 +0000 (22:15 +0200)]
HTTP header may be damaged - fix, unit test

"HTTP/1.1 100 CONTINUE\r\n"
If the header from a server is splitted between two packets
the first packet contains "HTTP/1.1 100" and the second one
contains " CONTINUE\r\n", one space (0x20) is skipped. After
processing the line looks in this way "HTTP/1.1 100CONTINUE".
QHttpNetworkReplyPrivate::readStatus(QAbstractSocket *socket)
is called twice, if a http header is splitted as above.
The function always removes whitespace from the beginning of a packet,
even if it is the second part of a http header.

QHttpNetworkReply returns QNetworkReply::RemoteHostClosedError
due to damaged http header during processing.

Improvement of unit test.

Task-number: QTBUG-27161

Change-Id: Ifc2949f62473209b4032185effbf5078b4130cda
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoexamples: Mark ctor's as explicit
Sergio Ahumada [Sat, 15 Sep 2012 11:46:14 +0000 (13:46 +0200)]
examples: Mark ctor's as explicit

Make C++ class constructors that can be used with only one
required argument 'explicit' to minimize wrong use of the class.

Change-Id: Ida9f9c2f0c8608c35b0137b2512a6747afd69515
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoqmake: Include own header first
Sergio Ahumada [Sat, 15 Sep 2012 13:34:17 +0000 (15:34 +0200)]
qmake: Include own header first

cpp files should include their own headers first (but below config.h)

Change-Id: I10ef37854843ae6438d68f96ce5ee83eede33db5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
11 years agoSIC: QtPrintSupport - Remove QAbstractPageSetupDialog
John Layt [Sun, 20 May 2012 21:38:28 +0000 (22:38 +0100)]
SIC: QtPrintSupport - Remove QAbstractPageSetupDialog

QAbstractPageSetupDialog is a completely unnecessary base class that
is not really abstract and is used nowhere else.  This changes merges
its methods into the QPageSetupDialog main class.

While technically SIC no-one else uses this so no apps should be
affected.

Change-Id: I59b1739f1c453c34c25d1664d5d042e7918db316
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agouse qmake to get PKG_CONFIG in configure script
Mark Brand [Fri, 14 Sep 2012 08:03:18 +0000 (10:03 +0200)]
use qmake to get PKG_CONFIG in configure script

The value of PKG_CONFIG might depend on device options.
For example, "-device-option PKG_CONFIG" might be used with configure
or a mkspec might prefix PKG_CONFIG with CROSS_COMPILE which is
specified as a device option.

The shell functions of configure for parsing mkspecs do not take
device options into account, but qmake is pretty good at it now.

Change-Id: I1c9558e550c48e8441ebdac34b82066473c2ce3a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
11 years agotest: Mark tst_QTabBar::sizeHints() failure as XFAIL
Sergio Ahumada [Sat, 15 Sep 2012 10:57:56 +0000 (12:57 +0200)]
test: Mark tst_QTabBar::sizeHints() failure as XFAIL

The test has one stable failure on Mac OS X, so mark this
with QEXPECT_FAIL and remove the QSKIP

Task-number: QTBUG-22320
Task-number: QTBUG-27230
Change-Id: I7660df5770c39788792068a5b68e8236551288c4
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
11 years agoExclude QIcuCodec when QT_NO_TEXTCODEC is defined
J-P Nurmi [Wed, 12 Sep 2012 11:30:06 +0000 (13:30 +0200)]
Exclude QIcuCodec when QT_NO_TEXTCODEC is defined

Change-Id: Iec0178c427abcc1c79e4fe6ef449d399ac8ca363
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agonetwork: Fix missing or improper include guard in headers
Sergio Ahumada [Sat, 15 Sep 2012 16:29:50 +0000 (18:29 +0200)]
network: Fix missing or improper include guard in headers

Use an include guard in headers to ensure the header is not included
more than once. Make the header guard match its file name.

Also, cpp files should include their own headers first (but below config.h)

Change-Id: Iecf5da23c0f8e6d457f67657b88ef7557bde9669
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoconcurrent: Fix missing or improper include guard in headers
Sergio Ahumada [Sat, 15 Sep 2012 15:31:44 +0000 (17:31 +0200)]
concurrent: Fix missing or improper include guard in headers

Use an include guard in headers to ensure the header is not included
more than once. Make the header guard match its file name.

Also, cpp files should include their own headers first (but below config.h)

Change-Id: I902c8936382f5c1a8e0de7dbf49e5423f9b72bbe
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agogui/opengl: Fix missing or improper include guard in headers
Sergio Ahumada [Sat, 15 Sep 2012 14:51:51 +0000 (16:51 +0200)]
gui/opengl: Fix missing or improper include guard in headers

Use an include guard in headers to ensure the header is not included
more than once. Make the header guard match its file name.

Change-Id: I29b41e9d33e4ea17165f44c49de0a963574dd809
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
11 years agoAttempt to stabilize QMenu auto tests
J-P Nurmi [Fri, 14 Sep 2012 09:18:19 +0000 (11:18 +0200)]
Attempt to stabilize QMenu auto tests

Change-Id: I7d8260570a280182990d78e07d696aa4b46e1747
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
11 years agoMake maemo scope syntax in project files more generic
Laszlo Papp [Fri, 14 Sep 2012 14:21:34 +0000 (15:21 +0100)]
Make maemo scope syntax in project files more generic

It is necessary to use the n9 device file for now in scratchbox or/and on the
community open build service because the maemo platform mkspecs file assumes
that a cross-toolchain is used all the time. If no platform file is used, then
for instance certain plugins may not be built in general. There is currently an
ongoing issue with the meego plugin for context management in the Harmattan
components project. That is currently not built due to this issue, so no
orientation works in those applications.

The nice solution would be to make the maemo platform file work with cross and
native toolchains as well, but that requires a decent amount of investigation
and work. Thereby, the scope is extended this way for now.

Change-Id: I172c7d152bdbb2db279526d9fd1ca5648d0cd0a9
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
11 years agoBlackberry: fix tst_QFileInfo::fileTimes()
Rafael Roquetto [Thu, 13 Sep 2012 17:11:25 +0000 (14:11 -0300)]
Blackberry: fix tst_QFileInfo::fileTimes()

The Blackberry OS uses a filesystem with the noatime option,
which returns a "wrong" access time.

Change-Id: I04cdb899699e819a36e0917e30d750067b33388d
Reviewed-by: Tobias Koenig
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
11 years agoQErrorMessage: Use qInstallMessageHandler instead of qInstallMsgHandler
Kai Koehne [Wed, 12 Sep 2012 07:56:51 +0000 (09:56 +0200)]
QErrorMessage: Use qInstallMessageHandler instead of qInstallMsgHandler

qInstallMsgHandler got deprecated in Qt 5. Use qInstallMessageHandler instead.

Change-Id: Ie1156ca11eb6be555c681007ddc230978211d029
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoAutotests: Use qInstallMessageHandler
Kai Koehne [Wed, 12 Sep 2012 08:42:25 +0000 (10:42 +0200)]
Autotests: Use qInstallMessageHandler

qInstallMsgHandler got deprecated in Qt 5.

Change-Id: Ib36983e66b3a8090b99f14e3fd4e210602a3f018
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoqdoc: Refactoring of qdoc data structures
Martin Smith [Thu, 13 Sep 2012 09:38:45 +0000 (11:38 +0200)]
qdoc: Refactoring of qdoc data structures

This commit is the beginning of a significant
overhaul of qdoc. A new class, QDocDatabase, is
added, which will eventually encapsulate all the
data structures used by qdoc. In this commit, the
Tree class is made private and only accessible
from QDocDatabase. Several maps structures are
also moved into QDocDatabase from other classes.

Much dead code and unused parameters were removed.
Further simplification will follow.

Change-Id: I237411c50f3ced0d2fc8d3b0fbfdf4e55880f8e9
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
11 years agoFix the comment for the maemo mkspecs since it does not work for fremantle
Laszlo Papp [Fri, 14 Sep 2012 06:08:50 +0000 (07:08 +0100)]
Fix the comment for the maemo mkspecs since it does not work for fremantle

See the bug QTBUG-18361 for details.

Change-Id: Idbe2043c07cca795e8e2fca8204993dfb0a11988
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoRename the N9 device mkspecs folder to match the *-maemo* regex
Laszlo Papp [Thu, 13 Sep 2012 18:38:25 +0000 (19:38 +0100)]
Rename the N9 device mkspecs folder to match the *-maemo* regex

Change-Id: I0c7b74d67f44d776a74671d38bbc0f2424974c2c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
11 years agoMark (non-public API's) ctor's as explicit
Sergio Ahumada [Sat, 8 Sep 2012 17:08:53 +0000 (19:08 +0200)]
Mark (non-public API's) ctor's as explicit

Make C++ class constructors that can be used with only one
required argument 'explicit' to minimize wrong use of the class.

Change-Id: I12ad5b6eb1794108c6b7464a2573e84068733b03
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoremove usage of QT_MAKEDLL in favor of the new QT_STATIC macro
Joerg Bornemann [Mon, 10 Sep 2012 15:21:04 +0000 (17:21 +0200)]
remove usage of QT_MAKEDLL in favor of the new QT_STATIC macro

Change-Id: I411cab0d92a8cad6b4f3676afe5cee050c4b789b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoRemove support for Intel C++ 7.1 and 8.0
Thiago Macieira [Fri, 14 Sep 2012 10:53:10 +0000 (12:53 +0200)]
Remove support for Intel C++ 7.1 and 8.0

Those compilers are old and untested. Qt is only tested with ICC 12.1
and 13.0.

Change-Id: I3a5fa9452de27a61ee087700cc054a76fe4160ee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoFix repaint issue when resizing a window in Windows
Miikka Heikkinen [Wed, 12 Sep 2012 10:09:42 +0000 (13:09 +0300)]
Fix repaint issue when resizing a window in Windows

QWindowsWindow::handleWmPaint() cached the device context it got from
BeginPaint call and used that for the window when the backing store
blitted itself to the window. The problem with this device context is
that the clipping region is set to only encompass the newly exposed
areas, which means any changes caused by the resize on the previously
exposed area were not repainted.

Fixed by removing the DC caching. The benefit was minimal anyway.

Change-Id: I8bd3c4031432ce6b52434c80bfe65d35d9feae49
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoQDoc manual: ordered command list
Jerome Pasion [Tue, 11 Sep 2012 11:43:15 +0000 (13:43 +0200)]
QDoc manual: ordered command list

Some commands were not listed in alphabetical order.

Change-Id: I299abe145ca0f9d63c9ceefb801f5c53548e7938
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Martin Smith <martin.smith@nokia.com>
11 years agoDocumented QtOpenGL classes that have better replacements as obsolete.
Samuel Rødal [Fri, 14 Sep 2012 08:47:57 +0000 (10:47 +0200)]
Documented QtOpenGL classes that have better replacements as obsolete.

These have new replacements in QtGui since Qt 5.0.

Change-Id: I20e8fdd4e9c14d8c626eda3072217af1858bf492
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
11 years agoqpa: avoid useless resize in DirectFB platform
Julien Brianceau [Thu, 13 Sep 2012 09:05:53 +0000 (11:05 +0200)]
qpa: avoid useless resize in DirectFB platform

Check current size before resizing QDirectFbBackingStore through
its resize() method to avoid useless deallocation/reallocation.

Change-Id: Idc32eb20d3d3cac988fa9dd2feb80910303f5763
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agoAvoid deprecated QTest method in unit test
Pekka Vuorela [Tue, 11 Sep 2012 14:00:24 +0000 (17:00 +0300)]
Avoid deprecated QTest method in unit test

Change-Id: I1d6fc84962ba29a8963f99b87cccb4af465a2935
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
11 years agoRemove deprecated QInputMethod::visible()
Pekka Vuorela [Tue, 4 Sep 2012 13:20:01 +0000 (16:20 +0300)]
Remove deprecated QInputMethod::visible()

Replaced with isVisible()

Change-Id: Id47683954e89c53e73fc5171977609de7f1b4245
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoFix compilation on Harmattan
Simon Hausmann [Thu, 13 Sep 2012 10:52:49 +0000 (12:52 +0200)]
Fix compilation on Harmattan

The GLES2 libraries on Harmattan do not provide a typedef for GLChar.  Work
around it here by adding it. The Kkronos headers specify GLChar as a typedef to
char, so if an implementation already provides it, then this doesn't do any
harm.

Change-Id: I0848b72b81fcc602dc8d9eecefdacb5436163040
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agotests: Don't omit the body of a test function with QT_BUILD_INTERNAL
Sergio Ahumada [Tue, 4 Sep 2012 10:40:16 +0000 (12:40 +0200)]
tests: Don't omit the body of a test function with QT_BUILD_INTERNAL

Changing it outside of the test function definition to avoid running
empty/inapplicable test functions.

Change-Id: I713560cde7f715696984ed082d682900f5f1bcdd
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
11 years agoMove QRecursiveMutexPrivate to qmutex.cpp and mark inline
Thiago Macieira [Thu, 16 Aug 2012 14:12:07 +0000 (16:12 +0200)]
Move QRecursiveMutexPrivate to qmutex.cpp and mark inline

Disassembly of the optimised code shows that the compiler was already
inlining the bodies of one or both functions (since they're in the same
.cpp, it's allowed to do that).

However, since there was no "inline" marker, the compiler was also
emitting an out-of-line copy, which wasn't used by anyone, as the class
is not exported.

So add the marker. To make sure that they don't get used by accident
elsewhere, the class is moved to the .cpp file too.

Change-Id: Iead578ec9c7d8dd6b4e6bb582ce5b829cdec5992
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
11 years agoRemove QBasicAtomic::tryLock with a timer
Thiago Macieira [Sat, 11 Aug 2012 16:18:27 +0000 (18:18 +0200)]
Remove QBasicAtomic::tryLock with a timer

The non-futex implementation does not support timed locks in
QBasicMutex. That is only supported in QMutex (due to the
destructor).

Change-Id: I46d33a66a36e05c8a4344823537178e80a6ddd76
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years ago#include the qmutex_xxx.cpp at the end of qmutex.cpp
Thiago Macieira [Sat, 11 Aug 2012 14:28:53 +0000 (16:28 +0200)]
#include the qmutex_xxx.cpp at the end of qmutex.cpp

This produces slightly better inlining results.

Change-Id: Ie86471577f888cb2d9c9989306ec69ce0a296108
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoUse storeRelease to unlock a mutex instead of fetchAndStoreRelease
Thiago Macieira [Sat, 11 Aug 2012 13:23:56 +0000 (15:23 +0200)]
Use storeRelease to unlock a mutex instead of fetchAndStoreRelease

We're not checking the result anyway, so use a simpler operation.

Change-Id: I8c2db35be86660b29d81dd97ce3e269de55a37df
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoAvoid calling QElapsedTimer::nsecsElapsed before the first futex sleep
Thiago Macieira [Sat, 11 Aug 2012 14:03:51 +0000 (16:03 +0200)]
Avoid calling QElapsedTimer::nsecsElapsed before the first futex sleep

The first time we're going to sleep, the timeout should be exactly the
value that was passed by the user. We don't need to calculate the time
elapsed between start() and a few lines below.

Change-Id: I99c363b6f0ecfd07ad787b79b75e61771733c2b3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoSplit the timed mutex lock from the non-timed lock functions
Thiago Macieira [Sat, 11 Aug 2012 10:18:45 +0000 (12:18 +0200)]
Split the timed mutex lock from the non-timed lock functions

Non-timed mutex locks are by far more common, so let's try not to
penalise the locking of those with code that won't get used that
often.

Change-Id: I37f56d6429836467fdec2e588c0fb22d914b5d75
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoSimplify the futex lock loop: no need for nested while
Thiago Macieira [Sat, 11 Aug 2012 12:47:10 +0000 (14:47 +0200)]
Simplify the futex lock loop: no need for nested while

Once we enter the inner loop, we never exit it except to return from
the lockInternal() function, so the rest is never executed again.

As a consequence of this, we won't try to fastTryLock() twice per
mutex. Therefore, for a non-recursive mutex, if lockInternal() is
entered, we'll definitely need to use futexes.

Change-Id: Ice617ed27449c1fbdc112a159a86cd0660125e13
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoMake QBasicMutex be exclusively non-recursive
Thiago Macieira [Sat, 11 Aug 2012 14:45:14 +0000 (16:45 +0200)]
Make QBasicMutex be exclusively non-recursive

Dispatch to the recursive mutex functions from QMutex::lock, tryLock
and unlock.

This has the benefit that those using QBasicMutex will not go through
the testing for recursive mutexes. It simplifies a little the code for
those users.

For the users of QMutex, the code required to perform a lock does not
appear to change.

Change-Id: I0ca9965e012b283c30f1fab8e9f6d9b3288c2247
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoDon't recheck about timeout == 0 during mutex locking
Thiago Macieira [Sat, 11 Aug 2012 12:08:39 +0000 (14:08 +0200)]
Don't recheck about timeout == 0 during mutex locking

If the timeout wasn't zero, it can only become zero if we return from
futex() with a non-timeout reason but subsequently expires while we're
recalculating something.

A side effect is that we try-lock a non-recursive mutex exactly
once. Before this change, we'd fastTryLock() twice even with
timeout == 0.

Change-Id: I0af09fc2a84669a683a843fcf1513203b075dfb7
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
11 years agoHoist the recursive mutex check out of the inner loop
Thiago Macieira [Sat, 11 Aug 2012 11:51:26 +0000 (13:51 +0200)]
Hoist the recursive mutex check out of the inner loop

A non-recursive mutex doesn't suddenly become recursive, so we don't
need to check it multiple times.

Change-Id: Id040254b6142d320a7bd3111491082ad09968404
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoQtDBus: added missing QT_NO_DBUS guards
J-P Nurmi [Wed, 12 Sep 2012 12:00:49 +0000 (14:00 +0200)]
QtDBus: added missing QT_NO_DBUS guards

Change-Id: If3bbba7765a4949e5a7aefca063dc56c21c06687
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoFix QDBusServer with more than one connection
Jan Arne Petersen [Fri, 23 Mar 2012 12:58:04 +0000 (13:58 +0100)]
Fix QDBusServer with more than one connection

Create a new QDBusConnectionPrivate for every new connection in
qDBusNewConnection instead of creating a single QDBusConnectionPrivate
in the QDBusServer constructor which gets assigned the latest connected
DBusConnection in qDBusNewConnection (and loses track on all previous
DBusConnections).

Also extend tst_QDBusConnection::registerObjectPeer() test with multiple
connections to the server.

Task-Number: 24921
Change-Id: I4341e8d48d464f3fe0a314a6ab14f848545d65a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>