Commit Graph

6119 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
9a77171ccc QHash security fix (1.5/2): qHash two arguments overload support
Algorithmic complexity attacks against hash tables have been known
since 2003 (cf. [1, 2]), and they have been left unpatched for years
until the 2011 attacks [3] against many libraries /
(reference) implementations of programming languages.

This patch adds a qHash overload taking two arguments: the value to
be hashed, and a uint to be used as a seed for the hash function
itself (support the global QHash seed was added in a previous patch).
The seed itself is not used just yet; instead, 0 is passed.

Compatibility with the one-argument qHash(T) implementation is kept
through a catch-all template.

[1] http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003.pdf
[2] http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks
[3] http://www.ocert.org/advisories/ocert-2011-003.html

Task-number: QTBUG-23529
Change-Id: I1d0a84899476d134db455418c8043a349a7e5317
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-04 13:02:58 +02:00
Kevin Krammer
7de94904f1 Re-enable PPS based rotation handling for blackberry devices
BPS based event handling not there yet, so make use of the non-blackberry QNX
facility until it is.

Change-Id: I95cdbfbe36cd23e71710c8cad0b292a5a375c214
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-04 12:01:04 +02:00
Bradley T. Hughes
f7674d8122 printing: Make sure window modality works with native print dialogs
Make the native QPrintDialogs and QPageSetupDialogs participate in the
Qt modality system. Even though we are overriding QDialog::setVisible()
and exec() to show the native dialgos, we want to still call into
QDialog::setVisible() so that modality state and events are properly
handled. We do this by setting the WA_DontShowOnScreen attribute on
QPrintDialog and QPageSetupDialog, and call QDialog::setVisible() at the
appropriate places.

Change-Id: I7d800790c40ba1f467c3315e29abb79a7fa0eb34
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-04 11:56:57 +02:00
Rafael Roquetto
3867641d78 Moved 'qnx' CONFIG definition to common location.
Removed the duplicated 'qnx' CONFIG defition from the mkspecs and declared it
on the common qcc-base-qnx.conf configuration file.

Change-Id: Ie215e3dd794762f20bec9c19afd5936a78a9d963
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-04-04 11:19:01 +02:00
Samuel Rødal
73496630fe Removed Qt 5 todo comments from qpalette.h
The removal won't happen in Qt 5, and there's no great value in making
NoRole have the value 0 at the potential risk of breaking existing code.

Task-number: QTBUG-25068
Change-Id: I57238f55a23e77a783ebac47b96b4a5e62480add
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-04 09:00:24 +02:00
Sean Harmer
657ca81c91 Enable stack smashing protection on QNX and Blackberry platforms
Change-Id: I2610c8e446a74ee584c5b450e1b872b7cda50813
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-04 01:03:27 +02:00
Giuseppe D'Angelo
fb20f9c2da Stop relying on QHash ordering
tst_rcc and tst_qdom rely on specific QHash orderings inside
rcc and QDom respectively (see QTBUG-25078 and QTBUG-25071).

A workaround is added to make them succeed: QDom checks for
all possible orderings, and rcc initializes the hash seed to 0
if the QT_RCC_TEST environment variable is set.

Change-Id: I5ed6b50602fceba731c797aec8dffc9cc1d6a1ce
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 23:56:10 +02:00
Pekka Vuorela
7adef58fd9 Pass autorepeat info to input context key filtering with XCB
Change-Id: Ifbb658dde6689543f48ed8fb82109ea07bcf8bd7
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-03 23:04:43 +02:00
João Abecasis
72eb9d49a9 Reorganize unicode string support in QString
Cleaned up preprocessor code to have a single definition for
QStaticStringData. A new qunicodechar typedef is introduced representing
a 2-byte integral type that can be used to represent a UTF-16 codepoint.

When QT_NO_UNICODE_LITERAL is not defined, QT_UNICODE_LITERAL converts a
US-ASCII string literal into a (native endian) UTF-16 string literal of
qunicodechar type.

Change-Id: I04822c4cdc0b240bc0fe113aba897348b7316932
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 21:10:45 +02:00
Stephen Kelly
7099c333c4 Remove the sectionAutoResize signal.
Despite being documented, it was never emitted, and I can't find
any use of it in the history either.

