Commit Graph

11585 Commits

Author SHA1 Message Date
Samuel Rødal
d29aabbca9 eglfs: Introduce way of filtering out unwanted EGL configs.
Some times a platform might want to exclude certain configs, for example
based on EGL_NATIVE_VISUAL_ID. This patch introduces a new
QEglConfigChooser class which has a virtual filterConfig() function
which can be re-implemented in a sub-class to give finer control of how
configs are chosen.

Change-Id: I8b684f01be95a47307b1e429857f01337a9a38d8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-18 09:16:03 +01:00
David Faure
ac9ab9703f QtDBus: Garbage collect deleted objects now and then.
Fixes performance issues in apps which register and deregister objects
very frequently (like nepomukstorage).

Change-Id: Ib4ce8d65868f0e26cd45f1053e4b2f4c13528cfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:36 +01:00
David Faure
00e0923e60 Output std error from qmake/make when the test fails.
This is intended to make it easier to understand what's happening when
this test is flaky during CI.

Change-Id: I13163c244cb99414d90b5f71c365a4ff2216bc83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:29 +01:00
David Faure
ff8362d65e QSaveFile autotest: restore permissions using RAII
So that the QTemporaryDir can happen even on error.

Change-Id: I728d49eac8bd65e1919fd314a95387949e134de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:22 +01:00
David Faure
2d5fe45379 QSaveFile: test the case of an existing, but readonly, target file.
Change-Id: I296d9c2598b8c72e2fd3e6ec80a615364b7eddeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:16 +01:00
David Faure
e993df8771 Add class QSaveFile.
This QIODevice uses a temporary file for writing, so that in case of
write errors, the writing operation is canceled, without losing any
existing file. It also avoids having a partially-written file visible
by other processes, at the final destination.

Change-Id: I9482df45751cb890b1b6f1382ec2eea3eb980627
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:11 +01:00
Frederik Gladhorn
e3a10e15ff Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-16 23:51:11 +01:00
Friedemann Kleint
34572dadc6 Dialog testing tool: Control life cycle of non-modal file dialogs.
Keep the non-modal file dialog around and delete only on request,
such that one can simulate repeated invocations of show() on
the same dialog for testing native dialogs.

Change-Id: I80d0f1dfafbc02a31be192098121654a01025174
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-01-16 17:06:12 +01:00
Juan Luis Boya García
5d2bb24cc9 Fixed dead keys on MS Windows
Since Qt4, there is a bug which causes Qt to drop dead key modifiers
(like graves and acutes) if the user types enough fast on MS Windows.

This happens because of an extrange behavior of Windows, which drops
dead keys on ToUnicode() calls.

This patch tries to workaround that.

Task-number: QTBUG-8764
Task-number: QTBUG-10032

Change-Id: Ifdde25817743194fd5c0b7533c27f46a7a108ca4
Reviewed-by: Friedemann.Kleint@digia.com
Reviewed-by: oliver.wolff@digia.com
Reviewed-by: marc.mutz@kdab.com
Reviewed-by: bjoern.breitmeyer@kdab.com
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-16 08:53:58 +01:00
Frederik Gladhorn
7075e29199 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qstyleanimation.cpp

Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
2013-01-16 01:22:45 +01:00
Tor Arne Vestbø
1161a8a629 CoreText: Add support for providing scaled glyphs to the glyph-cache
Useful for not having to fall back to QPainterPath drawing when using
the raster engine with a retina screen (which has a 2x scale).

Change-Id: I0a9f754d31b0ecd8e8daf7a01331d19716bab680
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-15 22:49:53 +01:00
Friedemann Kleint
3d9a40038f Implement QPlatformWindow::isExposed() on Windows.
Task-number: QTBUG-28439

Change-Id: I4a81a8947056ecd4e1e61ffb0e5d94ee2ad860df
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-15 19:47:44 +01:00
Frederik Gladhorn
122ee7a367 Merge "Merge remote-tracking branch 'gerrit/release' into stable" into refs/staging/stable 2013-01-15 19:47:44 +01:00
Frederik Gladhorn
270a51b775 Merge remote-tracking branch 'gerrit/release' into stable
Change-Id: Ieb104d0e390218a063082c93bc9c7e412af2166d
2013-01-15 18:14:13 +01:00
Friedemann Kleint
c1b974c611 Fix crash in hellowindow example when minimizing.
Task-number: QTBUG-28439

Change-Id: Idcea2712afdbb08b4da2fa230fd8ba6aebd380b7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-15 16:41:05 +01:00
Friedemann Kleint
d3dc0f2122 Fix renaming of files that differ only in case.
This currently fails on case-insensitive file
systems since the check for existence then triggered
and indicated "file already exists".

