summaryrefslogtreecommitdiffstats
path: root/src/dbus
Commit message (Collapse)AuthorAgeFilesLines
* Doc:added doc to undocumented functionsNico Vertriest2015-07-221-1/+1
| | | | | | Task-number: QTBUG-36985 Change-Id: Ic358682b276d67ef804f727bcf14191718613469 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* 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>
* fix usage of wince scopeOswald Buddenhagen2015-06-051-1/+1
| | | | | | | Fix style issues along the way. Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Make sure we don't call dbus_connection_can_send_type on too old libdbusThiago Macieira2015-05-261-3/+0
| | | | | | | | | | | | | | | | | | This function was introduced alongside the support for Unix file descriptors, so it's a good indicator of whether Unix FDs are supported. Ever since dbus_minimal_p.h, however, DBUS_TYPE_UNIX_FD may be defined even if the system libs don't support it. In order to fix this issue, I had to fix what was apparently a merge conflict resolution mistake and remove the #ifdef around the test. Doing the latter is a good idea due to moc being unable to find <dbus/dbus.h>. This was tested with both linked and dynamically-loaded libdbus-1. Task-number: QTBUG-46199 Change-Id: I66a35ce5f88941f29aa6ffff13dfb4b5438613a3 Reviewed-by: Jani Vähäkangas <jani.vahakangas@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Doc: added doc for non-documented functionsNico Vertriest2015-05-182-0/+12
| | | | | | | Task-number: QTBUG-36985 Change-Id: I85f58c2877d83b98bf3427cbb0f567575803524f Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix undefined behavior: accessing an object after destructionThiago Macieira2015-04-152-0/+10
| | | | | | | | | | | | | | | | | | QDBusConnectionPrivate keeps a pointer to a QDBusConnectionInterface, which in turn holds a reference back to that QDBusConnectionPrivate. During the interface object's destruction, the QDBusAbstractInterface's destructor checks if the interface is still valid. That access is undefined behavior, but has so far been benign in all our uses since the memory had not yet been freed (just destroyed) and the reference count went from 0 to -1. To be on the safe side, we destroy now the QDBusConnectionInterface object while the Private is still valid. It will bring the reference count down from 0 to a negative number, but won't cause any other effects. Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1b80057e13809 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix crashes on shutdown when the D-Bus spy list has been destroyedThiago Macieira2015-04-151-1/+1
| | | | | | | | | | The QDBusConnection spy hook is most often created after the QDBusConnectionManager global, which means it will get destroyed before. That means we'll almost surely going to get a null pointer dereference if we handle the socket close to shutdown. Change-Id: I27eaacb532114dd188c4ffff13d4c9dc865b8c02 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use QStringLiteral where applicable in QtDBusThiago Macieira2015-03-318-61/+64
| | | | | | | | | 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>
* Use QDebugStateSaver to restore space setting in stream operators.Friedemann Kleint2015-03-303-4/+8
| | | | | | | | Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <david.faure@kdab.com>
* Skip non-exported slots early when creating a XML interface description.Robert Griebl2015-03-251-1/+6
| | | | | | | | This will prevent unnecessary warnings about unknown types for signals or slots that are not even exported to the D-Bus. Change-Id: Iecda5beca5ebe6665a193245fe1c2578156f6abe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Export the symbols of libdbus-1 when loading it at runtime.Robert Griebl2015-03-251-0/+1
| | | | | | | | | This allows applications that need additional symbols from the library to easily obtain them without needing to replicate the library open logic from qdbus_symbols.cpp. Change-Id: Ic65ef6684637fbcd1c9f4fe1dc7a57f0624b61a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtDBus: Fix const correctness in old style castsThiago Macieira2015-03-111-2/+2
| | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c9468642b2db83 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix various qdoc-warnings.Friedemann Kleint2015-02-251-1/+1
| | | | | | | | | | qtbase/src/corelib/doc/src/containers.qdoc:28: warning: Can't link to 'QList:end()' qtbase/src/corelib/kernel/qmetaobject.cpp:2680: warning: Cannot find 'fromType(...)' in '\fn' QMetaEnum QMetaEnum::fromType() const qtbase/src/corelib/kernel/qmetatype.cpp:1117: warning: Cannot find 'qMetaTypeTypeImpl(...)' in '\fn' int qMetaTypeTypeImpl(const char *typeName) qtbase/src/corelib/plugin/qplugin.qdoc:48: warning: Cannot find file to quote from: 'plugins/interfaces.h' Change-Id: Ie613253211e16ec616ccb70c24c625a9d5352d1b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Remove documentation of QDBusIntrospection::Object::introspection.Friedemann Kleint2015-02-251-8/+0
| | | | | | | | qtbase/src/dbus/qdbusintrospection.cpp:269: warning: Cannot find 'QDBusIntrospection::Object::introspection' specified with '\variable' in any header file Change-Id: I7c5d207842235752ebe38f45b7eee7f8fc00127d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-1513-37/+37
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QDBusConnection::registorObject with interfaceKevron Rees2015-02-155-3/+31
| | | | | | | | | | | | Currently QDBus relies on a key in QMetaClassInfo to understand the DBus interface name. This patch allows QDBus to also use a specified interface name in the registerObject call instead of relying on QMetaClassInfo that might not be there (if the QObject was created in QML or Javascript for example). Change-Id: Ie02b2c67e7deb07f43e35eb166c11833fcbf38f3 Task-number: QTBUG-44074 Reviewed-by: Kevron Rees <kevron.m.rees@intel.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-132-0/+8
| | | | | | | | | | | Instead of leaving a note for Qt6 and then forget to do the actual change once again, change APIs now inside QT_VERSION >= QT_VERSION_CHECK(6,0,0) blocks. Change-Id: Ifa769904e304358a9c2accfd6c9f86eeb342f9dc Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-1184-552/+552
| | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-216-7/+33
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * Doc: link issue D-Bus ViewerNico Vertriest2015-01-121-0/+17
| | | | | | | | | | | | | | | | Moved doc D-Bus Viewer from qdbusviewer.cpp to qtdbus-index.qdoc Doc moved from qttools to qtbase Task-number: QTBUG-43537 Change-Id: I718781a8f5029f64fea0f2be241b4d584cc8bfce Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Fix memory leaks with QDBusServerThiago Macieira2015-01-113-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Two serious mistakes: - we need to call dbus_server_free_data_slot as many times as we call dbus_server_allocate_data_slot - we need to delete the d pointer... The changes to the unit tests are simply to cause the used peer connections to be removed so they don't show up in valgrind. Change-Id: I9fd1ada5503db9ba481806c09116874ee81f450d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Fix compilation with MSVC 2010Thiago Macieira2015-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2013 and 2015 compile this fine. I didn't test 2012. I wouldn't have fixed if the objective weren't to enable QtDBus by default on all architectures: since it is, we can't have Qt fail to compile from sources on MSVC 2010. qdbus_symbols.cpp(92) : fatal error C1001: An internal error has occurred in the compiler Change-Id: I42b930bc37c4e478a66725d83c8a73836fbf567c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Make QtDBus unit tests compile with runtime dbus-1 tooThiago Macieira2015-01-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | There's a change in Qt 5.4.0 that makes Qt compile with its own set of D-Bus headers, which means QT_CFLAGS_DBUS may be empty. Thus, we can't compile or link if we're using the actual libdbus-1 API to build the test. This commit makes these unit tests use the same dynamic loading mechanism. Change-Id: I56b2a7320086ef88793f6552cb54ca6224010451 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Make QDBusConnection and QDBusServer return an error on default objectsThiago Macieira2015-01-062-2/+2
| | | | | | | | | | | | | | | | | | | | The error of "Not connected". This incidentally solves a crash when QDBusServer().lastError() is called but libdbus-1 couldn't be found. Change-Id: Id93f447d00c0aa6660d4528c4bbce5998d9186a8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Fix assignment within a Q_ASSERTHolger Hans Peter Freyther2015-01-161-1/+1
| | | | | | | | | | | | | | | | | | This was introduced in 3b844c16e0988b017c67b2329cbe34d4da112b33 and doesn't seem to be right. Change-Id: I1c6a9445996650566d44f223651dd0c855619a88 Fixes: Coverity CID 21589 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove unused QDBusMessage::timeout memberThiago Macieira2015-01-062-4/+3
| | | | | | | | | | | | | | | | | | | | | | It's been there forever, but never used. The timeout is set during the actual call. I moved QDBusMessage::type only for padding purposes. Change-Id: I41dd638ac423078be642077dbf17439d15b5d405 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Make QDBusMessage store its own message typeThiago Macieira2015-01-062-16/+19
| | | | | | | | | | | | | | | | | | Instead of the libdbus-1 constants. Though they're exactly the same because they are based on the protocol wire format, so this is technically a no-op change. Change-Id: Ia2c638c4b508497ca693afd9c76e60ba9245f5e7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Remove the old QDBusConnection::sender functionalityThiago Macieira2015-01-065-36/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This has been deprecated since QDBusContext was introduced (Qt 4.3). So it's time to remove the functionality. [ChangeLog][Important Behavior Change] QDBusConnection::sender() (deprecated since Qt 4.3) has changed to always return an invalid QDBusConnection. To know what connection the incoming call was received from, use QDBusContext. Change-Id: I355efb82c14e54ed718c8f892d8267e727b19118 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Cosmetic debugging difference for QDBusConnectionThiago Macieira2015-01-061-1/+3
| | | | | | | | | | | | | | This makes the output slightly easier to read. Change-Id: I590b9abcb0263ae5f0580391b42e179c47569a8a Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Add a simple way of tracing calls to libdbus-1Thiago Macieira2015-01-061-1/+77
| | | | | | | | | | | | | | | | | | | | | | Very useful to track memory leaks and other silly stuff going wrong. Requires C++11, but since it isn't enabled by default, it's not a problem. ALso, only works with "runtime" dbus -- for linked, use ltrace(1) instead. Change-Id: Iccb18516cfb729b2b1bf9ee592df4a1adefeb3b7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-293-10/+31
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| * Doc: corrected broken links qtbaseNico Vertriest2014-12-231-2/+2
| | | | | | | | | | | | | | Task-number: QTBUG-43115 Change-Id: Ib441326083294a6d59d75510142b1481f7b0bc35 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Remove the hardcoding of Unix socket paths for QtDBusThiago Macieira2014-12-201-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the tests to be run on Windows too by using TCP socket connections instead of requiring Unix sockets. The tests shouldn't have hardcoded the path, which came from QDBusServer anyway. Now the tests simply defer to QDBusServer. This is a slight behavior change for Windows, but not one that should matter since anyone who was using the default constructor resulted in a QDBusServer that failed to listen. [ChangeLog][QtDBus][QDBusServer] Fixed a bug that made QDBusServer's default constructor try to bind to a Unix socket on non-Unix systems. Now QDBusServer will attempt to bind to a TCP socket instead. Change-Id: I2a126019671c2d90257e739ed3aff7938d1fe946 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Fix loading of the dbus-1 DLL built by MinGW on WindowsThiago Macieira2014-12-201-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLibrary does not append the version suffix on Windows by itself, since there's no established practice on how to do this. The MinGW builds of dbus-1 call it "libdbus-1-3.dll", so we need append the suffix ourselves. Unfortunately, other names like "dbus-1.dll" have been seen in the wild, so we need to try both basenames (Windows doesn't prepend the "lib" prefix). Both basenames work on Unix, so give "libdbus-1" on Unix since that will result in one fewer stat. Change-Id: I92506df5fd30c7674216568406bf86b25bf646b8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Include qobjectdefs.h for Q_GADGETThiago Macieira2014-12-291-0/+1
| | | | | | | | | | | | Change-Id: Ie1bf2393757978775596a542732c62e3f3014f82 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove Q_NO_USING_KEYWORDThiago Macieira2014-12-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a lot of code now requiring it. Any compiler that doesn't support the keyword is too old for Qt now. The last time anyone asked about this macro was for QTBUG-27393 and we don't know which compiler that was. As a necessity, this patch contains a reversal of a0c3a57aed5cde37017733e7cf5e41cc6a1174aa [ChangeLog][Compiler Specific Changes] Qt 5.5 now unconditionally uses the "using" keyword. Compilers that do not support this keyword are deprecated and will not be able to build Qt. Previous versions of Qt may or may not compile, as no testing was done to ensure it worked. Change-Id: Ief042f34aba555a095d1f342a0ee7ee9feadf42d Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-105-3/+286
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * Merge remote-tracking branch 'origin/5.4.0' into 5.4Simon Hausmann2014-12-053-2/+283
| |\ | | | | | | | | | Change-Id: I0cd11cbe95693b78450ea81a0187760f4a6a8b5f
| | * Make QtDBus compile without libdbus-1 headers, if dlopeningThiago Macieira2014-12-013-2/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of QtDBus already needs very little from libdus-1, so create an extra header containing the minimum API we actually need. One large advantage of this solution is that now QtDBus can always be enabled, even if the system doesn't have libdbus-1 installed. This is interesting on OS X, where libdbus-1 is often installed by Homebrew or MacPorts, which may include extra libraries we don't want in our packaging. Change-Id: I1b397121ec12eeca333ef778cf8e1c7b64d6b223 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Change misleading error message in QDBusReplyThiago Macieira2014-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | "no signature" is misleading and even led me to re-check the code to see if it meant that the reply failed and no signature could be obtained. Saying that the signature was obtained but is empty is better. Change-Id: I1381cf53b334798125d36db0934105d15b63b84f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| * | Break after handling the read/writeAlbert Astals Cid2014-11-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The loop is there because watchers may have two Watcher for the same fd, one for read and one for write, but after we're processed the correct one we don't need to keep looping. This fixes a crash since it's possible that while in processing q_dbus_watch_handle we get a watch added/remove this invalidating the iterator and crashing Change-Id: Icb61deae272d2f237a4c616fae598404d419af90 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix DBus signature generation for complex types.Aaron McCarthy2014-12-042-34/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating the DBus signature of a registered custom type the marshaller appends the signatures of the map entries and array items after the map/array causing an invalid DBus signature to be generated. This happens because beginArray() and beginMap() output the full signature of the data. Fixed by suppressing changes to the signature within beginArray()/endArray() and beginMap()/endMap() blocks. Change-Id: Icaf23b2fe58a3e1f575b81e4a100f02684f68452 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-035-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-244-56/+49
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * | Don't send reply messages for non-method calls in QDBusMessageMatt Fischer2014-11-221-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | QDBusMessage is intended to avoid sending reply messages unless the message is a method call without the NO_REPLY_EXPECTED flag set. However, since messages which are not method calls will never have this flag set, the code will currently cause all non-method call messages to expect a reply. This patch changes the code to examine the message type, and to only check for the flag in cases where the message is a method call. Change-Id: Ic5bb00df69d3cfb38f60bf6bfd8463fb28cf2c99 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge remote-tracking branch 'origin/5.3' into 5.4.0Oswald Buddenhagen2014-11-103-56/+45
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Iad9ef6bf7d6111efba8232a7d9b46bb9974912f5
| | * Partially revert "Fix a deadlock introduced by the race condition fix"5.3Thiago Macieira2014-11-051-26/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit was 9361be58f47ec256bf920c378479a02501219c1f (2008-11-17), referring to the race condition fix that was applied in commit d47c05b1889bb4f06203bbc65f4660b8d0128954 (2008-10-08). The fix for the deadlock reintroduced the race condition and the commit message noted it. The workaround is no longer necessary since we've fixed the original race condition differently now (see the previous two commits). Task-number: QTBUG-42189 Change-Id: I5a83249597a83c4d4caa2ae57964ad3cc61c1d70 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| | * QDBusConnection: Merge the dispatch and the watch-and-timeout locksThiago Macieira2014-11-053-29/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need two anymore because they now protect the same thing: the state of the DBusConnection. The difference existed when it was possible for two threads to access the DBusConnection at the same time: one doing dispatching and one doing something else. Unfortunately, even though DBusConnection supports this, QtDBus doesn't. From d47c05b1889bb4f06203bbc65f4660b8d0128954 (2008-10-08): Details: if we're removing a timer or a watcher from our list, there's a race condition: one thread (not the QDBusConnection thread) could be asking for the removal (which causes an event to be sent), then deletes the pointer. In the meantime, QDBusConnection will process the timers and socket notifiers and could end up calling lidbus-1 with deleted pointers. That commit fixed the race condition but introduced a deadlock. Task-number: QTBUG-42189 Change-Id: I034038f763cbad3a67398909defd31a23c27c965 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| | * Always lock the DBus dispatcher before dbus_connection_send*Thiago Macieira2014-11-052-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We lock it before dbus_connection_send_with_reply (the async version) in QDBusConnectionPrivate::sendWithReplyAsync. We weren't locking it before send_with_reply_and_block and we apparently should. The locking around the dbus_connection_send function might not be necessary, but let's do it to be safe. The lock now needs to be recursive because we may be inside QDBusConnectionPrivate::doDispatch. Task-number: QTBUG-42189 Change-Id: I7b6b350909359817ea8b3f9c693bced042c9779a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | | Update dbus to use new QMetaType::registerNormalizedType signatureJędrzej Nowacki2014-11-171-13/+1
| | | | | | | | | | | | | | | Change-Id: I5d755f383d8cd226a25bd495f6854c0db9719a51 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>