summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-18 11:24:05 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-18 11:24:05 (GMT)
commitc18beac8163634b48bbf1e7280923e96f5ef0a51 (patch)
treeae6d5d595d1b46bcaa721efc95c98c97e078d214 /src/dbus
parentfd3f9dd0f31efeea3aa0ec28b54c70d85712c7ba (diff)
parenteeb121d54e345e92ab74d8c43e07d803a0e144ea (diff)
downloadQt-c18beac8163634b48bbf1e7280923e96f5ef0a51.zip
Qt-c18beac8163634b48bbf1e7280923e96f5ef0a51.tar.gz
Qt-c18beac8163634b48bbf1e7280923e96f5ef0a51.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (62 commits) Compile. Remove these friend declarations that aren't necessary in 4.7 Added a new flag to fine-tune gesture propagation policy AIX has a #define for hz, so undef it Revert "remove -lz from OPENSSL_LIBS so as to respect qt-zlib" remove -lz from QT_LFLAGS_PSQL so as to respect qt-zlib remove -lz from OPENSSL_LIBS so as to respect qt-zlib Fix compilation with IBM xlC 7: Fix compilation of Qt Assistant when WebKit isn't built. Mac: QSystemTrayIcon::DoubleClick and midmouse not working add test for toDateTime() using QLocale::LongFormat remove debug info add test case for QTBUG-7898 that QLocale::toDateTime(QString, FormatType) cannot convert value correctly fix QTBUG-7898 QNAM HTTP: More micro optimization in QHttpNetworkRequest QNAM HTTP: Some micro optimization in QHttpNetworkRequest QNAM HTTP: Trivial optimization Revert "Optimized QLocale to access system locale on demand." doc: Added "\sa {QML Basic Types} to each QML basic type page. Incorrect mouse coordinates used when compressing WM_MOUSEMOVE messages. ...
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbus_symbols_p.h5
-rw-r--r--src/dbus/qdbusmessage.cpp42
-rw-r--r--src/dbus/qdbusmessage.h3
-rw-r--r--src/dbus/qdbusmessage_p.h1
4 files changed, 50 insertions, 1 deletions
diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h
index 9ea05b2..7168e05 100644
--- a/src/dbus/qdbus_symbols_p.h
+++ b/src/dbus/qdbus_symbols_p.h
@@ -196,6 +196,8 @@ DEFINEFUNC(void , dbus_free, (void *memory), (memory), )
/* dbus-message.h */
DEFINEFUNC(DBusMessage* , dbus_message_copy, (const DBusMessage *message),
(message), return)
+DEFINEFUNC(dbus_bool_t , dbus_message_get_auto_start, (DBusMessage *message),
+ (message), return)
DEFINEFUNC(const char* , dbus_message_get_error_name, (DBusMessage *message),
(message), return)
DEFINEFUNC(const char* , dbus_message_get_interface, (DBusMessage *message),
@@ -268,6 +270,9 @@ DEFINEFUNC(DBusMessage* , dbus_message_new_signal, (const char *path,
(path, interface, name), return)
DEFINEFUNC(DBusMessage* , dbus_message_ref, (DBusMessage *message),
(message), return)
+DEFINEFUNC(void , dbus_message_set_auto_start, (DBusMessage *message,
+ dbus_bool_t auto_start),
+ (message, auto_start), return)
DEFINEFUNC(dbus_bool_t , dbus_message_set_destination, (DBusMessage *message,
const char *destination),
(message, destination), return)
diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp
index 83b5503..30ddc61 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), autoStartService(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->autoStartService );
break;
case DBUS_MESSAGE_TYPE_METHOD_RETURN:
msg = q_dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
@@ -644,6 +645,45 @@ bool QDBusMessage::isDelayedReply() const
}
/*!
+ Sets the auto start flag to \a enable. This flag only makes sense
+ for method call messages, where it tells the D-Bus server to
+ either auto start the service responsible for the service name, or
+ not to auto start it.
+
+ By default this flag is true, i.e. a service is autostarted.
+ This means:
+
+ When the service that this method call is sent to is already
+ running, the method call is sent to it. If the service is not
+ running yet, the D-Bus daemon is requested to autostart the
+ service that is assigned to this service name. This is
+ handled by .service files that are placed in a directory known
+ to the D-Bus server. These files then each contain a service
+ name and the path to a program that should be executed when
+ this service name is requested.
+
+ \since 4.7
+*/
+void QDBusMessage::setAutoStartService(bool enable)
+{
+ d_ptr->autoStartService = enable;
+}
+
+/*!
+ Returns the auto start flag, as set by setAutoStartService(). By default, this
+ flag is true, which means QtDBus will auto start a service, if it is
+ not running already.
+
+ \sa setAutoStartService()
+
+ \since 4.7
+*/
+bool QDBusMessage::autoStartService() const
+{
+ return d_ptr->autoStartService;
+}
+
+/*!
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.
diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h
index 1a85983..6df5215 100644
--- a/src/dbus/qdbusmessage.h
+++ b/src/dbus/qdbusmessage.h
@@ -104,6 +104,9 @@ public:
void setDelayedReply(bool enable) const;
bool isDelayedReply() const;
+ void setAutoStartService(bool enable);
+ bool autoStartService() const;
+
void setArguments(const QList<QVariant> &arguments);
QList<QVariant> arguments() const;
diff --git a/src/dbus/qdbusmessage_p.h b/src/dbus/qdbusmessage_p.h
index 6bf5448..b6da4a5 100644
--- a/src/dbus/qdbusmessage_p.h
+++ b/src/dbus/qdbusmessage_p.h
@@ -85,6 +85,7 @@ public:
mutable uint delayedReply : 1;
uint localMessage : 1;
mutable uint parametersValidated : 1;
+ uint autoStartService : 1;
static void setParametersValidated(QDBusMessage &msg, bool enable)
{ msg.d_ptr->parametersValidated = enable; }