Change-Id: If89b401004d14ef068ada6a4099bef9dc47936c9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-03 21:10:45 +02:00
Jason McDonald
eb04862920 Remove duplicate non-const methods from QProgressBar.
Task-number: QTBUG-23524
Change-Id: I80f7eecb9f892fcd026b3c3f9159958fc99cfe23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 21:02:32 +02:00
Friedemann Kleint
3a9c06b7bd Fix warnings about signed/unsigned comparisons in QtJson.
Change-Id: I92071ea870bf0ebb740fcb360aff19658380a0cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 21:02:32 +02:00
Friedemann Kleint
fd4f165eb7 Fix warnings about unused variables.
Fix MSVC warnings about unused q, d where only static functions
are used.

Change-Id: I239d6fc3c851b0a62434cb09fc0e1967f2e6d031
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 21:02:32 +02:00
Friedemann Kleint
7108acde8a Fix warnings about truncations in constants.
Change-Id: I46872c5b2866454112092c1ec5efbfe15db5af33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 21:02:32 +02:00
Kevin Krammer
c6272b711f Fixing the QNX QPA build for non blackberry targets
Change-Id: I3d0bb33cadae946d21f8b2566840be9b1ae5101a
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 21:02:32 +02:00
Thomas McGuire
86bbb5d173 Delete the screen event handler after its last user.
Change-Id: I2e3c6d08c0dcdd4b954570e9a2198c190c8fffd2
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 21:02:32 +02:00
John Layt
ab3837f86f QLocale: Merge month name data storage to save 50KB memory
Month Names and Standalone Month Names are stored separately, but for
majority of locales the names are the same and so storage is duplicated.
By storing both sets of names in the same array 50KB is saved in
libQtCore.so on Linux.

Depends on change Ic84bbc82 in branch api_review for CLDR 1.9.1

Change-Id: I83224ebc2180ee6de69797fa50d38348acc94107
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-04-03 19:12:27 +02:00
Giuseppe D'Angelo
33984e72ab QHash security fix (1/2): add global QHash seed
Algorithmic complexity attacks against hash tables have been known
since 2003 (cf. [1, 2]), and they have been left unpatched for years
until the 2011 attacks [3] against many libraries /
(reference) implementations of programming languages.

This patch adds a global integer, to be used as a seed for the hash
function itself. The seed is randomly initialized the first time a
QHash detaches from shared_null.

Right now the seed is not used at all -- another patch will modify
qHash to make use of it.

[1] http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003.pdf
[2] http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks
[3] http://www.ocert.org/advisories/ocert-2011-003.html

Task-number: QTBUG-23529
Change-Id: I7519e4c02b9c2794d1c14079b01330eb356e9c65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 19:12:13 +02:00
Thiago Macieira
911eed0f90 Remove old comment restored by mistake
Change-Id: I1b24556110fe035c96091c5b1c5ecc00830093fc
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 19:12:09 +02:00
Bradley T. Hughes
772d748b95 QWindow: add windowModality as a Q_PROPERTY()
This also adds the QWindow::windowModalityChanged() signal.

Change-Id: I6e3bc3155d72811d173857c39d36dcb264928334
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-03 17:35:09 +02:00
Laszlo Papp
8b56b8ed32 Add a remainingTime() method to the public interface of the QTimer class
It is an extension coming from the use case when you, for instance, need to
implement a countdown timer in client codes, and manually maintain a dedicated
variable for counting down with the help of yet another Timer. There might be
other use cases as well. The returned value is meant to be in milliseconds, as
the method documentation says, since it is reasonable, and consistent with the
rest (ie. the interval accessor).

The elapsed time is already being tracked inside the event dispatcher, thus the
effort is only exposing that for all platforms supported according to the
desired timer identifier, and propagating up to the QTimer public API. It is
done by using the QTimerInfoList class in the glib and unix dispatchers, and the
WinTimeInfo struct for the windows dispatcher.

It might be a good idea to to establish a QWinTimerInfo
(qtimerinfo_win{_p.h,cpp}) in the future for resembling the interface for
windows with the glib/unix management so that it would be consistent. That would
mean abstracting out a base class (~interface) for the timer info classes.
Something like that QAbstractTimerInfo.

Test: Build test only on (Arch)Linux, Windows and Mac. I have also run the unit
tests and they passed as well.

Change-Id: Ie37b3aff909313ebc92e511e27d029abb070f110
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-03 15:10:05 +02:00
Friedemann Kleint
95d411578d WindowsXP: Fix Item view alternate color being black.
The theme palette needs to be initialized by the standard palette.

Change-Id: I91c2ac9aea122e6ed9c09c96b35dfe0ef18a3ca0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-03 14:49:25 +02:00
Eskil Abrahamsen Blomfeldt
f49a266236 Make API in QPlatformSharedGraphicsCache a little more generic
Use EGL extensions for some things to allow serialization
instead of the somewhat specialized serializeBuffer() function.

