summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusintegrator.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-38/+37
|\| | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge remote-tracking branch 'origin/5.3' into 5.4.0Oswald Buddenhagen2014-11-101-38/+37
| |\ | | | | | | | | | | | | | | | | | | 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-051-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-051-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QtDBus: use qEnvironmentVariableIntValue()Marc Mutz2014-10-171-1/+1
|/ / | | | | | | | | | | | | | | It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: Ib0c0f903531a3a656919e87df8065a9c6c7a666c Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* | Replace the const QString global static with a QStringLiteralThiago Macieira2014-08-131-4/+10
| | | | | | | | | | | | | | | | | | | | | | It was originally created to avoid allocating memory for the QString at every turn, but we have QStringLiteral for that today. It has also served a very good run by catching qatomic.h implementations that had bad cv qualifications. Change-Id: Id6d952b8cce363015ec2611d346b4cccedecf137 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | QtDBus: Warn if blocking calls take too long.Robin Burchell2014-07-251-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blocking DBus calls have the potential to totally wreck user interactivity at best (actions taking too long) and make things appear completely broken at worst (the default timeout is 30 seconds, which is a huge amount of time, especially if you get unfortunate and have a repeated blocking call). Provide a warning when a call is found that takes too long, based on some preset durations (200ms for the main thread, 500ms for other threads on the basis that the main thread is generally more important). Also provide configuration knobs for these environment variables, in miliseconds: setting them to 0 will warn on all blocking DBus calls. Setting them to -1 (the default, on release builds) will disable the warning. [ChangeLog][QtDBus] Blocking calls that take a long time will now generate a warning. The time taken may be tuned using the environment variables Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS and Q_DBUS_BLOCKING_CALL_OTHER_THREAD_WARNING_MS. The value represents (in milliseconds) how long before a blocking call is warned on. A value below zero disables the warning, a value of zero will warn on all blocking calls. Change-Id: I0ab4c34aa01670a154d794d9f2694b3235e789db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-011-9/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * Merge remote-tracking branch 'origin/stable' into 5.3Frederik Gladhorn2014-06-251-6/+5
| |\ | | | | | | | | | Change-Id: I7462840d15583ead82e86fcf5c84659b909e8c4e
| | * QDBus: fix data race on isDebugging boolDavid Faure2014-06-211-6/+5
| | | | | | | | | | | | | | | Change-Id: Id0b8bf8dac570abfc6c8768bd4264650ae0c199b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Fix data race in accessing QDBusConnectionPrivate::serviceNamesThiago Macieira2014-06-151-3/+6
| |/ | | | | | | | | | | | | | | | | The trick of creating a copy is not thread-safe. I'd known this since the moment I wrote that code, but thought "what could go wrong?". Task-number: QTBUG-39285 Change-Id: If521d4a649c06e6a34926687e85623aa25cb4c35 Reviewed-by: David Faure <david.faure@kdab.com>
* / Use correct signal name when disconnecting "NameOwnerChanged"Jakub Adam2014-06-081-1/+1
|/ | | | | | | | | | A disconnectSignal() call with a wrong signal name caused that hook wasn't found and thus kept in QDBusConnectionPrivate::signalHooks forever. Change-Id: Id7cda225be7580529fc835b377636226abb229f9 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add method to QDBusServer to allow anonymous client connections.Roland Winklmeier2014-01-151-1/+6
| | | | | | | | | | | | | | | | This change adds a new method to QDBusServer to allow anonymous connections. This is part of the DBus API and was not yet possible to use with QDBusServer. It is set in the newConnection callback when a new client tries to connect. Anonymous connections are enabled by default in DBus but not allowed by default. [ChangeLog][QtDBus][QDBusServer] Added method to QDBusServer to allow anonymous client connections, even if the connecting client is not authenticated as a user. Change-Id: I984c9e634101ecd2e67bb25c8d12bb1071836fd3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-3/+3
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't leak pending call objects when peer disconnectsRobin Burchell2013-12-301-0/+9
| | | | | | | | | | | | | Unlike in regular connection to DBus server, we don't get pending call notifies when a peer drops the connection in peer-to-peer mode. Thus, we need to keep track of pending calls in such cases and get rid of them in ~QDBusConnectionPrivate(). Change-Id: I83e20db0bc7b2ebf509c7fdb1382ffc7d0ede9d3 Done-with: Kalle Vahlman <kalle.vahlman@movial.com> Reviewed-by: Daniele E. Domenichelli <daniele.domenichelli@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-09-161-34/+7
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: Ifc6cd3a0f1cf14cc0fe6cf30afb0c7f40cfdbc3e
| * Fix loss of valid dbus objects after unregisterObjectJohn Brooks2013-09-141-34/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partial revert of 3c6bb0ed8bfc9a2c679f4154585a16e47275ad21 and 57aed703d21c3a360d95fd9f85396d1283d3fdd0. When registering an object that was previously unregistered but not yet garbage collected, the activeChildren count on the parent node was not incremented, which could result in other registered objects disappearing after a later unregisterObject. Copying objects in the tree is not free, but it's not expensive enough or used frequently enough to justify that error-prone logic. It's much safer to simply remove objects immediately. Change-Id: I3dc59c2ebd07b237518424fcd8ea7371a22d6d15 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-141-53/+55
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * Change QDBusPendingCallPrivate to full reference counting for deletion.Peter Seiderer2013-07-291-39/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes race between QDBusConnectionPrivate::processFinishedCall() releasing the mutex before emitting signals (using various members of QDBusPendingCallPrivate) and deletion of the QDBusPendingCallPrivate object through QDBusPendingCall::d's destructor (a member of type QExplicitlySharedDataPointer<QDBusPendingCallPrivate>) leeds to segmentation fault with CrashTest example on slow/single core arm cpu). Task-number: QTBUG-27809 Change-Id: I3590d74d1cfa5816ede764b50b83a7008ec780ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Remove QDBusPendingCallPrivate::autoDelete logic.Peter Seiderer2013-07-291-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First step to fix race condition about deleting QDBusPendingCallPrivate. In a multithreaded application on a slow/single core cpu the following race (and segmentation fault) can occur: First thread A is running: A: QDBusPendingReply<> reply = pi->asyncCallWithArgumentList(method, argumentList); Then when the dbus answer arrives thread B will call: B: QDBusConnectionPrivate::processFinishedCall() B: ... B: locker.unlock() and runs until here, go on with thread A: A: reply.waitForFinished(); A: QDBusPendingCallPrivate::waitForFinished() A: { A: QMutexLocker locker(&mutex); A: if (replyMessage.type() != QDBusMessage::InvalidMessage) A: return; which returns immediately (mutex acquired, replyMessage alread set), now reply goes out of scope (destructor called) and QDBusPendingCall::d's destructor of type QExplicitlySharedDataPointer<QDBusPendingCallPrivate> deletes the reference counted object QDBusPendingCallPrivate. Now thread B continues, still in processFinishedCall() B: if (call->watcherHelper) B: call->watcherHelper->emitSignals(msg, call->sentMessage); B: B: if (msg.type() == QDBusMessage::ErrorMessage) B: emit connection->callWithCallbackFailed(QDBusError(msg), B: call->sentMessage); accessing alread deleted object QDBusPendingCallPrivate via call->... Fixed QDBusPendingCallPrivate deletion by proper reference counting will be done in the next commit. Task-number: QTBUG-27809 Change-Id: I15b3f0242471b62eaafadc763fb6a33339ff2fe1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fix unprotected access to QDBusPendingCallPrivate::pending.Peter Seiderer2013-07-291-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QDBusConnectionPrivate::waitForFinished() pcall->pending was used after the protection by pcall->mutex was released. A simultaneous call to QDBusConnectionPrivate::processFinishedCall() was able to reset pcall->pending to null before it was used for the q_dbus_pending_call_block(pcall->pending) call. Fixed by releasing (and setting to 0) of pcall->pending in processFinishedCall() only in case no one is waiting yet, otherwise release pcall->pending by the first thread waiting in waitForFinished(). There is still a race condition about deleting QDBusPendingCallPrivate (too early) which will be fixed in the next two commits. Task-number: QTBUG-27809 Change-Id: I040173810ad90653fe1bd1915f22d8dd70d47d8c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-151-3/+3
|\| | | | | | | Change-Id: I0218a1f08b89f2d56757ab35eec06799d2a1492f
| * Fix disconnectFrom{Peer,Bus} when the connection failedThiago Macieira2013-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the connection failed, the DBusConnection object is null, but we still add our QDBusConnectionPrivate to the global hash (maybe we shouldn't). Both disconnectFromXXX functions check that they are disconnecting a connection of the right type, but we never initialized the type if the connection failed. So simply make sure we initialize before handling the error state. Task-number: QTBUG-27973 Change-Id: I96f4825ab1b71adf1b72caf4f72db41742b44a55 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | QDBus: improve error handling, to give the developer feedback.David Faure2013-07-011-2/+4
|/ | | | | | | | | | | | | For instance, exporting an object with a slot like QString complexMethod(const MyVariantMap& vars); (even with a simple typedef QVariantMap MyVariantMap) used to silently skip that method in the introspection. Now it outputs: generateInterfaceXml: Skipped method "complexMethod" : Invalid type in parameter list: MyVariantMap Change-Id: I7964cfb63e973257ce1abe47b9625e361b2ad23f Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix wildcard signal disconnection in QDBusAbstractInterfaceThiago Macieira2013-03-191-2/+0
| | | | | | | | | | | | | | 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>
* Stop using function deprecated in D-Bus 1.2 (raise minimum version)Thiago Macieira2013-02-271-3/+3
| | | | | | | | | | | | | | | | The dbus_watch_get_fd function was deprecated in D-Bus 1.2 (technically, in 1.1.1, but that was a development release) because it had a bad name. Sockets on Windows have file descriptors, but they are not shared from the same pool as the CRT library's file descriptors. This commit raises the minimum required version of D-Bus to 1.2. This is the first requirement raise since this code was introduced in 2006. For some reason, the D-Bus 1.2.0 release seems to be missing, but 1.2.1 was released on 04-Apr-2008. That's ancient enough for all distributions Qt 5 is supposed to run on. Change-Id: Ia6bbc137fffbb27c77290ed3e32d3380f0ae3c54 Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
* Add Q_DECL_UNUSED to a function only used in Q_ASSERTThiago Macieira2013-02-121-1/+2
| | | | | | Change-Id: I18697037db742d38874c8a95df12c189ccc51068 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-281-1/+1
|\ | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| * Doc: Fix module name formatSze Howe Koh2013-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-231-1/+1
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| | * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Improve the QDBusConnection node children garbage collectionThiago Macieira2013-01-231-25/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the implementation from ac9ab9703ff299c94dca7585d5a12e. If the number of active children drops to zero, we know we can simply delete the vector of children. We know none that might be there are active. If the number is not zero, but is considerably smaller than the vector size, we can shrink the vector by reordering the elements, skipping the inactive ones. We use qMove, which expands to std::move on C++11, but a regular copy on C++98. Change-Id: I2e74446081f91fbd698425b08910fbda4746d673 Reviewed-by: David Faure (KDE) <faure@kde.org>
* | | Make the QtDBus object tree keep a count of active childrenThiago Macieira2013-01-231-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new member variable activeChildren shall contain the number of direct children that are active. This number differs from children.count() because the vector may contain empty entries that haven't been garbage-collected yet (obj == NULL and activeChildren == 0). When this count drops to zero, we know we can simply erase the vector of children. Change-Id: Ia20604d3fac852ea4a6e8862d934fbb936fa5e18 Reviewed-by: David Faure (KDE) <faure@kde.org>
* | | Rewrite QDBusConnection::unregisterObject to be recursiveThiago Macieira2013-01-231-0/+40
|/ / | | | | | | | | | | | | | | | | The current implementation is a loop. We need it to be recursive so that we can execute more operations when unwinding. This will be necessary in the next commit. Change-Id: Ia3c98fed0719cede0a0d92d3e343cf016ec7baf2 Reviewed-by: David Faure (KDE) <faure@kde.org>
* / QtDBus: Garbage collect deleted objects now and then.David Faure2013-01-171-0/+17
|/ | | | | | | | 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>
* Make QtDBus work again with D-Bus 1.0 and 1.1Thiago Macieira2012-10-191-10/+9
| | | | | | | | | | The dbus_get_version function was introduced in 1.2, so we'd need to detect pre-1.2 by the absence of the function. But if we're going to detect the presence or absence of any function, we might as well do it on dbus_connection_can_send_type, which is the function we wanted anyway. Change-Id: I6e17a3a8f1382c6a489490084f6e3f61aa5a1947 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove visibility attribute from function body in QtDBusThiago Macieira2012-10-171-2/+2
| | | | | | | | Those were using an inconsistent macro compared to the function declaration in qdbusthreaddebug_p.h. Change-Id: I3e77ba83ceedc99cb1f957fdfe318e34ab9c9628 Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* QDBusMetaTypeId: don't cache the result of qMetaTypeId<>() in static intsMarc Mutz2012-09-221-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | There's not much point in caching the result of qMetaTypeId<>, because it's already internally memoised. In addition, the code that initialised the static int caches wasn't protected against concurrent access under the assumption that the operations performed were thread-safe. That is true for most of them, but not for the stores to the static ints, which race against each other: // Thread A // Thread B r1 = initialized /*=false*/ r1 = initialized /*=false*/ r2 = qMetaTypeId<...>(); r2 = qMetaTypeId<...>(); message = r2; message = r2; // race, ditto for all other ints To fix, turn the ints into inline functions that just call the respective qMetaTypeId<>() function. Change-Id: I5aa80c624872c3867232abc26ffdcde70cd54022 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* dbus: Include own headers firstSergio Ahumada2012-09-191-1/+2
| | | | | | | cpp files should include their own headers first (but below config.h) Change-Id: I4115604aee3211118e2ecf604067f3559dbb9f4c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove qLowerBound usages from qtbaseGiuseppe D'Angelo2012-09-191-3/+5
| | | | | | | | | Replace them with std::lower_bound; this allows for deprecation of qLowerBound. Change-Id: I536e7338eb85ea6c7c1a5bf23121292767927e0b Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Fix QDBusServer with more than one connectionJan Arne Petersen2012-09-141-4/+10
| | | | | | | | | | | | | | | Create a new QDBusConnectionPrivate for every new connection in qDBusNewConnection instead of creating a single QDBusConnectionPrivate in the QDBusServer constructor which gets assigned the latest connected DBusConnection in qDBusNewConnection (and loses track on all previous DBusConnections). Also extend tst_QDBusConnection::registerObjectPeer() test with multiple connections to the server. Task-Number: 24921 Change-Id: I4341e8d48d464f3fe0a314a6ab14f848545d65a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusIntegrator: fix unprotected QDBusPendingCallPrivate::waitingForFinished ↵Marc Mutz2012-09-081-1/+7
| | | | | | | | | | | | | | | | | call There probably is a happens-before relation to all the writes of the bool elsewhere, but the comment in QDBusPendingCallPrivate says waitingForFinsihed is one of the variables protected by the mutex, so don't make every reader of the code re-establish the safety (if indeed, it is safe) oneself again, but just wrap the access in a mutex lock. To be able to compile the mutex locking out of release builds, wrap the access in a function. Make the function static _inline_ so compilers won't complain about it being unused in release builds. Change-Id: I914ce91e64e776450c697a3243b35716390a218c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusPendingCall: add a missing QWaitCondition::wakeAll() callMarc Mutz2012-09-031-0/+1
| | | | | | | | | | In QDBusConnectionPrivate::waitForFinished(), threads that see pcall->waitingForFinished == true go to sleep on pcall->waitForFinishedCondition, but there was no call to waitForFinishedCondition.wakeAll() anywhere in the code, so add it. Change-Id: I8d068dc0cc4f20786eb40fd7e2bb9840d8b70c7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Print some debugging from QDBusConnection when disconnectingThiago Macieira2012-08-251-0/+1
| | | | | Change-Id: I6e19cd8b16513faad6435d1713eab56675d07289 Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
* QtDBus: compile with QT_STRICT_ITERATORSThiago Macieira2012-05-291-4/+4
| | | | | | | | Unlike most other modules, QtDBus in its use of QVector also needs to check if the item isn't null, which makes for some special changes. Change-Id: Ia22ad2a6b26c9c34dc09ab882d81323a941d166a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>