profile/ivi/qtbase.git
12 years agoMerge "Merge remote-tracking branch 'origin/containers' into api_changes" into refs...
Friedemann Kleint [Fri, 9 Mar 2012 10:04:36 +0000 (11:04 +0100)]
Merge "Merge remote-tracking branch 'origin/containers' into api_changes" into refs/staging/api_changes

12 years ago{QTouchEvent,QWindowSystemInterface}::TouchPoint: replace QList<QPointF> with QVector
Marc Mutz [Thu, 1 Mar 2012 08:01:12 +0000 (09:01 +0100)]
{QTouchEvent,QWindowSystemInterface}::TouchPoint: replace QList<QPointF> with QVector

QPointF is in the category of types for which QList
is needlessly inefficient (elements are copy-constructed
onto the heap and held through pointers). Use a vector
instead. This is consistent with the QPainter API.

Change-Id: Ie3d6647e05b40a33a7bb0598cbbcde4676e00836
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoQVariant: fix HasIsNullMethod for final classes
Marc Mutz [Fri, 2 Mar 2012 10:51:52 +0000 (11:51 +0100)]
QVariant: fix HasIsNullMethod for final classes

HasIsNullMethod uses the accepted C++98 idiom to
check for members that might be inherited from
baseclasses.

The technique, however, requires inheriting from
the type-under-test, which fails for C++11 final
classes.

Fortunately, under C++11 we have much better
support for static type introspection: sfinae
for expressions. We use this here (see decltype()
use in qvariant_p.h) to write a C++11 version of
HasIsNullMethod that works with final classes, too.

However, since this technique required decltype()
support in the compiler, Q_DECL_FINAL can no longer
be used for both method and class markup. So we
declare a new Q_DECL_FINAL_CLASS which is only
set iff the compiler supports decltype(), too.

MSVC 2005 and 2008 support a non-standard, but
sufficiently compatible, version of override/final,
but no decltype(). A later patch will use MSVC
'override/'sealed' to implement Q_DECL_{OVERRIDE,FINAL}
for these compilers, but I currently don't see a
version of HasIsNullMethod that could support these
two, so the split off of Q_DECL_FINAL_CLASS is in
anticipation of that commit. If someone _does_ find
an implementation of HasIsNullMethod that works on
MSVC2005 and 2008 sealed classes, then it's a simple
matter of s/Q_DECL_FINAL_CLASS/Q_DECL_FINAL/g.

This code has been tested on GCC 4.7 (prerelease)
and GCC 4.8 (prerelease).

Change-Id: I8700c8307d79a74d45fef0aec1c6027b4a922a43
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoQDialog - Change exec() and open() to virtual functions
Thorbjørn Lund Martsum [Wed, 7 Mar 2012 15:02:47 +0000 (16:02 +0100)]
QDialog - Change exec() and open() to virtual functions

QDialog is meant for inheritance (it contains other virtual
functions) ...

The main reason for this is that we inside the dialog
could have a (datadepened) precondition that should
prevent the dialog from being shown at all - instead we
might just want to show a messagebox.

That is not easy solvable in Qt right now. It is possible
to reimplement setVisible - but calling reject from
setVisible does not work. There seems only to be clumsy
solutions to that problem - unless these functions are
made virtual

Beside it also creates a nice symmetry to done.

Change-Id: I51c29e1f7a4a5522f5c0f71bcf98c943580790b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
12 years agoMerge remote-tracking branch 'origin/containers' into api_changes
João Abecasis [Thu, 8 Mar 2012 13:58:00 +0000 (14:58 +0100)]
Merge remote-tracking branch 'origin/containers' into api_changes

Change-Id: Ib8427caca38a14c040850bf45346f3213ffd04b3

12 years agoSkip test when implicit move operators not available
João Abecasis [Thu, 8 Mar 2012 10:48:26 +0000 (11:48 +0100)]
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>
12 years agoMerge remote-tracking branch 'origin/api_changes' into containters
João Abecasis [Thu, 8 Mar 2012 11:01:25 +0000 (12:01 +0100)]
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

12 years agoQtPrintSupport: make some constructors explicit
Marc Mutz [Tue, 6 Mar 2012 21:44:55 +0000 (22:44 +0100)]
QtPrintSupport: make some constructors explicit

This is a semi-automatic search, so I'm
reasonably sure that all the exported ones
have been caught.

Change-Id: Ic65f21e06fb2c5d851390cd025c2a48db51f5930
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoMerge remote-tracking branch 'origin/master' into api_changes
João Abecasis [Thu, 8 Mar 2012 00:27:27 +0000 (01:27 +0100)]
Merge remote-tracking branch 'origin/master' into api_changes

Change-Id: I89dc2e193bd01624c1fb50484610d516e39b1538

12 years agomove postProcessProject() call to sane location
Oswald Buddenhagen [Wed, 7 Mar 2012 12:31:04 +0000 (13:31 +0100)]
move postProcessProject() call to sane location

there is totally no reason to call it unless the project is actually
used for makefile generation, and the excessive calls actually mess up
things.

Change-Id: Idb7912a5404f6054010d2f29cce820a167de4f6f
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
12 years agoQCursor: Associate cursor with screen.
Friedemann Kleint [Mon, 5 Mar 2012 13:42:42 +0000 (14:42 +0100)]
QCursor: Associate cursor with screen.

- Introduce cursor() accessor to QPlatformScreen.
- Remove screen member of QPlatformCursor (a
  cursor can be shared by multiple screens
  of a virtual desktop).
