summaryrefslogtreecommitdiffstats
path: root/src/dbus
Commit message (Collapse)AuthorAgeFilesLines
* Revert adding dispatchLocker to QDBusConnection::connectAlbert Astals Cid2015-03-131-1/+0
| | | | | | | | | | This reverts 268cc1dc996ba943895f24c5ca915c2b406b6097 On further examination it has shown that even if it fixes one deadlock it is either creating some others or making existing ones happen more often Change-Id: I70068cf0b0435a5dc06d4ac77ea50d3ba2361d01 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Lock dispatchLock before the regular lockAlbert Astals Cid2015-03-111-0/+1
| | | | | | | | Fixes deadlock Task-number: QTBUG-44836 Change-Id: Ie6def2d1e9684f4272d8920cd19c5765eef5f7c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>
* 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>
* 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>
* | 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>
* | Doc: Use title case in section1 titlesNico Vertriest2014-09-301-3/+3
| | | | | | | | | | | | | | | | Using Python script title-cased.py Task-number: QTBUG-41250 Change-Id: I00d3d7a0b30db7304a7904efd6d63abd9a7b493b Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-2465-1235/+715
| | | | | | | | | | | | | | | | | | - 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-012-10/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-152-4/+7
| |/ | | | | | | | | | | | | | | | | 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>
* doc: Updated Qt D-Bus Examples.Jerome Pasion2014-05-283-2/+49
| | | | | | | | | | -transferred group page from qtdoc repository -added description in example pages -set the example documentation to use the standard Qt thumbnail -added an entry in the help index for the example page Change-Id: I9d5747bc329b5ecc15acd2eb3139696931166c6f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* CMake: Include the CMakeParseArguments module for dbus macros.Stephen Kelly2014-04-161-0/+1
| | | | | | | | | | | | The cmake_parse_arguments macro is used already in the file. The module happens to already be included via Qt5CoreMacros, so the existing code is not currently a problem. Add the include to comply with 'include what you use' and to ensure that it continues to work even if Qt5CoreMacros is changed in the future. Change-Id: I7369261bce9d0e58488e584ef0743e33e9f9ec9e Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix some documentation errors.Friedemann Kleint2014-03-241-1/+6
| | | | | | | | Correct links and fix typos, remove obsolete documentation, fix some snippets, mark some classes as internal. Change-Id: I9a3266605f060783413d32740057a57a820c8929 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: correction link, example and parameter issues qtbaseNico Vertriest2014-03-101-1/+2
| | | | | | | | | | | | | Moved codecs folder to qtbase/examples Corrected quote in dropsite.qdoc Replaced snippet statement by include statement Added doc for undocumented parameters Task-number: QTBUG-34749 Change-Id: If4de95b8d39e5680fd0f63f8d2b6685a4b0a8052 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Always initialize integer types in D-Bus demarshallingThiago Macieira2014-03-061-0/+18
| | | | | | | | | | | | | | | If you tried to demarshall in a write-only QDBusArgument, the class would print a warning, but will continue running nonetheless. So instead just initialize everything, despite the warning. qdbusargument.cpp:1138:30: error: ‘d’ may be used uninitialized in this function [-Werror=maybe-uninitialized] qdbusargument.cpp:1165:33: error: ‘s’ may be used uninitialized in this function [-Werror=maybe-uninitialized] qdbusargument.cpp:1301:15: error: ‘y’ may be used uninitialized in this function [-Werror=maybe-uninitialized] etc. Change-Id: I6d713b4a7b7639e31f3b39bb488ad3ed3ab3fa4a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Make D-Bus types without a matching Qt one prettier in qdbusThiago Macieira2014-02-221-1/+4
| | | | | | | | Print "QMap<QString,QString>" for "a{ss}" and print a nicer expansion of other types. Change-Id: I0a7a2ecf8f0a62bd97931f3c129cd4cb4f471ef1 Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
* QDBus: replace arg-chain with multi-argMarc Mutz2014-02-141-3/+3
| | | | | | | | | | The arguments are all strings, so multi-arg is available without other changes to the code. Even though insertion of a format placeholder can be ruled out in the present case, multi-arg should be faster than a 3-chain of arg() calls. Change-Id: I8d030227e1bd30c56f1062a0c9dbbaae0143885f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBus: avoid relocationsMarc Mutz2014-02-141-8/+9
| | | | | | | | Instead of using Q_STRINGTABLE, use a switch/if construct to be able to share the string data for "write" and "readwrite". Change-Id: Ia1c7b8a0f13a809372de2e5a956978dc2d569e92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-14/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| * Also register complex D-Bus types when running under qdbusThiago Macieira2014-01-311-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running inside qdbus, we generate the meta objects a little differently. Previously, for unknown types we'd simply have a -1 as the type ID in the meta object, but this doesn't work in Qt 5 (has apparently never worked). So simply register a type with the metatype system and let QMetaObject do its thing. [ChangeLog][qdbus]Fixed a bug that caused the qdbus tool to crash when trying to display remote interfaces that had complex types without a matching base Qt type. Task-number: QTBUG-36524 Change-Id: Ifef65b340dc89d3295ed6ef00f2dcc60849ecb02 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Add method to QDBusServer to allow anonymous client connections.Roland Winklmeier2014-01-155-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-132-5/+5
| | | | | | | | | | | | | | | | 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>
* | Added PropertiesChanged signal to dbus introspection dataMatt Broadstone2014-01-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QtDBus adheres to the org.freedesktop.DBus.Properties interface, however there is no current way to include the PropertiesChanged signal in exposed introspection data. This change adds that signal to the introspection data, whether the adaptor uses the signal or not is up to the user. [ChangeLog][QtDBus][Important Behavior Changes] QtDBus adaptors now include the PropertiesChanged signal in introspection data Change-Id: Iee26528b59b30696689a79fb692f93859b42bb49 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-032-0/+11
|\| | | | | | | Change-Id: Id13badc270db98806048753fd7fb658aa17f1ede
| * Don't leak pending call objects when peer disconnectsRobin Burchell2013-12-302-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix crashes when calling into qdbus interfaces from QMLSimon Hausmann2014-01-022-24/+32
|/ | | | | | | | | | | | | | | | | | | | | 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>
* Fix quadratic behavior in QMetaObjectBuilder when writing string tableSimon Hausmann2013-12-061-2/+1
| | | | | | | | | | | | | | | QHash::key() is O(n) and we're calling it n times. That can make repeated calls to the meta object builder very slow, as for example QQmlPropertyMap when inserting properties repeatedly. Fortunately this is easy to fix, as the value in the hash map is also the index, so we can simply iterate over the hash once. With the exception of the class name, which we have to treat specially to ensure that it is always the first entry in the string table. Task-number: QTBUG-32720 Change-Id: Ic954c45c454107feee83216131f601cc69d4c63b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-0815-56/+56
| | | | | | | | | | | | | | | | | 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>
* qdbusxml2cpp: Fix annotation value in an introspection string generatorMichael Krasnyk2013-09-271-1/+1
| | | | | | | | | | | Unescaped annotation value causes for harmless values in an XML file, for instance, 'value=\"QList&lt;uint&gt;\"' a DBus exception, like dbus.exceptions.IntrospectionParserException: Error parsing introspect data Task-number: QTBUG-26668 Change-Id: Ie1eb519aec5228da0591d62c3aa5b6dec5790eb9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some doc errors.Frederik Gladhorn2013-09-211-2/+2
| | | | | | | Change-Id: Ib874d7e9671d9cee75fe41f4dac5d0de7b09245e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-09-164-40/+23
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: Ifc6cd3a0f1cf14cc0fe6cf30afb0c7f40cfdbc3e
| * QtDBus: fix build on MSVC2008 Debug mode.Nicolás Alvarez2013-09-152-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, searching for a V in a container of T using std::lower_bound only needs an operator<(T,V). But in MSVC2008 debug mode, STL algorithms perform some extra checks, such as ensuring the range passed to std::lower_bound is sorted. This adds a requirement for operator<(T,T) and operator<(V,T). QtDBus didn't compile on MSVC2008+Debug since 1e37d854 (Sept 2012!) because it missed those operator overloads for some private types. Task-number: QTBUG-33473 Change-Id: I18902d86e6c58349eb7ba3601dc383ad5431c460 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>