summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusmessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbus/qdbusmessage.cpp')
-rw-r--r--src/dbus/qdbusmessage.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp
index 83b5503..f9be783 100644
--- a/src/dbus/qdbusmessage.cpp
+++ b/src/dbus/qdbusmessage.cpp
@@ -63,7 +63,7 @@ static inline const char *data(const QByteArray &arr)
QDBusMessagePrivate::QDBusMessagePrivate()
: msg(0), reply(0), type(DBUS_MESSAGE_TYPE_INVALID),
timeout(-1), localReply(0), ref(1), delayedReply(false), localMessage(false),
- parametersValidated(false)
+ parametersValidated(false), autoStart(true)
{
}
@@ -129,6 +129,7 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDB
msg = q_dbus_message_new_method_call(data(d_ptr->service.toUtf8()), d_ptr->path.toUtf8(),
data(d_ptr->interface.toUtf8()), d_ptr->name.toUtf8());
+ q_dbus_message_set_auto_start( msg, d_ptr->autoStart );
break;
case DBUS_MESSAGE_TYPE_METHOD_RETURN:
msg = q_dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
@@ -644,6 +645,30 @@ bool QDBusMessage::isDelayedReply() const
}
/*!
+ Sets whether this message will have the auto start flag.
+ This flag only makes sense for method call messages. For
+ these messages it tells the dbus server to either auto
+ start the service responsible for the service name, or
+ not to auto start it.
+
+ This flag is true by default.
+*/
+void QDBusMessage::setAutoStart(bool enable) const
+{
+ d_ptr->autoStart = enable;
+}
+
+/*!
+ Returns the auto start flag, as set by setAutoStart(). By default, this
+ flag is true, which means QtDBus will auto start a service, if it is
+ not running already.
+*/
+bool QDBusMessage::isAutoStart() const
+{
+ return d_ptr->autoStart;
+}
+
+/*!
Sets the arguments that are going to be sent over D-Bus to \a arguments. Those
will be the arguments to a method call or the parameters in the signal.