- Add QCursor::pos()/ QCursor::setPos() taking
  a QScreen-parameter, use primaryScreen() for
  old overloads.  QCursor::pos() can then query
  the platform cursor for the position and return
  the position even if the mouse position is outside
  the windows owned by the Qt application.
- Fix tests

Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Task-number: QTBUG-22457
Task-number: QTBUG-22565
Task-number: QTBUG-20753
Change-Id: Ia69f37343f95772e934eab1cd806bd54cbdbbe51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoQtXml: make some constructors explicit
Marc Mutz [Tue, 6 Mar 2012 21:45:38 +0000 (22:45 +0100)]
QtXml: make some constructors explicit

This is a semi-automatic search, so I'm
reasonably sure that all the exported ones
have been caught.

Change-Id: Ibb889038a583f419399cd044908d481413b2c48f
Reviewed-by: Richard J. Moore <rich@kde.org>
12 years agoFix dockwidgets behavior when window resized or central widgets is set.
Debao Zhang [Thu, 22 Dec 2011 16:27:32 +0000 (00:27 +0800)]
Fix dockwidgets behavior when window resized or central widgets is set.

When adding and showing a central widget in a QMainWindow then the
layout does not respect the size policy of the central widget.

This is a side effect of 059be19781a22d2e41f22072152589857d0fabf9

After the layout of QMainWindow is restored or the separator between central
widget and dock widgets is moved by user, dock widgets should keep their
size when the window if resized.

Task-number: QTBUG-15689
Change-Id: Idfccb7b4ae057a99f431c2ed54e3b9fcfb6ef54c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoQRegularExpression: add optimizations autotest
Giuseppe D'Angelo [Wed, 22 Feb 2012 03:33:00 +0000 (03:33 +0000)]
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>
12 years agoRemove references to missing tests
Girish Ramakrishnan [Wed, 7 Mar 2012 02:51:41 +0000 (18:51 -0800)]
Remove references to missing tests

17ddce4692b31af4374b28cd40b9f25e8ed629cd removed the endian test.
90a5492fb01ec3bc10c18c5a0acd38d6ed845a6d removed the ipv6 test.

largefile and nix are long dead.

Change-Id: If8e5d4f0546e30778b82ee99f662cb9ed3aefacb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agoFixing iconv test to match new mkspec name
Rafael Roquetto [Wed, 7 Mar 2012 08:10:10 +0000 (09:10 +0100)]
Fixing iconv test to match new mkspec name

Fixed iconv.pro file to follow the qnx mkspec renaming from blackberry- to
qnx-

Change-Id: I91e0e2495d0ec70c6ffec3e3e83eb8712805b3aa
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoQWidget: fix wrong mouse behavior
Debao Zhang [Wed, 7 Mar 2012 00:44:52 +0000 (16:44 -0800)]
QWidget: fix wrong mouse behavior

Widgets will receive extra mouse press events when double clicked. This
is a side effect of change Id Ief6af12c666b23e544da4a68cb835cd577265469
which has partially fixed the folowing bug.

Task-number:QTBUG-24649
Change-Id: I030ac6ba641050d40ac8989720a1c261ab15f849
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoFix sending simulated keyboard events to popup widgets
Miikka Heikkinen [Tue, 6 Mar 2012 11:58:31 +0000 (13:58 +0200)]
Fix sending simulated keyboard events to popup widgets

Popup widgets steal the keyboard grab stealthily without it being
visible via QWidget::keyboardGrabber(). To more accurately simulate a
real keyboard event, prioritize sending simulated keyboard events to
the active popup widget over QGuiApplication::focusWindow().

Task-number: QTBUG-24326
Change-Id: Id7a75c613d934e24657b521f1684ce7cce92556a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoWindows: Fix override cursor logic
Miikka Heikkinen [Wed, 7 Mar 2012 11:31:30 +0000 (13:31 +0200)]
Windows: Fix override cursor logic

Fixed a logic error that prevented override cursors being applied in
Windows plugin. The logic for override cursor handling is already
in crossplatform code, so no need to do extra checks in plugin.

Task-number: QTBUG-24657
Change-Id: Ied9b36b57f22607ef5bb5c30f2926b0053eebca5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoCocoa: Implement Drag-and-Drop.
Friedemann Kleint [Wed, 7 Mar 2012 13:46:04 +0000 (14:46 +0100)]
Cocoa: Implement Drag-and-Drop.

Implement drag and drop support for drags originating
from outside Qt. Port mime and pasteboard code from
Qt 4. Use QSimpleDrag from from platform support to
implement internal Qt drags.

Change-Id: I5b664a95ebb00f48de2bd21c24dfb579af16123e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoAdd QUrl formatting option "PreferLocalFile".
David Faure [Fri, 2 Mar 2012 14:41:51 +0000 (15:41 +0100)]
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>
12 years agoExample build fix.
Jędrzej Nowacki [Tue, 6 Mar 2012 15:41:47 +0000 (16:41 +0100)]
Example build fix.

buttontester.pro has to be renamed to mousebuttons.pro because it lives
in mousebuttons subdirectory, to which examples/widgets/widgets.pro is
pointing by SUBDIRS variable.

Change-Id: I04bbd85713321337fbe8cbccfa6284f12b677279
Reviewed-by: Rick Stockton <rickstockton@reno-computerhelp.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
12 years agoFix deadlock in QPropertyAnimation
Olivier Goffart [Wed, 7 Mar 2012 11:24:30 +0000 (12:24 +0100)]
Fix deadlock in QPropertyAnimation

Commit 1e6514a714c1f55b9cb57d2b8b65bc2305c2e2c6 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>
12 years agoAdd fonts to QPlatformTheme.
Friedemann Kleint [Wed, 7 Mar 2012 07:56:41 +0000 (08:56 +0100)]
Add fonts to QPlatformTheme.