Change-Id: I8d15e85bfb80d12fa953ba094564ddfca1aa6d6a
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-04-03 14:49:25 +02:00
Martin Smith
98fed68347 qdoc: findNodeRecursive() was called with a null start node
This occurred in several places. They have
all been corrected to start at the tree root,
when the start node passed is null.

Task nr: QTBUG-25146

Change-Id: I5d75db0626451d30e8be8de5605036ba168f2a14
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-04-03 12:45:46 +02:00
Shane
e09fc38a36 Don't require exact IMAP server version in autotests
The string from the server should begin with "* OK" and end
with "\r\n" according to the IMAP specification.
Still have a check for "server ready" as this does not change between
cyrus versions.

Change-Id: Ia01ed8aa054e5726bba8b411d30edc6205cc8465
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 12:45:46 +02:00
Thierry
aad60ec536 Fixes a problem with the proxy detection on Windows
The current scheme is to use IE's default config.
If that fails get the winhttp config.
That's ok. The problem is that if you run a program as a service
getting the IE config will set the fAutoDetect flag.
But later the call to WinHttpGetProxyForUrl mightfail with the
error code ERROR_WINHTTP_AUTODETECTION_FAILED.
this patch just makes sure that we have a fallback winhttp solution
in case the IE proxy is not set.
The new code detcted if the current process is a service, in which case it
will try to default to the system-wide proxy.

Change-Id: I57e9082a46a8422c54f8f069715752c271a3a001
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-03 12:45:46 +02:00
Kevin Krammer
45b7b0599c Move handling of rotation changes from event handler to screen
Have the navigator event handler emit the new rotation as a signal argument
and let the screen class handle all parts of the change, i.e. also notifying
the window system about the geometry change.

This also allows to rotate all screens, not just the primary screen, if this
should be necessary.

Change-Id: I304a80232b84d2d9130e38e955d5a75b1ccad775
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 12:45:46 +02:00
Shawn Rutledge
b4ec80ac87 Corrected filenames to build on case-sensitive Mac filesystems
Change-Id: Ie6f0188e3b2140b80b444dfdf24a078d215e0e87
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-04-03 12:45:46 +02:00
Pekka Vuorela
388d6e0f80 Adapt Maliit input context to new input method interfaces
Change-Id: Ia395dbb1689d1c37ef588c49cbb55ad1979f532f
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2012-04-03 12:45:46 +02:00
Thomas McGuire
777b7807bf Rename offset() to setOffset()
Change-Id: Iacf7b0a7f3cb3745711fe646e14317be1711d891
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 12:45:46 +02:00
Thomas McGuire
2438bf079d Fix adding and removing of windows to their screen
Change-Id: I5e0edf1515db60689c86b16b978863ae9e49bfdb
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 12:45:46 +02:00
Thomas McGuire
dee26fe973 Get rid of false positive warning when stopping video playback
The multimedia library actually creates two windows, and therefore the
first call to updateHierarchy() would try to update the z-order of
a no longer existing window.

Change-Id: I499d049e2885ff848f38d9cc5880aa63235b1b4c
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 12:45:46 +02:00
Thomas McGuire
47093dbfb4 Fix indentation
Change-Id: I965e7ba2e20798966a8215427e6724e3666aaeea
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 12:45:46 +02:00
Friedemann Kleint
43c5664f34 Fix release mode warnings about unused variables.
Variables that are only used in asserts.

Change-Id: I0984b676ad9b67f5ae72266b8540e8054163918f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-03 12:45:46 +02:00
Jerome Pasion
618e825f7b QDoc documentation: modified the instructions for documenting signals.
-we document signals, not signal handlers.

Change-Id: I7d52223a393ff0530ead06dfb8a80479e34fd362
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-04-03 12:45:46 +02:00
Donald Carr
ccdc98cfd8 Don't suppress using separate debug info when cross compiling
The configure script currently automatically assumes that if you are cross
compiling, we should avoid trying to generate and strip separate debug
information due to toolchain limitations.

Historically there may have been good grounds for this, but it seems like
an aggressively pessimistic assumption which ignores the
standardization/advancement of embedded toolchains as a whole.

This assumption also extends to host compilers which deviate from the
automatically detected "platform" compiler, such as Clang.

Change-Id: Ifed2750325178bb5291d8ca1dde92925bfa36065
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-03 10:45:02 +02:00
Jiang Jiang
bd833786a8 Rename clip() to clipData() to avoid confusion and warning
There are already a bunch of clip() functions in this class.
Rename the one for returning clip data to clipData() to make
it clearer. It also eliminate a warning when compiling with
clang.

