summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusabstractinterface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-1/+1
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-1/+1
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix race condition in QDBusAbstractInterfacePrivate::initOwnerTracking()Romain Pokrzywka2017-08-041-5/+5
| | | | | | | | | | | | | | | | | The current code fetches currentOwner in the constructor, then sets up a connection between a service watcher and _q_serviceOwnerChanged() in initOwnerTracking(). But an owner change notification could arrive after we fetch the current owner and before the connection is made. In this case the owner change notification will be lost, and the interface will keep reporting being invalid permanently. The fix is to delay initializing currentOwner until after the connection is made. Task-number: QTBUG-62284 Change-Id: I92b9d61004e14fd2ee2543488740a542dc7a9b7a Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-131-0/+14
|\ | | | | | | | | | | | | | | | | | | | | Also bump minimum required Qt version for Android: Ministro updates. Conflicts: src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java src/plugins/platforms/android/androidjnimain.cpp Change-Id: I966f249bebf92da37bfdeb995ad21b027eb03301
| * QtDBus: compile with GCC 7Marc Mutz2016-10-121-0/+14
| | | | | | | | | | | | | | | | | | GCC 7 warns about implicit fall-throughs now. Fix by adding the missing comments. Change-Id: I629fb3aced9296c81496f19f6ff78c7a5a12e991 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Updated license headersJani Heikkinen2016-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | [docs] Fix assocated -> associatedMarc Mutz2015-12-151-1/+1
|/ | | | | Change-Id: Ia828db7bb71b874b19a610439e156687f273290f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix deadlock on disconnectNotify() called from ~QObjectThiago Macieira2015-09-251-12/+52
| | | | | | | | | | | | | | | | | | | | | | | | | Normally, disconnectNotify() is called at the end of QObject::disconnect and all the locks have been dropped. That is not the case for the QObject destructor, so we need to deal with the fact that it there may be some locks held. I didn't catch this issue during testing because it depends on the pointer addresses of the object being destroyed and that of the QDBusAbstractInterface sender object, as we use one global, non- recursive mutex pool. For the same reason, this patch is not testable. The fix is simple: we don't need to remove the relay rules immediately. It's ok for them to happen later, since the worst case scenario is that we'll receive a few more signals than we have objects to deliver them to. If that happens, we'll do a little more work than we have to. But in the normal case, the amount of work is the same and we get the benefit of returning more quickly from the destructor. What's more, if the QDBusAbstractInterface object also gets destroyed, the events are deleted and QDBusConnectionPrivate will clean everything up. Task-number: QTBUG-48410 Change-Id: I42e7ef1a481840699a8dffff1406b789ba5217b3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Use the new QDBusConnectionPrivate::shouldWatchService functionThiago Macieira2015-09-151-3/+1
| | | | | | | | | That function was added in the previous commit, so deduplicate the code from QDBusAbstractInterfacePrivate::initOwnerTracking(). Change-Id: Iee8cbc07c4434ce9b560ffff13d06f1d9fb0cde5 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use QDBusServiceWatcher in QDBusAbstractInterface to track the ownerThiago Macieira2015-09-151-28/+17
| | | | | | | | | | | Instead of connecting to the "NameOwnerChanged" signal. This has better performance, is simpler to implement and is future-proof: when we switch to kdbus, there won't be a "NameOwnerChanged" signal to connect to. On the drawback side, this will use slightly more memory. Change-Id: I5801b8027949f041309567a493000fe7de9bf227 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Albert Astals Cid <aacid@kde.org>
* Fix warning with MSVC 2013Thiago Macieira2015-06-261-0/+1
| | | | | | | | | | warning C4100: 'name' : unreferenced formal parameter This is despite the new Q_ASSERT "using" its expression even in release mode. Change-Id: Ieebfc4ab72a6493eaa68ffff13ead0574dd78627 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use QStringLiteral where applicable in QtDBusThiago Macieira2015-03-311-12/+12
| | | | | | | | | Move to qdbusutil_p.h the string constants that are used often and in multiple places; use QStringLiteral in qdbusintegrator.cpp for the strings that are used often. Change-Id: I8e1325b9ba015bda91bf01c42175d8032ea32f62 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Fix crashes when calling into qdbus interfaces from QMLSimon Hausmann2014-01-021-23/+31
| | | | | | | | | | | | | | | | | | | | | The meta-call convention for reading properties differs between Qml and QDBus. QML expects only to provide a pointer to the return value in args[0]. That is also how the metacall was originally introduced in Qt 4. QDBus also expects that the caller allocates a QVariant and provides a pointer to it in a[2], in addition to a[1] being a pointer to an int that is used to report where the return value can be found (in where a[0] points to or the variant in a[1]) - this is useful to report errors when reading the property by clearing the variant. For performance reasons, QML avoids the creation of a QVariant when reading properties. As however QDBus expects it, a crash occurs. This patch changes the QDBus metacall implementation to not rely on the caller to provide a QVariant. Task-number: QTBUG-15052 Change-Id: I2f2c5b3ef2c1d93cc72eee1fa32a95d299a104c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-4/+4
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix QDBusAbstractInterface::isValid() for peer connectionsAlberto Mardegan2013-07-161-3/+11
| | | | | | | | | | | Do not attempt to lookup the service owner on peer connections (it will fail). Make QDBusAbstractInterface::isValid() return a sensible result on peer connections, instead of always returning false. Task-number: QTBUG-32374 Change-Id: I1b02feaffb3b255188f8d63306f89f5034a32f22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix wildcard signal disconnection in QDBusAbstractInterfaceThiago Macieira2013-03-191-3/+16
| | | | | | | | | | | | | | This has been broken forever, just like generic signal disconnection. It didn't use to show up before because in Qt 4, QObject's destructor would not call disconnectNotify(). Just like in the previous commit, we need to verify whether the signal was disconnected from the last receiver. A wildcard disconnect might be disconnecting only from a specific receiver. Task-number: QTBUG-29498 Change-Id: I0790128ea878fdf3ac563c99d96c6aa7d270e9a3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Make sure that signal disconnects don't disconnect too muchThiago Macieira2013-03-191-1/+1
| | | | | | | | | | | | | | | There has been a latent bug forever in QtDBus that would make a signal disconnect actually disconnect too much. The reason is that disconnectNotify() is called every time a signal is disconnected from a receiver, but that doesn't mean it was the last connection. This test checks whether disconnecting from voidSignal() to our test receiver will also disconnect from exitLoop(). If it does, we'll get a timeout. I could have implemented it with two receivers, but in the buggy case, it would always fail first in the timeout verification. Change-Id: I5766d8a38594eb25e65b304913251303660fad41 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Doc: Fix module name formatSze Howe Koh2013-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Modularize QtDBus documentation and add missing file to QtNetwork.Casper van Donderen2012-05-091-2/+2
| | | | | | | | This change moves the snippets and images to the modularized directories. Change-Id: Idacff866735d00b048d65318bc4c3ee1dfa16310 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Pass configured timeout to callWithCallback too.David Faure2012-05-021-1/+2
| | | | | | | This was missing in ccf3b9e48b2d773999a9a88e249f79380618cde6. Change-Id: I8bc8239591b893aad361b372a36ed5b9478aff24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix unit confusion in ccf3b9e48b2d773999a9a88e249f79380618cde6David Faure2012-05-021-2/+2
| | | | | | | | | I wrote nonsense in that commit. The older methods that take a timeout all take milliseconds, and the comments in the unit test really meant milliseconds, not seconds. 1s is not shorter than 100ms.... Change-Id: Ic18899bb0462d89575dc5a9a311478adc4dea1cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QtDBus to QMetaMethod-based connectNotify()Kent Hansen2012-05-011-3/+4
| | | | | | | The const char *-based API is deprecated and will be removed in Qt5. Change-Id: I1c7f0e46149964367f42faccfff4b89acbf16511 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use the new QMetaMethod API in QtDBusKent Hansen2012-03-201-2/+2
| | | | | | | | | Use QMetaMethod::name() instead of parsing the signature. Use QMetaMethod::returnType() instead of resolving the type id via the type name. Change-Id: If5d0198c5f1329fd9d9340acd58bd4a36933d960 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtDBus: make some constructors explicitMarc Mutz2012-03-121-4/+4
| | | | | | | | | This is a semi-automatic search, so I'm reasonably sure that all the exported ones have been caught. Change-Id: I314d341ad0db4e9d4bbf353a9537c9422ad8a54b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename QMetaMethod::signature() to methodSignature()Kent Hansen2012-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | In Qt5 the meta-data format will be changed to not store the method signature string explicitly; the signature will be reconstructed on demand from the method name and parameter type information. The QMetaMethod::signature() method returns a const char pointer. Changing the return type to QByteArray can lead to silent bugs due to the implicit conversion to char *. Even though it's a source- incompatible change, it's therefore better to introduce a new function, methodSignature(), and remove the old signature(). Task-number: QTBUG-24154 Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Adapt QtDBus to QVariant property type changeKent Hansen2012-02-031-2/+2
| | | | | | | | | | Commit 00c8984b4e48b2a7eadfee6c3cd0cbb19f586118 changed other parts of Qt to use QMetaType::QVariant, not 0xff, as the type for QVariant properties. QtDBus should check for that type, and also use it for QDBusVariant properties. Change-Id: I21d81b59754ae44889766877a4c5066466b46d86 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make the DBus timeout configurable in QDBusAbstractInterface.David Faure2011-08-251-4/+27
| | | | | | | | | | | | Merge-request: 1253 Reviewed-by: Thiago Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> (cherry picked from commit e58a402fbee2fc8af8cd651acafdc28525ed1314) Change-Id: I4246047b149193e510f2984a0b1a1fae655b9a51 Reviewed-on: http://codereview.qt.nokia.com/3580 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+776
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12