- Remove QPlatformFontDatabase::defaultFonts() returning
  a hash containing widget name ->font and the Windows
  implementation.
- Add enumeration and font accessor to QPlatformTheme. The value
  returned for the enumeration value overwrites the default font
  of the font database.
- Implement for Windows, Mac and KDE.
- Add more Windows palettes.

Task-number: QTBUG-23686

Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
12 years agoAdd nicer error message in qMetaTypeId function.
Jędrzej Nowacki [Tue, 6 Mar 2012 14:12:06 +0000 (15:12 +0100)]
Add nicer error message in qMetaTypeId function.

The function can be used only with a registered type and it would fail
to compile for other types. By adding the static assert we can print
an almost user friendly compilation error message.

Change-Id: I59ab148cabf32afe0baef186b82cb03303b57780
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoitemview/itemmodels: make some constructors explicit
Marc Mutz [Tue, 6 Mar 2012 21:06:30 +0000 (22:06 +0100)]
itemview/itemmodels: make some constructors explicit

This is a semi-automatic search, so I'm
reasonably sure that all the exported ones
have been caught.

Change-Id: I38d7978f1fcf7513e802ed0042aa7a57a95b0060
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
12 years agoMake QCursor manual tests compile on Qt5
Miikka Heikkinen [Wed, 7 Mar 2012 08:33:16 +0000 (10:33 +0200)]
Make QCursor manual tests compile on Qt5

These tests were not aware widgets had been split to different lib.

Change-Id: I58bde1304c876319a3cbb50f4d6a66e9f24b2886
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoFix support for scripts that require OpenType
Eskil Abrahamsen Blomfeldt [Wed, 7 Mar 2012 08:49:20 +0000 (09:49 +0100)]
Fix support for scripts that require OpenType

We need to load OpenType tables when initializing fonts for
scripts that require them. This fixes support for many Brahmic
scripts.

Change-Id: Ib5e50f2c7e5edb4b3e3ecf9fd004f2cf62634add
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoRemove abuse of QMetaTypeId from tst_qshortcut test.
Jędrzej Nowacki [Tue, 6 Mar 2012 14:06:33 +0000 (15:06 +0100)]
Remove abuse of QMetaTypeId from tst_qshortcut test.

Q_DECLARE_METATYPE macro is much better for a custom type registration
then a handwritten template specialization.

Change-Id: Ia15688d89f708fbff0c1da93e08052d31f3b3fc0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoQSqlTableModel::selectRow(): complete documentation
Mark Brand [Tue, 6 Mar 2012 23:24:08 +0000 (00:24 +0100)]
QSqlTableModel::selectRow(): complete documentation

Mention in changes and document Qt version (merci à dfaure).
Follow-up to 291e2c7d5416af4d16dc0a6e60df7980ba745a3d.

Change-Id: Ie5626e9cd268812c1173ca494ccd8d6bd9be2687
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
12 years agoImprove type detection for query results
Andy Shaw [Fri, 2 Mar 2012 09:46:57 +0000 (10:46 +0100)]
Improve type detection for query results

When an aggregate function is used for a column in a SQL resultset then
it should ensure that the right data type is reported for that column.
This also concerns expressions when the returned column does not map
directly to a table column.

Test included for this.

Task-number: QTBUG-22038
Change-Id: I07487694c0ed393d46af06e232914fe923356a99
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
12 years agoRefactor headersclean for usage from modules other than qtbase
Rohan McGovern [Thu, 1 Mar 2012 04:37:50 +0000 (14:37 +1000)]
Refactor headersclean for usage from modules other than qtbase

headersclean enforces various rules which all Qt headers are supposed to
abide by.  It fails compilation if these rules are broken.

These rules should be followed also by modules hosted outside of
qtbase.  Split the test up so that it can be easily reused by other
modules.

Change-Id: Icf09cbfde411c926ed87914dc821e6dfc569b0de
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoCompile with -qtnamespace
Sarah Smith [Tue, 6 Mar 2012 01:51:22 +0000 (11:51 +1000)]
Compile with -qtnamespace

Mac has to work with -qtnamespace as well, and other files have gotten
this right, so follow their example.

Change-Id: I551e1843e8a0e82a82d1d5ea8c8cd5f20e6880fa
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoQRegularExpression: fix optimizePattern, document the issue
Giuseppe D'Angelo [Thu, 16 Feb 2012 22:49:27 +0000 (23:49 +0100)]
QRegularExpression: fix optimizePattern, document the issue

The studyData pointer is atomically set by the pointer assignment,
but another processor running a different thread might see the
new studyData value but not the memory it points to.

Therefore, the current studyData is returned from optimizePattern
and used by that thread.

Docs were added to optimizePattern to explain what's going on.

Change-Id: I4502c336077bb98a1751011aa93ffd4f585ed101
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoRenaming QNX mkspecs
Rafael Roquetto [Tue, 6 Mar 2012 14:21:19 +0000 (15:21 +0100)]
Renaming QNX mkspecs

Renamed from blackberry-* to qnx-* in order to match he <platform>-<compiler>
pattern.

Change-Id: I378151f3d564dd280943c74865a1d2b97215b656
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agoAdd benchmark for QMetaType::create().
Jędrzej Nowacki [Tue, 6 Mar 2012 11:04:37 +0000 (12:04 +0100)]
Add benchmark for QMetaType::create().

A case of a custom type creation was not covered before.