Check on the file id (inode or file id) whether
the target file is really a different file for a
case-changing rename.

Task-number: QTBUG-3570

Change-Id: I1b2d40850692e02142ee23d2c753428de00aedc6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 16:36:20 +01:00
Gunnar Sletta
4cad9e4667 Revert "Added note in the README"
This reverts commit f15a73f254.

The note has been there for the 5.0.0 release, so it should now
be removed.

Change-Id: I8744f74834cc87002aa590de9c258f544bcf0c9b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-15 15:49:56 +01:00
Friedemann Kleint
bb5e11b56d Fix crash in tst_qaccessibility.
Release the table item below the table test instead of releasing
the text item twice.

Change-Id: I74d283d50a39b9a4570b73a8297ed3dbb2de2271
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-15 15:48:41 +01:00
David Faure
d147285d64 Add Q_COREAPP_STARTUP_FUNCTION macro.
This is necessary for initializing things in a library, which require
a QCoreApplication instance (unlike Q_CONSTRUCTOR_FUNCTION, which runs
before that). Example use cases: KCrash (segv handler), and KCheckAccelerators
(debugging tool triggered by magic key combination).

Change-Id: I5f4c4699dd4d21aea72b007989ba57467e86ed10
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 14:58:35 +01:00
J-P Nurmi
3a1f1aecf9 QStyleAnimation: remove obsolete workaround for threaded rendering
This is a partial revert of 7abf623. The desktop components have been
fixed to call QStyle in the main GUI thread.

Change-Id: Ifd8364269b7d2e350f34647c128ff2fbde70afd6
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2013-01-15 14:58:35 +01:00
Friedemann Kleint
cd7ba89a07 Windows: Force toplevel flag in setParent() in both cases.
When re-applying window flags in setParent, force top level on
or off according to state.

Task-number: QTBUG-28872
Change-Id: If931fcb38394f472a6cdf260aa935c1d03779611
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-15 13:38:55 +01:00
Friedemann Kleint
71a7ad80c0 Fix warning about missing enumeration value.
Change-Id: If97a325d056282a033cdb4c6e5bdc79eb400c525
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-01-15 13:26:43 +01:00
Frederik Gladhorn
7818eaf2b1 Bump Qt version to 5.1.0
Change-Id: I6d372c933e48eeda921fe781b073bf4e05b31585
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-15 12:45:21 +01:00
Kai Koehne
d2e64c47ce XCB: Force XSync after creating Window
Make sure that dpy->request == dpy->last_request_read after setting
up a new window. If we don't do this, last_request_read might never
be updated until the difference hits a limit that can lead to hangs
in the application (see e.g. QTCREATORBUG-8373).

Task-number: QTBUG-29106
Change-Id: I390493ca6f966dc105d3ea3a2c48abec01177bc2
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-15 08:58:21 +01:00
Friedemann Kleint
5eab554227 Check for existence of QWindow in QApplication::isBlockedByModal.
Warn if window == 0 is passed in
QApplicationPrivate::isWindowBlocked().

Task-number: QTBUG-28637
Change-Id: I1213ea371813eeb90f962cc39235ddfccc663d45
Reviewed-by: Jing Bai <jing.bai@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-15 08:58:17 +01:00
Thiago Macieira
0c4f6c6ea9 Fix compilation of Qt Concurrent with gcc 4.3
GCC 4.3 had support for decltype but not the new function syntax (which
we call "auto function" for short). That meant the code did not compile.

qtconcurrentrun.h:105: error: expected initializer before ‘->’ token

Task-number: QTBUG-28984
Change-Id: I792276ec59c4f6e73f6137c517636e70c71ed849
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-15 07:28:49 +01:00
Thiago Macieira
856f209fb6 Change all shmget calls to user-only memory
Drop the read and write permissions for group and other users in the
system.

Change-Id: I8fc753f09126651af3fb82df3049050f0b14e876
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-15 04:34:27 +01:00
Thiago Macieira
f927efd77a Add support for Linux eventfd(7) in the UNIX event loop
eventfd(7) uses less resources than a pipe, as it only needs to store a
single 64-bit integer, as opposed to a full buffer.

It was introduced first on Linux version 2.6.22 and glibc 2.7. However,
both the configure-time test and the runtime usage require the use of
EFD_CLOEXEC for thread-safety, so this code will be enabled only for
Linux 2.6.27 and up as well as glibc 2.9 and up.

Change-Id: Ic7e10b28d7b1d4ca24be614ed84055c4429a68e4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-01-15 03:29:29 +01:00
Thiago Macieira
dbfa651889 Doc: Update the info on the QSharedPointer internals
Some of it still referred to classes that were cleaned up in Qt 5.0