Change-Id: I1f890ad6bf1c0274a0b38b3116a3ec3d2957d44a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-03 10:45:02 +02:00
Wolfgang Beck
7552d94d31 Prepare category logging for Qt integration
Change-Id: I0c784a945fe87d7ba52a44f5c7246de1709ae888
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Reviewed-by: Peter Yard <peter.yard@nokia.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-04-03 10:45:02 +02:00
Mark Brand
f1d2f7cfa0 add change log entry for QTBUG-23895
Follow-up to 50ad785bdd

Change-Id: Ib44a274148631fe96e13b8fe29436b556c14d34d
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-04-03 10:45:02 +02:00
Miikka Heikkinen
108e708e70 Windows: Improve Freetype font database registry check for fonts
Some non-scalable fonts like "Courier" list some numbers after the font
name in Windows registry, e.g. "Courier 10,12,15". These are not part
of the font name and therefore confused the algorithm looking for font
files. Improved the algorithm to ignore this kind of number list.
Single numbers are still expected to be part of the font name.

Task-number: QTBUG-24970
Change-Id: I3fe45b798f44bee962e5b3aa748fc4717f723353
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-03 10:45:02 +02:00
Pierre Rossi
db347ec2f8 Return early in QRawFont::setPixelSize.
We would otherwise end up cloning the font engine for absolutely no
reason when the pixel size is already right.

Change-Id: I8c34d2b53b596ad49d00031a3fb8e79f3b30d591
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-03 10:45:02 +02:00
Girish Ramakrishnan
f913859f88 eglfs: delete screen on exit
Delete the screen when the integration gets deleted. The screen destructor
destroys the window surface and terminates the egl connection. Note that the
egl context is not destroyed since it is managed by QOpenGLContext.

Change-Id: Ifb91c20edb6d5db684c37fb84d5ff40436f40925
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-03 10:45:02 +02:00
Girish Ramakrishnan
f578e52363 eglfs: Fix header guards
Match the filename and the header guard defines.

Change-Id: Id9f795ae8522e574d63115a43b62b9ee4ba33005
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-03 08:36:21 +02:00
Vincent A
2e7b4bf673 Document QFile::rename and QDir::rename's copy operation
Change-Id: Ie81804f77510cfb73917332c8faaf921525fc26e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-03 03:40:39 +02:00
Jędrzej Nowacki
4b023e2487 Remove duplicated template code.
Unify TypeDefinitions specializations. I'm not aware of any reason why
QVariant should have a separate set of supported types during
bootstrapping phase. It would cause only crashes.

As a side effect the patch reduces size of core and gui libraries.

Change-Id: I5140d9d3daee39a0171bc718bf46dab6b28085ec
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-03 03:29:55 +02:00
João Abecasis
97f251b8c3 Don't use qstrlen if string is not null
Change-Id: I4f9aec21af2ce24a1d27c6d140764e371bce5017
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 00:22:27 +02:00
Mark Brand
314b20e813 fix typo in change log
Change-Id: Id7c3cab500fb3f41fbced5a4012dc0ae5d108192
Reviewed-by: Debao Zhang <dbzhang800@gmail.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 23:06:30 +02:00
Honglei Zhang
50ad785bdd Convert Boolean value into integer
According to documentation, SQLite doesn't have a separate Boolean
storage class. Instead, values are stored as integers 0(false) and
1(true). In QSqlQuery::bindValue(), if a boolean value is bound
to a placeholder, it is converted to text true and false. This fix
converts boolean value to integer 0 and 1.

Task-number: QTBUG-23895
Change-Id: I4945971172f0b5e5819446700390033a1a4ce301
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 23:06:30 +02:00
Laszlo Papp
1967c14737 Use the relevant "\since 5.0" entry (proposed to public since 5.0)
Change-Id: I189166aeca8875401029128733401bf830d9ee71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 23:06:30 +02:00
Matt Newell
ccf25f1d28 QSqlDriver functions made virtual
Certain QSqlDriver functions were marked to be made virtual in Qt5.
subscribeToNotification, unsubscribeFromNotification,
subscribedToNotifications, isIdentifierEscaped, and stripDelimiters.

This patch makes them virtual and removes the no longer needed
Implementation counterpart functions. It also updates the relevant
drivers. This patch has no regressions on the tests in
tests/auto/sql/kernel/, tested with sqlite and postgres.

Change-Id: Ia2e1c18dfb803531523a456eb4e710031048e594
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 22:26:10 +02:00