summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusintegrator.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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>
* | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2016-01-121-2/+2
|\| | | | | | | Change-Id: I5839bded07e23af65ced9491c4f50242f964dd31
| * Revert "dbus: Print out 'serial' and 'serial reply to' with DBusMessage ↵Thiago Macieira2016-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | operator<<." This reverts commit d3fe4f066f70bc8e4aef06b963444ecdbc3dd00f. Required to revert the parent commit. Change-Id: I1039e2ee65c0cd2c3209ea18bd3bd2d84a8daef3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into devFrederik Gladhorn2016-01-081-4/+33
|\| | | | | | | | | | | Based on merge done by Liang Qi Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
| * dbus: Print out 'serial' and 'serial reply to' with DBusMessage operator<<.Ralf Habacker2016-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The reply serial is displayed for method call returns and errors, while the serial is displayed for all message types. To see a message serial it is required to dump messages after sending, not before. Task-number: QTBUG-44490 Change-Id: I859f50d739ed059d5b2dfe1a2efdf04b906891a7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Suspend processing of some messages in the default busses by defaultThiago Macieira2016-01-021-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To retain a bit compatibility with applications developed in the last 9 years that expect that QDBusConnections won't process their events until the event loop runs, we now suspend the handling of incoming messages in the two default buses (and only in them) and resume when the event loop starts. This is required because the new threaded QtDBus would otherwise process incoming messages that the application didn't expect it to. For example, if the application first acquires names on the bus and only after that registers objects with QtDBus, there's a small window in which the name is acquired and visible to other applications, but no objects are registered yet. Calls to those objects may be received, would then be processed in the QDBusConnectionManager thread and fail. The work around is to disable the actual handling of method calls and signals in QDBusConnectionPrivate::handleMessage. Instead, those messages are queued until later. Due to the way that libdbus-1 works, outgoing method calls that are waiting for replies are not affected, since their processing does not happen in handleMessage(). [ChangeLog][Important Behavior Changes] QtDBus now uses threads to implement processing of incoming and outgoing messages. This solves a number of thread safety issues and fixes an architectural problem that would cause all processing to stop if a particular thread (usually the main thread) were blocked in any operation. On the flip side, application developers need to know that modifications to a QDBusConnection may be visible immediately on the connection, so they should be done in an order that won't allow for incomplete states to be observed (for example, first register all objects, then acquire service names). Change-Id: I39cc61d0d59846ab8c23ffff1423c6d555f6ee0a Reviewed-by: David Faure <david.faure@kdab.com>
* | QDBusIntegrator: fix quadratic behaviorMarc Mutz2015-12-271-8/+7
| | | | | | | | | | | | | | | | | | | | Calling QVector::erase(it) in a loop consitutes quadratic behavior (O(N) function called O(N) times). Fix by using std::remove_if(), which is linear. Change-Id: I39c11231d604bc2d9506427bc3411b71d71b5569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | dbus: Port to new connect syntaxSérgio Martins2015-10-011-6/+6
|/ | | | | | | Any connect requiring a lambda to be ported or function casts were not touched Change-Id: I1718121986ba6632b5754efa631f7b599358e186 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix deadlock on disconnectNotify() called from ~QObjectThiago Macieira2015-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QtDBus: update debugging info (QDBUS_DEBUG=1)Thiago Macieira2015-09-241-10/+4
| | | | | Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1a740643ec22e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge two more QDBusConnectionPrivate members into a unionThiago Macieira2015-09-151-13/+14
| | | | | | | | | | | QDBusConnectionPrivate can only be a client or a server, not both, so the DBusServer and DBusConnection pointers can be shared, like the QDBusConnectionInterface and QDBusServer pointers in the other anonymous union. Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1baa8ab83c42f Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Make sure we don't deadlock when connecting signalsThiago Macieira2015-09-151-47/+34
| | | | | | | | | | | | This commit moves the code that finishes the signal-slot connection into the QtDBus auxiliary thread. That is necessary because we're holding the lock for writing while making blocking calls. The auxiliary thread might be waiting for us to release that lock while processing some previous message. Change-Id: Iee8cbc07c4434ce9b560ffff13d0521b94a51833 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Bypass connectSignal() for receiving the NameOwnerChanged signalThiago Macieira2015-09-151-6/+17
| | | | | | | | | | | | | | | | | This is an optimization but is required. Instead of going through the entire (dis)connectSignal() stack to add/remove matching rules for the NameOwnerChanged bus signal and call into our serviceOwnerChangedNoLock slot, create a static hook that will match the signal and simply add/ remove the rules as needed. The required part is that this avoids a recursion into connectSignal(). The next commit will move this code to the QtDBus manager thread and we won't be able to call connectSignal() from there (it would create a deadlock). Change-Id: Iee8cbc07c4434ce9b560ffff13d074ce90ad02d4 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Make QDBusConnectionPrivate::getNameOwnerNoCache work in our threadThiago Macieira2015-09-151-3/+15
| | | | | | | | | | | | | | | In two commits, we will attempt to call this function from the manager thread, so we need to be sure this function works from there. Right now, it would deadlock in QDBusPendingCallPrivate::waitForFinished(), inside QDBusConnectionPrivate::sendWithReply(). The solution is simple: expand sendWithReply to the sendWithReplyAsync function it calls anyway, but tell the internal DBusPendingCall to finish before we call waitForFinished(). Change-Id: Iee8cbc07c4434ce9b560ffff13d0749013d771ab Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QDBusServiceWatcher: Move the logic to QDBusConnectionPrivateThiago Macieira2015-09-151-6/+64
| | | | | | | | | | | With kdbus, we won't have a regular signal, but instead a special message. So keep the logic of what to do in QDBusConnectionPrivate. The #ifdef is to make sure the bootstrapped qdbuscpp2xml continues to build in cross-compilation environments. Change-Id: Iee8cbc07c4434ce9b560ffff13d06f0d9904cb6d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Remove the event callbacks in QDBusConnectionPrivateThiago Macieira2015-09-151-125/+19
| | | | | | | | | | | | | | | | | | | | | They were used when we called the libdbus-1 message-sending functions from any thread, which meant that the callbacks could be triggered on any thread. Since we moved the message-sending to one thread only (the manager's thread), there's no need for the event fallback anymore. Since they're also always[*] running on an aux thread, there's no point in checking for the presence of a QCoreApplication instance anymore. I don't think there has been a need for this for many years, as the event dispatcher has been decoupled from QCoreApplication for a long time. [*] exception: the callbacks are first called in the thread that invoked QDBusConnection::connectTo{Bus,Peer}, before we've done the moveToThread. Task-number: QTBUG-43585 Change-Id: Ic5d393bfd36e48a193fcffff13b73758c798d6b0 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge two Q_GLOBAL_STATICS into another and solve memory leakThiago Macieira2015-09-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | The two global statics for the session and system buses aren't necessary if they can't outlive the global static for QDBusConnectionManager anyway. So merge them there. The extra mutex is necessary because the QDBusConnection::connectToBus function will lock the regular mutex. This solves a potential memory leak at exit as a side-effect. Before this change, the session and system QDBusConnection object got destroyed in the main thread during global destruction, so it had to post an event to the QDBusConnectionManager thread to finish the destruction of the private. However, QCoreApplication is already gone by this point, so the QEvent::DeferredDelete event never got delivered. After this commit, there's no global static to destroy the QDBusConnection (there is no QDBusConnection holding a reference), so the object gets destroyed in QDBusConnectionManager::run()'s cleanup code. Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1b967ee1a7a7e Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* And move the creation of connections to the threadThiago Macieira2015-09-151-0/+1
| | | | | | | | | | Now we know that all timers and socket notifiers get created only in the QDBusConnectionManager thread. Incidentally, this reduced code duplication. Change-Id: I27eaacb532114dd188c4ffff13d5075a8d2efb0b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* And move the sending of other types of D-Bus messages to the threadThiago Macieira2015-09-151-10/+13
| | | | | | | | | | With this, we now know that all messages sent are sent from the same thread. This simplifies greatly the handling of the socket. Task-number: QTBUG-43585 Change-Id: Ic5d393bfd36e48a193fcffff13b73758087344ed Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Move the sending of the D-Bus messages with reply to the threadThiago Macieira2015-09-151-7/+15
| | | | | | | | | | | This is intended to simply the handling of the socket in the future. Now, we know that all calls to send_with_reply are placed only from the manager's thread. Task-number: QTBUG-43585 Change-Id: Ic5d393bfd36e48a193fcffff13b737575c231927 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Remove superfluous code in QDBusConnectionPrivate::sendWithReplyThiago Macieira2015-09-151-6/+0
| | | | | | | | | | | | No need to check for the local loop if that's the first thing QDBusConnectionPrivate::sendWithReplyAsync will do. The side effect is that this now allocates memory for the QDBusPendingCallPrivate object, but loopback messages aren't that common to be worth the special casing. Task-number: QTBUG-43585 Change-Id: Ic5d393bfd36e48a193fcffff13b73756ab802ba2 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Simplify some code in QDBusConnectionPrivate::sendWithReplyAsyncThiago Macieira2015-09-151-24/+11
| | | | | | | | | | | They're pretty much the same, clearly a copy & paste. Instead, merge the two codepaths so that we don't run the risk of applying a change in one part and forgetting the other. Task-number: QTBUG-43585 Change-Id: Ic5d393bfd36e48a193fcffff13b737560f6753be Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use a dedicated thread for handling incoming libdbus-1 eventsThiago Macieira2015-09-151-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Each application will have one thread dedicated for this, for all QDBusConnections. I wouldn't mind sharing such a thread with other uses in Qt, provided none of them ever block (the QProcessManager thread comes to mind, but it's going away soon). The cost associated with this change in this commit is so far rather minimal. All incoming D-Bus calls need to be handled after an event is posted anyway, to avoid deadlocking on reentering libdbus-1 functions that acquire locks still held. The cost is the one more thread running and the cost of synchronizing them when an event is posted. The benefits far outweigh that cost: no longer will we have problems of QtDBus failing to run if the main system or session connections are used before QCoreApplication is run. Moreover, events can be received and handled in aux threads even if the main thread is blocked on some operation. Note: this commit may not be testable (tst_qdbusconnection may fail) Task-number: QTBUG-43585 Change-Id: Ic5d393bfd36e48a193fcffff13b737556ccd11a8 Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Implement the blocking QtDBus call in terms of the non-blocking oneThiago Macieira2015-09-151-75/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the code a little by having a single code path. More importantly, we no longer need to call the evil function dbus_connection_send_with_reply_and_block. That function acquires a lock on the socket transport inside libdbus-1, which means all threads need to wait until the one call gets unblocked before they can continue. To do that, this commit reimplements the QDBus::Block part of QDBusConnectionPrivate::sendWithReply by reusing the existing call to sendWithReplyAsync() and then doing a blocking-wait with QDBusPendingCallPrivate::waitForFinished(). By using (Q)DBusPendingCall and the threaded connection approach (next commit), now we never block on the socket. That also means the code to call dbus_pending_call_block() is no longer necessary and the waitForFinished() function itself can be considerably simplified. As a side-effect of no longer blocking, a number of pre-existing race conditions that used to be hidden showed up. Note: this commit deadlocks without the threading (next commits). Task-number: QTBUG-43585 Change-Id: Ic5d393bfd36e48a193fcffff13b73754954a3f7d Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Make QDBusConnectionPrivate::send return boolThiago Macieira2015-09-151-13/+6
| | | | | | | | | It used to return the sent message's serial ID, but we never used that. So simply use boolean instead. Change-Id: Ic5d393bfd36e48a193fcffff13b73753ccf47759 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Albert Astals Cid <aacid@kde.org>
* Use a signal for updating the dispatch statusThiago Macieira2015-09-151-11/+3
| | | | | | | | | | | | | | The cost of connecting a signal may be a bit high, but it's comparable to looking up the invokable method. However, QMetaMethod::invoke has a higher cost than a signal-slot emission -- though in any case they're both dwarfed by the cost of allocating the QMetaCallEvent and the posting of it. This is much more readable, though. Change-Id: Iccecbecbe6288fb3b6d16578fdff3f203b6db29c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Albert Astals Cid <aacid@kde.org>
* Use QDBusConnectionPrivate* when QDBusServer receives a new connectionThiago Macieira2015-09-151-4/+11
| | | | | | | | | This is because the socket activity will move to a different thread; QDBusConnectionPrivate* can be queued, QDBusConnection can't easily. Change-Id: I82722016018b7fcfb246cda6043469fadbfd987d Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix deadlock if the last reference is dropped during deliveryThiago Macieira2015-09-151-14/+0
| | | | | | | | | | | | | | | | We increase the reference count of the connection during delivery of an incoming message, so it's possible that the corresponding deref will drop the last reference to the connection: another thread may have called disconnectFromBus/Peer. However, during destruction we try to drain the incoming socket queue, so we need to acquire the dispatch lock again. The solution is to always use deleteLater(), which means the deleteYourself() function is unnecessary. Change-Id: I27eaacb532114dd188c4ffff13d507039fcf7b6a Reviewed-by: Albert Astals Cid <aacid@kde.org> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* dbus: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-231-1/+6
| | | | | | Change-Id: I5d60220c4d3014067a45a3d3553f0523c9fc7c74 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qDBusRealAddTimeout(): don't create a QList just to check it's emptyMarc Mutz2015-06-171-1/+1
| | | | | | | | | Instead of QHash::keys(value).isEmpty(), use QHash::key(value, 0) == 0 (0 is used a failure indicator three lines down, so it should not be a key in the hash table). Change-Id: I75cc4f7f7540dc5c51a7b8e3add09a0ec6a75e05 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix conditions for disabling dbus dynamic symbol lookupUlf Hermann2015-06-161-1/+1
| | | | | | | | We cannot do this if no library support is present. Incidentally that's the case when bootstrapping, but you can also set the flag manually. Change-Id: I51e167176d0839af5858122630ef623a1c69a106 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-1/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * Fix undefined behavior: accessing an object after destructionThiago Macieira2015-04-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-011-35/+20
|\| | | | | | | | | | | | | | | Conflicts: src/testlib/qtestblacklist.cpp src/widgets/accessible/qaccessiblewidgets.cpp Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c
| * Use QStringLiteral where applicable in QtDBusThiago Macieira2015-03-311-33/+16
| | | | | | | | | | | | | | | | | | 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-301-2/+4
| | | | | | | | | | | | | | | | Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-03-161-2/+2
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbnativeinterface.h Change-Id: I31b38ba439b9341d51a01c0fd54bea33f7410076
| * 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>
* | Add QDBusMessage::createTargetedSignal()Alberto Mardegan2015-03-141-1/+2
|/ | | | | | | | | | | | | | | The QDBusMessage::createSignal() static method doesn't take a parameter for specifying the destination service of the signal. While this is not a widely used feature, it can be useful to avoid waking up all connected clients when the service knows what are the clients which are interested in the signal. This commit adds a QDBusMessage::createTargetedSignal() method which also takes the destination service as its first parameter. Change-Id: I9fdca53673a6944c39c93c1efd69a9d02859684e Task-number: QTBUG-44704 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusConnection::registorObject with interfaceKevron Rees2015-02-151-2/+6
| | | | | | | | | | | | 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>
* 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>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-211-3/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix memory leaks with QDBusServerThiago Macieira2015-01-111-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove the old QDBusConnection::sender functionalityThiago Macieira2015-01-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-101-0/+2
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * 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>