src/dbus/qdbusabstractinterface.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    39 **
    39 **
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
    42 #include "qdbusabstractinterface.h"
    42 #include "qdbusabstractinterface.h"
    43 #include "qdbusabstractinterface_p.h"
    43 #include "qdbusabstractinterface_p.h"
       
    44 
       
    45 #include <qthread.h>
    44 
    46 
    45 #include "qdbusargument.h"
    47 #include "qdbusargument.h"
    46 #include "qdbuspendingcall.h"
    48 #include "qdbuspendingcall.h"
    47 #include "qdbusmessage_p.h"
    49 #include "qdbusmessage_p.h"
    48 #include "qdbusmetaobject_p.h"
    50 #include "qdbusmetaobject_p.h"
   438     QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), interface(), m);
   440     QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), interface(), m);
   439     QDBusMessagePrivate::setParametersValidated(msg, true);
   441     QDBusMessagePrivate::setParametersValidated(msg, true);
   440     msg.setArguments(args);
   442     msg.setArguments(args);
   441 
   443 
   442     QDBusMessage reply = d->connection.call(msg, mode);
   444     QDBusMessage reply = d->connection.call(msg, mode);
   443     d->lastError = reply;       // will clear if reply isn't an error
   445     if (thread() == QThread::currentThread())
       
   446         d->lastError = reply;       // will clear if reply isn't an error
   444 
   447 
   445     // ensure that there is at least one element
   448     // ensure that there is at least one element
   446     if (reply.arguments().isEmpty())
   449     if (reply.arguments().isEmpty())
   447         reply << QVariant();
   450         reply << QVariant();
   448 
   451