Change-Id: Ief4ed4b4fce074884f755b0d18a526ac40ad1b0b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-15 03:29:15 +01:00
David Faure
6b9545a980 QUrl: methods for converting QStringList <-> QList<QUrl>
This is a very common thing to do, e.g. in order to send urls via DBus.

Change-Id: I277902460ee1ad6780446e862e86b3c2eb8c5315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
327b2ba3b7 Add class QDebugStateSaver for writing QDebug operators correctly
Had to move QTextStreamPrivate to a private header, to be able to use
its new internal Params struct from qdebug.cpp

Change-Id: If28e25f27bbd04b1825a5eb3e2ef83ecad72e7b2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
ad265c55be Move QTemporaryFileEngine to private header
This is needed by QSaveFile.

Move QTemporaryFilePrivate to that header too, to avoid any confusion.

Change-Id: I8dce8a4fb853a9823c49ec565867432331e748cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
ad893943cf Add syncToDisk() to QAbstractFileEngine.
This is needed by QSaveFile.

Change-Id: I07ebdfd832c0be65c26f0aed1bb7852ac33135ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
7e7b65c370 Add renameOverwrite() to QAbstractFileEngine.
QFSFileEngine::rename() on Windows doesn't overwrite the existing destination.
Keep that unchanged (it's the desired behavior in QFile::rename), and
provide cross-platform rename-overwrite behavior in the new method.

This is needed by QSaveFile.

Change-Id: I5e753d289d8a53692530a48a1783d62e26169cdc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Gatis Paeglis
18c916517f Use backslashes for UNC paths.
ShellExecute fails to open a share folder due to using '/' instead of '\'.

Windows API doesn't support forward slashes for extended-length path.
Extended-length path are path that start with a "\\?\" prefix. For example,
"\\?\c:\very_long_path\foo\bar.txt", or in the case of a UNC path that
would be "\\?\very_long_path\foo\bar.txt". [1]

[1] http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#maxpath

Task-number: QTBUG-13359

Change-Id: Ibb113abeebd56f106f76520bc23dba797de548fa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-14 23:44:15 +01:00
Ruslan Nigmatullin
d4adcfb8cc Added QMessageAuthenticationCode
QMessageAuthenticationCode is HMAC implementation based on
QCryptographicHash abilities. HMAC is often used in OAuth and similar
authentication protocols.

Change-Id: Ifc73947ad06c36a1b770315b7e89ba5c01c5e79e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
J-P Nurmi
c174d101bd configure: disable GTK auto-detection on Mac
Task-number: QTBUG-28769
Change-Id: I2f05fdf530cde8ae7ed1470a99acade6267e19e6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-01-14 22:04:31 +01:00
Friedemann Kleint
273713b81f Fix QVistaHelper::disconnectBackButton().
Restrict disconnect() to the clicked() signal, leaving connections
to destroyed() (as used by QStyleSheetStyle) intact.

Task-number: QTBUG-20292
Change-Id: I7471b4d1262ec0684e4446b5c17513717c502749
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-14 21:43:12 +01:00
Jeremy Nicholl
67195dc394 Fix malloc errors from legacy realpath on Mac OSX.
Avoid using realpath(X,0) on Mac OSX at all, since
even on versions of OSX where realpath(X,0) is supported,
we still get the legacy version due to our compiler flags.
If we were to change the -mmacosx-version-min to 10.5 or
higher then this patch would be safe but unnecessary.

Task-number: QTBUG-28282
Change-Id: Iee21003f3e9616482483a05ceee706b476091914
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-01-14 18:24:31 +01:00
Milian Wolff
90cb4d8e2e Fix QtBase cross compilation in debug mode for iMX6 targets.
The platform specific CFLAGS, most notably -march=armv7-a, were only
added to QMake's _RELEASE flags but not to the _DEBUG flags.
This then resulted in strange compilation errors such as this one:
http://qt-project.org/forums/viewthread/22141

Change-Id: Ib47996c6946b043294437e8543827da270df836d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-01-14 18:24:31 +01:00
Weng Xuetian
f12cc9c648 set gtk-entry im-module to none in gtkstyle
in qt5, gtkstyle use gtk_widget_send_focus_change, this had a side
effect that will trigger real gtk im module, if qt load the same qt and
gtk im module for same input method, it will cause conflicts for qt im
module. The only gtk widget have im-module property is GtkEntry and
GtkTextView, since only GtkEntry is used here, we only need to override
im-module for GtkEntry.

gtk-im-context-none exists in gtk+ since 2.19.5, and for older version,
it will also harmlessly fallback to gtk-im-context-simple.

Change-Id: I4ffb93453e77c8d5db3349b084342bdca8e4a571
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-01-14 16:28:21 +01:00
Orgad Shaneh
b6963f109a QMenu: Fix nested popup when keyboard shortcut is used
Task-number: QTBUG-20403

Change-Id: I2a5fe00dd16e9dc1ec0d742a8f48083fc2954996
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-01-14 16:28:21 +01:00
Rafael Roquetto
791eb399d2 Split QQNXLocaleData::readPPSLocale()
Because this method creates a QSocketNotifier, it needs
to be split into a part that is run on initialization, namely
QQNXLocaleData::initialize(), and one that is run delayed
through event loop invocation, namely QQNXLocaleData::installSocketNotifier().

Task-number: QTBUG-28701

Change-Id: Ib60000902692bbca4820d3d0bc7719212668dfa9
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-01-14 16:28:21 +01:00
Sergio Martins
d525764430 QNX: Make QWidget::hide() work immediately.
Change-Id: I3ea2556769703a8cd4c2931cc2332ab0733fbea6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2013-01-14 16:28:21 +01:00
J-P Nurmi
aa2da482fe Docs: fix the minimum required GTK+ version
The minimum GTK+ version was bumped from from 2.10 to 2.18 (sep 2009)
in commit 2cce297b58.

Change-Id: I77a48c8a3b0955b00e399f714949d08293abbebd
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2013-01-14 16:28:21 +01:00
Tor Arne Vestbø
e11cf63b0b Fix crash when trying to create paths for color-glyphs (Emoji) on Mac
CoreText segfaults when creating paths for color-glyphs:

  0  0x00007fff8fd41e69 in TFont::FindColourBitmapForGlyph ()
  1  0x00007fff8fd417ac in TFont::CreatePathForGlyph ()
  2  0x000000010567d1af in QCoreTextFontEngine::addGlyphsToPath (...)

So we shortcut the code-path, since we don't support Emoji yet anyways.

Task-number: QTBUG-28615
Change-Id: Ife16ae4959077d9eaaf6ea5cd1f27a4e2e01e7f5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-01-14 14:07:48 +01:00
Friedemann Kleint
9941bf5118 Fix crash in tst_qtreewidget.
A division by zero occurred since an empty model was used.

Task-number: QTBUG-28611

Change-Id: I1f9e869bda9f76a1c97840dff6ba48ab813bce9a
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-14 14:06:16 +01:00
Thiago Macieira
dc131e3a53 Make QDBusPendingReply behave like QDBusReply when dealing with errors
QDBusReply allows one to extract a QVariant and the type reply from an
error reply and getting a default-constructed value. This is useful when
a valid reply can never contain the default-constructed value (0, false,
empty strings, empty arrays, etc.), so it simplifies error checking.

More importantly, qdbusxml2cpp was changed a while ago from generating
QDBusReply to generating QDBusPendingReply, so we need to have the same
behavior.

Task-number: QTBUG-29046
Change-Id: Ia873b9fd4311c0d4e94f0ef623ba405c20bc0e8c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-14 13:03:50 +01:00
Peter Hartmann
4c8d8a72ec BlackBerry: change SSL root cert folder
Currently /etc/openssl/certs is symlinked to
/var/certmgr/web/user_trusted, but this will be changed in the future.
/etc/openssl/certs is the folder to be used to read the root certs.

Change-Id: Ic037e5075ec7ee50c132fe08dc69abbe585e32e4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-01-14 11:35:17 +01:00
Thiago Macieira
60fc88a09c Resolve some race conditions on tst_QSharedMemory
This test runs fine almost all of the time on systems with 1
processor, which were the norm when the test was written and are still
the way that the Qt Continuous Integration system works as of
today. But it falls flatly on multi-processor systems.

The root of the problem is that QSystemSemaphore recreates the
semaphore if it disappears underneath it. However, the recreation
process is not thread-safe at all: if two threads race to recreate it,
weird things might happen. strace on Linux shows that a thread got
stuck trying to acquire the semaphore:

  <... nanosleep resumed> NULL) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  semget(0x51001388, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
  semget(0x51001388, 1, IPC_CREAT|0600) = 114786308
  semop(114786308, {{0, -1, SEM_UNDO}}, 1 <unfinished ...>

This problem does not happen if the creation and destruction of the
QSharedMemory (which uses QSystemSemaphore) does not race with other
threads or processes attaching and detaching. For the threads test
it's easy. For the processes, we use stdin and stdout as a
communication channel.

Change-Id: Ie11b135431d4abfc59234654848b67f622eb03c9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-14 11:35:17 +01:00