Change-Id: Icd2a7d63633f8e40d9d4a8a26e0eb0896fc85ec8
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
12 years agoQuery udev build parameters from pkg-config
Donald Carr [Fri, 2 Mar 2012 04:58:33 +0000 (04:58 +0000)]
Query udev build parameters from pkg-config

Change-Id: Ia3b7329d7359684ee7bf572a7e5fb681105108f4
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Holger Freyther <holger+qt@freyther.de>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agoFix double click handling.
Laszlo Agocs [Tue, 6 Mar 2012 14:09:09 +0000 (16:09 +0200)]
Fix double click handling.

Until now double clicking in Qt 5 resulted in the following sequence of mouse
events: pressed, released, double clicked, released. This is wrong, the press
belonging to the second button down is missing. In Qt 4 that pressed event is
present.

The problem is not apparent in desktop environments because the double click is
functioning properly even when the second pressed is missing. However when
using a platform plug-in like wayland, where the clients receive only press,
move and release events, double click was broken because the second click was
effectively ignored (due to receiving nothing but a button release).

Change-Id: Ief6af12c666b23e544da4a68cb835cd577265469
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoFix the bit test for ABS_MT_SLOT to detect protocol B
Shawn Rutledge [Tue, 6 Mar 2012 15:29:50 +0000 (16:29 +0100)]
Fix the bit test for ABS_MT_SLOT to detect protocol B

I tested, it didn't work.  This is from a previous patch I had
already gotten working before 40a5ba4d3fccb449dcfd8d9a0deaf4c7f0fe12bc
was submitted.

Change-Id: I868f069fe834b3122ed9b5b3dc9af0781d6e1d0d
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
12 years agoQRegularExpression: fix documentation due to qdoc changes
Giuseppe D'Angelo [Sat, 3 Mar 2012 12:41:13 +0000 (12:41 +0000)]
QRegularExpression: fix documentation due to qdoc changes

Removes the usage of various qdoc macros which are now deprecated.

Change-Id: I74fa70f8d2a2a1bff57cdb2bcc14a31a7198dea0
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
12 years agoFixed warnings from arm builds with -Wundef
Rohan McGovern [Tue, 6 Mar 2012 07:50:05 +0000 (17:50 +1000)]
Fixed warnings from arm builds with -Wundef

Do not use the value of a macro before verifying that the macro
is defined.

Change-Id: I36bebe37da5f4e5e7af1e423b7f2b18091e35707
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
12 years agoFix off by one in updateAccessibility.
Frederik Gladhorn [Mon, 5 Mar 2012 15:56:55 +0000 (16:56 +0100)]
Fix off by one in updateAccessibility.

Now that indexOfChild is 0-based, the update notifications should follow.

Change-Id: I5e0303516d503d5e23061df5894b2428c00da2ce
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
12 years agoFix parsing of unicode escape sequences
Lars Knoll [Tue, 6 Mar 2012 12:05:09 +0000 (13:05 +0100)]
Fix parsing of unicode escape sequences

Change-Id: I63a7cd3a571fb47c97157bcb2ca29c4239c600ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoFixed warning from gcc with -Wundef for some values of WCHAR_MAX
Rohan McGovern [Tue, 6 Mar 2012 07:55:14 +0000 (17:55 +1000)]
Fixed warning from gcc with -Wundef for some values of WCHAR_MAX

Certain versions of system headers will declare WCHAR_MAX like:

    #define __WCHAR_MAX      ( (wchar_t) - 1 )
    #define WCHAR_MAX         __WCHAR_MAX

In particular on ARM (see e.g.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598937 )

In this case, defined(WCHAR_MAX) is true, but attempting to use the
value of WCHAR_MAX in a preprocessor expression will not give the
desired results - "wchar_t" is unknown to the preprocessor, so
WCHAR_MAX silently (without -Wundef) evaluates to ( (0) - 1 ) == -1.

A simple workaround is to avoid looking at WCHAR_MAX when the
superior __SIZEOF_WCHAR_T__ is defined.

Change-Id: I439b166cffb93416737ee19025fb6e8d51c27876
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoQRegularExpression: fix autotest
Giuseppe D'Angelo [Thu, 23 Feb 2012 02:49:52 +0000 (02:49 +0000)]
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>
12 years agoSupport legacy QDataStream serialization of QDate.
Aaron McCarthy [Tue, 6 Mar 2012 01:17:07 +0000 (11:17 +1000)]
Support legacy QDataStream serialization of QDate.

Commit 8327fa7c11f6c84ccc66be4365ee282a76288788 changed the type of the
Julian day member of QDate from quint32 to qint64.  This changed the
QDataStream format.  Keep the old behavior, with the limited date
range, if the stream version is less than Qt_5_0.

Change-Id: I800448979a1891581069f39de7f9ab9c634e4f0e
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoUse #define before including SHA-2 3rdparty code
Bradley T. Hughes [Fri, 2 Mar 2012 07:07:23 +0000 (08:07 +0100)]
Use #define before including SHA-2 3rdparty code

Using typedef causes errors due to re-definition, so #define the types
needed by the SHA-2 code to the q[u]int* equivalents instead.

Change-Id: I6fc29788dd05aeee28723820f511527d482d31f2
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
12 years agoQSqlTableModel: use selectRow() for field and row edit strategies
Mark Brand [Tue, 21 Feb 2012 08:22:26 +0000 (09:22 +0100)]
QSqlTableModel: use selectRow() for field and row edit strategies

Calling select refreshes the query data but disrupts view
navigation.

For OnFieldChange and OnRecordChange it makes sense to only
select the row in question. This does not disturb view navigation.

Assume disruption of view navigation is not a problem
for OnManualSubmit because the user or application decides
when submitAll is called.

Task-number: QTBUG-2875
Change-Id: I1e5f68668fb9102f6296d67d543e80daa403f1c4
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoQSqlTableModel: long live selectRow()!
Mark Brand [Thu, 16 Feb 2012 01:38:02 +0000 (02:38 +0100)]
QSqlTableModel: long live selectRow()!

Change-Id: If26dbcc8a1e8ef1376ef7a688c946ce5270e5706
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoQSqlTableModel: handle changes between submit and select
Mark Brand [Wed, 15 Feb 2012 08:56:23 +0000 (09:56 +0100)]
QSqlTableModel: handle changes between submit and select

Once an insert has been submitted, the cached record behaves like an
update. For row bookkeeping, we still have to remember that it was
originally inserted and is not in the query rows.

Between submitting a delete and selecting, we remove the values
from the deleted record. This causes a blank row to be displayed.
Read-only flag is set for cells in deleted row.

Reverting between submit and select means going back to the last
submitted values.

When removing rows, it's better to process from highest row numbers
to lowest. This avoids complications with higher rows shifting down
when lower rows are removed.

Change-Id: I8752fa11f7a1b88f2a71b9e03a020ac37e62487f
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
12 years agoQRegularExpression: const correctness fixes
Giuseppe D'Angelo [Sun, 19 Feb 2012 22:58:04 +0000 (23:58 +0100)]
QRegularExpression: const correctness fixes

Adding some const qualifiers to members which are never written.

Change-Id: Ibb8953764c7b7790a419a5d48f2956751d5fc1f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoQRegularExpression: add captureCount()
Giuseppe D'Angelo [Sun, 19 Feb 2012 22:56:50 +0000 (23:56 +0100)]
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>
12 years agoQRegularExpression: do not use JIT in debug builds
Giuseppe D'Angelo [Wed, 8 Feb 2012 19:28:14 +0000 (19:28 +0000)]
QRegularExpression: do not use JIT in debug builds

PCRE's JIT uses self-modifying code extensively, requiring full SMC
checks enabled by tools like valgrind, which slow down the execution
considerably; not enabling SMC checks lead to crashes.

Therefore, JIT is now disabled by default in debug builds of Qt.
Its usage (both in debug and release builds) can be controlled
by setting the QT_ENABLE_REGEXP_JIT environment variable.

Change-Id: Ib38952400e4219582942ce65ab9edcd89c432f3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoQRegularExpression: improve operator==, add dedicated autotest
Giuseppe D'Angelo [Wed, 8 Feb 2012 18:53:22 +0000 (18:53 +0000)]
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>
12 years agoQRegularExpression: QDebug support for pattern options
Giuseppe D'Angelo [Tue, 7 Feb 2012 23:56:40 +0000 (23:56 +0000)]
QRegularExpression: QDebug support for pattern options

Added the proper QDebug operator to debug the
QRegularExpression::PatternOptions flags.

Change-Id: Icd00e93a0c6cc4345db528d494fc176624f7b7a2
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoQRegularExpression: add QRegularExpression* set of classes
Giuseppe D'Angelo [Mon, 23 Jan 2012 22:47:59 +0000 (22:47 +0000)]
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>
12 years agodon't add bogus /mkspecs to QMAKE_MKSPECS
Oswald Buddenhagen [Fri, 2 Mar 2012 16:27:33 +0000 (17:27 +0100)]
don't add bogus /mkspecs to QMAKE_MKSPECS

the project build root can of course be empty - if there is neither an
mkspecs/ nor a .qmake.cache - or no project in the first place (-query).

Change-Id: I9595b0b4ad80a9086dcd48c9ae62b3e8bd1b6f2f
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
12 years agofix relative default examples path
Oswald Buddenhagen [Mon, 5 Mar 2012 20:03:09 +0000 (21:03 +0100)]
fix relative default examples path

copy&pasto ...

Change-Id: I73ab90f31f2a2250abe1ec9aeea975122ff319cb
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
12 years agoAdd test for QUrl::isLocalFile (there weren't any).
David Faure [Fri, 2 Mar 2012 14:46:39 +0000 (15:46 +0100)]
Add test for QUrl::isLocalFile (there weren't any).

Change-Id: I839d2eee7b0651700516d6140635151a52a9fa40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoQTouchEvent::TouchPoint: make it a proper value class
Marc Mutz [Thu, 1 Mar 2012 07:47:20 +0000 (08:47 +0100)]
QTouchEvent::TouchPoint: make it a proper value class

This includes:
- Marking it as Q_MOVABLE_TYPE
- adding move ctor and move assignment operator
- add member-swap
- use the copy-swap idiom in the copy-assignment operator

This required making the destructor safe for d == nullptr.

Change-Id: I8a77ffcb8e4a395a7e103d1df610561b6ae4c001
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoFix tst_QNetworkReply::httpWithNoCredentialUsage autotest
Shane Kearns [Mon, 5 Mar 2012 16:54:12 +0000 (16:54 +0000)]
Fix tst_QNetworkReply::httpWithNoCredentialUsage autotest

The test was testing the wrong thing, and passing even though
QNetworkRequest::AuthenticationReuseAttribute was not being
respected, until recently when I fixed username/password in URLs

Now the cache is properly bypassed when this attribute is set to
manual, and the autotest is updated to check this.

Change-Id: I87943515562d0b16b03504f0758ba265758d1c22
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
12 years agoFix QNetworkReply ioGetFromHttpWithCache test case
Shane Kearns [Mon, 5 Mar 2012 14:09:04 +0000 (14:09 +0000)]
Fix QNetworkReply ioGetFromHttpWithCache test case

Expiration date is calculated from max-age header when a response is
inserted into the cache. Because the test case is prepopulating the
cache outside of QNAM's control, the expiration date was uninitialised,
causing the test to fail.

This is due to a 2 year old change in QNAM, where max age calculation was
removed from cache retrieval, and more recent changes to QDateTime
where secsTo() returns 0 if one of the arguments is invalid.

Change-Id: Ieecd46123dde4ca0fd0be3ae79e70e1528ec02bc
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
12 years agoWindows - fix QWindowsSystemProxy global static race
Shane Kearns [Wed, 22 Feb 2012 21:23:48 +0000 (21:23 +0000)]
Windows - fix QWindowsSystemProxy global static race

Loser of the race would try to delete an uninitialised pointer

Task-number: QTBUG-15765
Change-Id: Ie184ee2306e102aa8fbad752ef09b95c3ede00c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoFix finding specs in the unsupported/ directory.
Thomas McGuire [Tue, 6 Mar 2012 12:13:09 +0000 (13:13 +0100)]
Fix finding specs in the unsupported/ directory.

The -spec argument was interpreted as a relative directory as
soon as it contained a slash. Fix this by checking if the
directory exists before attempting to interpret it.

Change-Id: Ide8f0418abc719b0be582d2d72642a141f6c6dea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agoQProcess/Win: pointless Sleep call removed
Joerg Bornemann [Tue, 6 Mar 2012 09:18:14 +0000 (10:18 +0100)]
QProcess/Win: pointless Sleep call removed

Change-Id: I634c62d3a0f96bc074e815dfd4106b6187f4ba85
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agotransitively resolve module dependencies
Oswald Buddenhagen [Fri, 24 Feb 2012 18:18:02 +0000 (19:18 +0100)]
transitively resolve module dependencies

otherwise we need the nasty hack for includes, and CONFIGs and DEFINES
from dependencies are not included at all.

Change-Id: I7eaee761161a6e8fbac8e9237d26559aa11a88a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
12 years agoDon't use QMutexPool in QEventDispatcher
Olivier Goffart [Fri, 2 Mar 2012 14:39:50 +0000 (15:39 +0100)]
Don't use QMutexPool in QEventDispatcher

Use a QBasicMutex, there is no extra cost of having a mutex for this.

Change-Id: Ib5b01338649002c0c21f018b2c931a8cc68027f6
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
12 years agoDon't use QMutexPool from the animation framework
Olivier Goffart [Fri, 2 Mar 2012 15:18:52 +0000 (16:18 +0100)]
Don't use QMutexPool from the animation framework

Use a plain QBasicMutex instead

Change-Id: I1abd35b4fe4e9f0401e73c7c3f503b00bba2baa9
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
12 years agoCleanup QThread::initialize and QThread::cleanup
Olivier Goffart [Fri, 2 Mar 2012 14:56:19 +0000 (15:56 +0100)]
Cleanup QThread::initialize and QThread::cleanup

The qt_global_mutexpool was private API deprecated long time ago.

And there is no reason to call qt_create_tls because it is called in
QThreadData::current that is called from the QObject constructor, even
before QCoreApplication::init can be called.

Change-Id: Idf3576d8591377811b727b12edc43dc898570ba4
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
12 years agoMerge an overloaded QKeySequence constructor.
Stephen Kelly [Tue, 6 Mar 2012 00:24:19 +0000 (01:24 +0100)]
Merge an overloaded QKeySequence constructor.

Change-Id: I14dc9234b9a4822f65338b75482cab05a017dc69
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoAdd template specialization of QMetaType for QObject derived pointers.
Stephen Kelly [Fri, 2 Mar 2012 13:48:09 +0000 (14:48 +0100)]
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>
12 years agoQStateMachine: make ctor explicit
Marc Mutz [Thu, 1 Mar 2012 07:42:54 +0000 (08:42 +0100)]
QStateMachine: make ctor explicit

Change-Id: I727129b52daeb0d54685d530f034d41896d1da0f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
12 years agoMake cache of opentype tables in Harfbuzz face lazy
Eskil Abrahamsen Blomfeldt [Fri, 2 Mar 2012 15:20:55 +0000 (16:20 +0100)]
Make cache of opentype tables in Harfbuzz face lazy

The mechanism in fontconfig which determines if a certain character
is available (FcCharSetHasChar()) may give false positives, in which
case we would load and unload those fonts per every char for which
FC gave us a false positive. This was a major performance regression.
Specifically the false positives happened when looking at e.g.
italic variants of certain multilingual fonts, since we only check
the charset of the font family as a whole and not of the specific variant,
which may only support a subset of the chars.

To optimize this, we remove the deletion of the font engines after
loading them, but also wait with loading the opentype tables until
they are actually needed. This means that for the false positives,
we will load the font, but the cached data for each unused font will
be much smaller.

Change-Id: Idfc794401a2080da5946bf65204eb947aeb635ed
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoImprove safeness of QMetaType::registerType.
Jędrzej Nowacki [Mon, 5 Mar 2012 14:40:03 +0000 (15:40 +0100)]
Improve safeness of QMetaType::registerType.

This internal function is abused by some modules to create dynamic
types in metatype system. In Qt5 more non-optional arguments were added
to the function and to keep temporary source compatibility an overload
was created.

QMetaType code assumes that every known type has properly defined basic
operations like creation and destruction. Setting a helper function
pointer to null value is asking for a crash, because the code doesn't
check for that value, the null pointer may be called.

Change-Id: I5ca7454a70c308e01de26fab23481b3c94c22371
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
12 years agoCocoa: Implement widget palettes.
Morten Johan Sorvig [Fri, 24 Feb 2012 08:17:00 +0000 (09:17 +0100)]
Cocoa: Implement widget palettes.

Add roles to QPLatformTheme::Palette, map QWidget
subclasses to those. Port Qt4 widget palette creation
code to use the QPLatformTheme::Palette roles.

Palette entries are disabled in this commit, this
will be fixed later.

Change-Id: I07babe3d7c76d306efc4ea4813c7161fdf36227f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoescape *_script_file usages in MingwMakefileGenerator::writeObjectsPart
Max Desyatov [Fri, 2 Mar 2012 11:33:17 +0000 (13:33 +0200)]
escape *_script_file usages in MingwMakefileGenerator::writeObjectsPart

Task-number: QTBUG-24595
Change-Id: I1e78a6015247b9e41ae2b05b50fdedf0613f00f1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agode-duplicate feature and mkspec root candidate lists
Oswald Buddenhagen [Fri, 24 Feb 2012 16:53:30 +0000 (17:53 +0100)]
de-duplicate feature and mkspec root candidate lists

Change-Id: I03f5b5903a133e5386b9ebef640ddbacdf3ebcd4
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
12 years agoQSslCertificate - make lazy initialisation thread safe
Shane Kearns [Wed, 29 Feb 2012 15:53:24 +0000 (15:53 +0000)]
QSslCertificate - make lazy initialisation thread safe

QSslCertificate can be copied around into multiple threads,
without detaching. For example, the https worker threads inside
QNetworkAccessManager.
There are const methods, which lazily initialise members of
the private class without detaching (i.e. caching results of
expensive function calls)
These functions now lock the d pointer using QMutexPool to
avoid concurrency related crashes.

autotest crashes 20% of the time in release builds without
the fix, passes 100 times in a row with the fix.

Task-number: QTBUG-20452
Change-Id: I64a01af8159216f2dd6215a08669890f6c029ca8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
12 years agoQMimeDatabase: Fix crash on empty filename
David Faure [Fri, 2 Mar 2012 19:33:55 +0000 (20:33 +0100)]
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>
12 years agoSplit up base class QFileDevice for open-file operations (read/write)
David Faure [Sun, 26 Feb 2012 09:05:39 +0000 (10:05 +0100)]
Split up base class QFileDevice for open-file operations (read/write)

This will be used later on as a base class for QTemporaryFile and
QSaveFile.

Change-Id: Ic2e1d232f95dc29b8e2f75e24a881ab459d3f037
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoqpa: Document a requirement of the backing store implementation
Holger Hans Peter Freyther [Mon, 20 Feb 2012 09:30:07 +0000 (10:30 +0100)]
qpa: Document a requirement of the backing store implementation

Docuent the requirement that the alpha channels need to be properly
initialized by the implementation.

Change-Id: I03db81b44b43ea75feb1b983fb0725c65a3bd9f4
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoadd widget mousebuttons example 'mousetester'.
Rick Stockton [Tue, 7 Feb 2012 01:20:08 +0000 (17:20 -0800)]
add widget mousebuttons example 'mousetester'.

This is an xev-like program. A user clicks a mouse button inside the
Window, and the program displays (a) the "raw" button number; (b)
the corresponding Qt::MouseButton name; and (c) the type of mouse Event.

Task-number: QTBUG-24112
Change-Id: I8a76ff37b5b85639f662706072cc4a2ce490754b
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
12 years agoQWindow: fix crash on Mac
Tasuku Suzuki [Thu, 1 Mar 2012 23:53:03 +0000 (08:53 +0900)]
QWindow: fix crash on Mac

Fixes a crash when QWindow::baseSize() is invalid size.

Change-Id: I4e41f63d69ad0f218bfd35db8f30f18f92d4e9d5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
12 years agoAdd missing Q_OBJECT macro to QCoreTextFontEngine
Tasuku Suzuki [Mon, 5 Mar 2012 08:48:22 +0000 (17:48 +0900)]
Add missing Q_OBJECT macro to QCoreTextFontEngine

Change-Id: I5d6b4742265a026d404d5ffa48f2c554d5483f30
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
12 years agoRemove codecForTr().
Robin Burchell [Tue, 31 Jan 2012 22:33:30 +0000 (00:33 +0200)]
Remove codecForTr().

Similarly to change id I2f429fa7ef93bd75bb93a7f64c56db15b7283388, the capability
to arbitrarily alter the encoding of literals is very destructive, especially in
a world with libraries and plugins.

Change-Id: If0d4cd8dcf89792e39c1984cbde6b036cebfc02f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agodo not re-evaluate spec+cache in build passes
Oswald Buddenhagen [Mon, 30 Jan 2012 14:47:45 +0000 (15:47 +0100)]
do not re-evaluate spec+cache in build passes

clean up the somewhat convoluted code paths which forced re-evaluation.
now that the spec+cache are evaluated in a completely clean context
anyway, there is no point in re-evaluating them for build passes.

Change-Id: I12279083238e9ca7028af97f45e2638c8dc715b8
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
12 years agomake QMakeProject's copy c'tor actually behave like one
Oswald Buddenhagen [Fri, 3 Feb 2012 17:34:56 +0000 (18:34 +0100)]
make QMakeProject's copy c'tor actually behave like one

instead of initializing base_vars with the original's vars, initialize
vars itself. this has two consequences:
- there is no need to call read(0) to initialize vars
- one cannot usefully call the complex read() anymore, as that would
  re-initialize vars from base_vars

this is much closer to an actual copy than the previous "seeding with
existing project".

Change-Id: Ib007bc5b779aedb680a27329aa578f7c604a4308
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
12 years agoQNam: only init channels when needed.
Martin Petersson [Thu, 1 Mar 2012 09:36:38 +0000 (10:36 +0100)]
QNam: only init channels when needed.

Each channel will create a socket that will allocate memory for the
read and write buffers. QNam generaly inits 6 sockets for each
connection. That means that by default 12 such buffers are created.
This will instead initialize channels when they are needed.

Change-Id: Ie3f2cf789e084fd3d17d3b2a9bb3d3a4370b3da4
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
12 years agoSupport new-style plugins without a "Keys" json property
Alex Wilson [Mon, 5 Mar 2012 08:16:58 +0000 (18:16 +1000)]
Support new-style plugins without a "Keys" json property

As per discussion with Lars, intent here was to allow plugins without
a "Keys" property to still function correctly, but this particular
if statement was blocking any such plugins from being detected.

Change-Id: Icb343ca8bd95a508d62565cd816fe2a57a4f82bd
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoMark QMetaType constructor as explicit.
Jędrzej Nowacki [Mon, 5 Mar 2012 14:27:40 +0000 (15:27 +0100)]
Mark QMetaType constructor as explicit.

Implicit conversion from an int would look strange in this case.

Change-Id: I2222a045c293595d7b83a2fb75ca646f5cf79bca
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
12 years agoRemove unused QThreadPoolPrivate::startFrontRunnable().
Robin Burchell [Mon, 5 Mar 2012 21:11:05 +0000 (22:11 +0100)]
Remove unused QThreadPoolPrivate::startFrontRunnable().

Change-Id: Ie079aea3412a53cf9dccaa770fa64ff5b6b7b3b1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
12 years agoQSqlTableModel::data(): use cached values when available
Mark Brand [Wed, 15 Feb 2012 01:07:59 +0000 (02:07 +0100)]
QSqlTableModel::data(): use cached values when available

Simplify logic. If the record is in the cache, even untouched
values should be there. This is also necessary for getting
the most up-to-date values between submitting and the next
select.

Change-Id: I8578d96229797ce9fb0d07fe456301358f2be071
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
12 years agoadd strategy support to sqlbrowser example
Mark Brand [Wed, 15 Feb 2012 10:23:54 +0000 (11:23 +0100)]
add strategy support to sqlbrowser example

Several useful options added to context menu.

Also added yellow background for unsubmitted
changes.

Change-Id: I132cd4498a5fb7275ea10c0497910aba99c06a2b
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoQSqlTableModel: derive primary values from database values
Mark Brand [Tue, 14 Feb 2012 22:45:44 +0000 (23:45 +0100)]
QSqlTableModel: derive primary values from database values

Primary values are used to map a row in the model to a row in the
database table. It is critically important between submitting a
change and the following select (which refreshes the query) to have
updated primary values. Otherwise, if the change affected the primary
values, additional changes before select will misbehave.

Change-Id: I5d08dd70ac5d3f06cd9d3186a439f4c80a037c2d
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoQSqlTableModel: mirror database values in change cache
Mark Brand [Tue, 14 Feb 2012 21:50:40 +0000 (22:50 +0100)]
QSqlTableModel: mirror database values in change cache

Between submitting and the next select, these values will be more
up-to-date than those that could be obtained from the query.

This will be useful for constructing primary values and reverting
changes made after submitting.

Change-Id: I8317617f3e7043ad0b79b333731c55fb88aef171
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
12 years agoQSqlTableModel: remove unnecessary parameter from setSubmitted()
Mark Brand [Tue, 14 Feb 2012 15:51:20 +0000 (16:51 +0100)]
QSqlTableModel: remove unnecessary parameter from setSubmitted()

Change-Id: I6d23788163ffd6ba7a8f01ed40910d861ff92703
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
12 years agoWorked around Metacity crashes in xcb plugin.
Samuel Rødal [Mon, 5 Mar 2012 10:04:48 +0000 (11:04 +0100)]
Worked around Metacity crashes in xcb plugin.

Setting the user time before mapping the window seems to prevent the
crasher from happening. We used to set the user time before mapping in
Qt 4.8 too, so it's probably the right thing to do.

Task-number: QTBUG-24462
Change-Id: Ia670b799bd1ed7a7e6399631d5242e57324918b3
Reviewed-by: Jan Arne Petersen <jpetersen@openismus.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoStabilize tst_QCalendarWidget::buttonClickCheck
Rohan McGovern [Tue, 6 Mar 2012 00:03:35 +0000 (10:03 +1000)]
Stabilize tst_QCalendarWidget::buttonClickCheck

The window should be shown and activated before sending user input.

Task-number: QTBUG-23615
Change-Id: I2fc1738d9dc4ee7f03c81b040eed6389910a9d3c
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
12 years agoStabilize tst_QShortcut
Rohan McGovern [Mon, 5 Mar 2012 23:54:55 +0000 (09:54 +1000)]
Stabilize tst_QShortcut

show() on a window is asynchronous.  Wait for it to complete before
continuing with the test.

Note the test already contained code for this, but it was inside of
a Q_WS_X11 block, making it dead code in Qt 5.

Change-Id: I06f892eea86278c56b1773a7e968bbe065f86260
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
12 years agoStabilize tst_QAccessibility::actionTest
Rohan McGovern [Mon, 5 Mar 2012 23:48:59 +0000 (09:48 +1000)]
Stabilize tst_QAccessibility::actionTest

show() on a window is asynchronous.  Wait for it to complete before
continuing with the test.

Change-Id: Icd0daa0c0e8f287171c57708bb2fce0b6cf0906a
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>