dbus/qt/src qdbusabstractadaptor.cpp, 1.1, 1.2 qdbusabstractinterface.cpp, 1.1, 1.2 qdbusbus.cpp, 1.1, 1.2 qdbusbus.h, 1.1, 1.2 qdbusconnection.cpp, 1.1, 1.2 qdbusconnection.h, 1.1, 1.2 qdbuserror.cpp, 1.1, 1.2 qdbuserror.h, 1.1, 1.2 qdbusintegrator.cpp, 1.1, 1.2 qdbusinterface.cpp, 1.1, 1.2 qdbusinternalfilters.cpp, 1.1, 1.2 qdbusmessage.cpp, 1.1, 1.2 qdbusmessage.h, 1.1, 1.2 qdbusmetaobject.cpp, 1.1, 1.2 qdbusreply.h, 1.1, 1.2 qdbusserver.cpp, 1.1, 1.2 qdbusutil.cpp, 1.1, 1.2 qdbusxmlgenerator.cpp, 1.1, 1.2 qdbusxmlparser.cpp, 1.1, 1.2

Thiago J. Macieira thiago at kemper.freedesktop.org
Mon Jun 5 11:13:10 PDT 2006


Update of /cvs/dbus/dbus/qt/src
In directory kemper:/tmp/cvs-serv17133/qt/src

Modified Files:
	qdbusabstractadaptor.cpp qdbusabstractinterface.cpp 
	qdbusbus.cpp qdbusbus.h qdbusconnection.cpp qdbusconnection.h 
	qdbuserror.cpp qdbuserror.h qdbusintegrator.cpp 
	qdbusinterface.cpp qdbusinternalfilters.cpp qdbusmessage.cpp 
	qdbusmessage.h qdbusmetaobject.cpp qdbusreply.h 
	qdbusserver.cpp qdbusutil.cpp qdbusxmlgenerator.cpp 
	qdbusxmlparser.cpp 
Log Message:
	* qt/dbus: Add directory. I had forgotten to add this
	yesterday after the move...

	* qt/examples/Makefile.am:
	* qt/examples/dbus.cpp: Moved to qt/tools/dbus.cpp.

	* qt/tools/Makefile.am:
	* qt/tools/dbus.cpp: Moved from qt/examples/dbus.cpp.
	Added feature to get and set properties.
	Added validation of service, object path and interface names.

	* qt/tools/dbusidl2cpp.cpp: Two new features:
	1) Allow specifying both the header and the source file names,
	by separating them with a colon.
	2) Don't write an interface output if the -p switch wasn't
	given, but the -a was.

	* qt/src/*: Fix usage of Iterators and ConstIterators.
	Fix shadowing of variables by other variables (-Wshadow).
	Fix keyword-cleanliness in headers.
	Fix ASCII-cast (QLatin1String, QLatin1Char).
	Fix validation of member names.
	Add extra checking of introspection data during XML parsing.
	Various bug fixes.


Index: qdbusabstractadaptor.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusabstractadaptor.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusabstractadaptor.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusabstractadaptor.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -88,8 +88,7 @@
 }
 
 /*!
-    \page usingannotations.html
-    \title Using annotations in adaptors
+    \page usingannotations.html Using annotations in adaptors
 
     It is currently not possible to specify arbitrary annotations in adaptors.
 */
@@ -121,12 +120,12 @@
 */
 
 /*!
-    Constructs a QDBusAbstractAdaptor with \a parent as the object we refer to.
+    Constructs a QDBusAbstractAdaptor with \a obj as the parent object.
 */
-QDBusAbstractAdaptor::QDBusAbstractAdaptor(QObject* parent)
-    : QObject(parent), d(new QDBusAbstractAdaptorPrivate)
+QDBusAbstractAdaptor::QDBusAbstractAdaptor(QObject* obj)
+    : QObject(obj), d(new QDBusAbstractAdaptorPrivate)
 {
-    QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(parent);
+    QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(obj);
 
     connector->waitingForPolish = true;
     QTimer::singleShot(0, connector, SLOT(polish()));
@@ -181,8 +180,8 @@
     }
 }
 
-QDBusAdaptorConnector::QDBusAdaptorConnector(QObject *parent)
-    : QObject(parent), waitingForPolish(false), lastSignalIdx(0), argv(0)
+QDBusAdaptorConnector::QDBusAdaptorConnector(QObject *obj)
+    : QObject(obj), waitingForPolish(false), lastSignalIdx(0), argv(0)
 {
 }
 
@@ -258,18 +257,18 @@
     relay(sender());
 }
 
-void QDBusAdaptorConnector::relay(QObject *sender)
+void QDBusAdaptorConnector::relay(QObject *senderObj)
 {
     // we're being called because there is a signal being emitted that we must relay
     Q_ASSERT(lastSignalIdx);
     Q_ASSERT(argv);
     Q_ASSERT(senderMetaObject);
 
-    if (senderMetaObject != sender->metaObject()) {
+    if (senderMetaObject != senderObj->metaObject()) {
         qWarning("Inconsistency detected: QDBusAdaptorConnector::relay got called with unexpected sender object!");
     } else {
         QMetaMethod mm = senderMetaObject->method(lastSignalIdx);
-        QObject *object = static_cast<QDBusAbstractAdaptor *>(sender)->parent();
+        QObject *object = static_cast<QDBusAbstractAdaptor *>(senderObj)->parent();
 
         // break down the parameter list
         QList<int> types;

Index: qdbusabstractinterface.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusabstractinterface.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusabstractinterface.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusabstractinterface.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -31,7 +31,8 @@
 QVariant QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp) const
 {
     // try to read this property
-    QDBusMessage msg = QDBusMessage::methodCall(service, path, DBUS_INTERFACE_PROPERTIES,
+    QDBusMessage msg = QDBusMessage::methodCall(service, path,
+                                                QLatin1String(DBUS_INTERFACE_PROPERTIES),
                                                 QLatin1String("Get"));
     msg << interface << QString::fromUtf8(mp.name());
     QDBusMessage reply = connp->sendWithReply(msg, QDBusConnection::NoUseEventLoop);
@@ -72,7 +73,8 @@
 void QDBusAbstractInterfacePrivate::setProperty(const QMetaProperty &mp, const QVariant &value)
 {
     // send the value
-    QDBusMessage msg = QDBusMessage::methodCall(service, path, DBUS_INTERFACE_PROPERTIES,
+    QDBusMessage msg = QDBusMessage::methodCall(service, path,
+                                                QLatin1String(DBUS_INTERFACE_PROPERTIES),
                                                 QLatin1String("Set"));
     msg.setSignature(QLatin1String("ssv"));
     msg << interface << QString::fromUtf8(mp.name()) << value;
@@ -185,7 +187,6 @@
 }
 
 /*!
-    \threadsafe
     Places a call to the remote method specified by \a method on this interface, using \a args as
     arguments. This function returns the message that was received as a reply, which can be a normal
     QDBusMessage::ReplyMessage (indicating success) or QDBusMessage::ErrorMessage (if the call
@@ -199,6 +200,8 @@
     \warning If you use \c UseEventLoop, your code must be prepared to deal with any reentrancy:
              other method calls and signals may be delivered before this function returns, as well
              as other Qt queued signals and events.
+
+    \threadsafe
 */
 QDBusMessage QDBusAbstractInterface::callWithArgs(const QString& method, const QList<QVariant>& args,
                                           CallMode mode)

Index: qdbusbus.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusbus.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusbus.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusbus.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -151,21 +151,21 @@
 }
 
 /*!
-    \fn QDBusBusService::listQueuedOwners(const QString &service)
+    \fn QDBusBusService::listQueuedOwners(const QString &serviceName)
     Returns a list of all unique connection names in queue for the service name \a service.
 */
-QDBusReply<QStringList> QDBusBusService::ListQueuedOwners(const QString &service)
+QDBusReply<QStringList> QDBusBusService::ListQueuedOwners(const QString &serviceName)
 {
-    return call(QLatin1String("ListQueuedOwners.s"), service);
+    return call(QLatin1String("ListQueuedOwners.s"), serviceName);
 }
 
 /*!
-    \fn QDBusBusService::nameHasOwner(const QString &service)
+    \fn QDBusBusService::nameHasOwner(const QString &serviceName)
     Returns true if the service name \a service has an owner.
 */
-QDBusReply<bool> QDBusBusService::NameHasOwner(const QString &service)
+QDBusReply<bool> QDBusBusService::NameHasOwner(const QString &serviceName)
 {
-    return call(QLatin1String("NameHasOwner.s"), service);
+    return call(QLatin1String("NameHasOwner.s"), serviceName);
 }
 
 /*!
@@ -189,31 +189,31 @@
 }
 
 /*!
-    \fn QDBusBusService::connectionSELinuxSecurityContext(const QString &service)
+    \fn QDBusBusService::connectionSELinuxSecurityContext(const QString &serviceName)
     Returns the SELinux security context of the process currently holding the bus service \a
     service.
 */
-QDBusReply<QByteArray> QDBusBusService::GetConnectionSELinuxSecurityContext(const QString &service)
+QDBusReply<QByteArray> QDBusBusService::GetConnectionSELinuxSecurityContext(const QString &serviceName)
 {
-    return call(QLatin1String("GetConnectionSELinuxSecurityContext.s"), service);
+    return call(QLatin1String("GetConnectionSELinuxSecurityContext.s"), serviceName);
 }
 
 /*!
-    \fn QDBusBusService::connectionUnixProcessID(const QString &service)
+    \fn QDBusBusService::connectionUnixProcessID(const QString &serviceName)
     Returns the Unix Process ID (PID) for the process currently holding the bus service \a service.
 */
-QDBusReply<uint> QDBusBusService::GetConnectionUnixProcessID(const QString &service)
+QDBusReply<uint> QDBusBusService::GetConnectionUnixProcessID(const QString &serviceName)
 {
-    return call(QLatin1String("GetConnectionUnixProcessID.s"), service);
+    return call(QLatin1String("GetConnectionUnixProcessID.s"), serviceName);
 }
 
 /*!
-    \fn QDBusBusService::connectionUnixUser(const QString &service)
+    \fn QDBusBusService::connectionUnixUser(const QString &serviceName)
     Returns the Unix User ID (UID) for the process currently holding the bus service \a service.
 */
-QDBusReply<uint> QDBusBusService::GetConnectionUnixUser(const QString &service)
+QDBusReply<uint> QDBusBusService::GetConnectionUnixUser(const QString &serviceName)
 {
-    return call(QLatin1String("GetConnectionUnixUser.s"), service);
+    return call(QLatin1String("GetConnectionUnixUser.s"), serviceName);
 }
 
 /*!
@@ -244,36 +244,36 @@
 { return QVariant::Int; }
 
 /*!
-    \fn QDBusBusService::requestName(const QString &service, RequestNameOptions flags)
+    \fn QDBusBusService::requestName(const QString &serviceName, RequestNameOptions flags)
     Requests the bus service name \a service from the bus. The \a flags parameter specifies how the
     bus server daemon should act when the same name is requested by two different applications.
 
     \sa releaseName()
 */
 QDBusReply<QDBusBusService::RequestNameReply>
-QDBusBusService::RequestName(const QString &service, RequestNameOptions flags)
+QDBusBusService::RequestName(const QString &serviceName, RequestNameOptions flags)
 {
-    return call(QLatin1String("RequestName.su"), service, uint(int(flags)));
+    return call(QLatin1String("RequestName.su"), serviceName, uint(int(flags)));
 }
 
 inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::ReleaseNameReply *)
 { return QVariant::Int; }
 
 /*!
-    \fn QDBusBusService::releaseName(const QString &service)
+    \fn QDBusBusService::releaseName(const QString &serviceName)
     Releases the claim on the bus service name \a service, that had been previously requested with
     requestName(). If this application had ownership of the name, it will be released for other
     applications to claim. If it only had the name queued, it gives up its position in the queue.
 */
 QDBusReply<QDBusBusService::ReleaseNameReply>
-QDBusBusService::ReleaseName(const QString &service)
+QDBusBusService::ReleaseName(const QString &serviceName)
 {
-    return call(QLatin1String("ReleaseName.s"), service);
+    return call(QLatin1String("ReleaseName.s"), serviceName);
 }
 
 // signals
 /*!
-    \fn QDBusBusService::nameAcquired(const QString &service)
+    \fn QDBusBusService::nameAcquired(const QString &serviceName)
 
     This signal is emitted by the D-Bus bus server when the bus service name (unique connection name
     or well-known service name) given by \a service is acquired by this application.
@@ -282,7 +282,7 @@
 */
 
 /*!
-    \fn QDBusBusService::nameLost(const QString &service)
+    \fn QDBusBusService::nameLost(const QString &serviceName)
 
     This signal is emitted by the D-Bus bus server when the application loses ownership of the bus
     service name given by \a service.

Index: qdbusbus.h
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusbus.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusbus.h	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusbus.h	5 Jun 2006 18:13:07 -0000	1.2
@@ -105,14 +105,14 @@
 
     QDBusReply<StartServiceReply> StartServiceByName(const QString &name, uint flags);
 
-signals: // SIGNALS
+Q_SIGNALS: // SIGNALS
     void NameAcquired(const QString &service);
     void NameLost(const QString &service);
     void NameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
 #endif
 
     // Qt-style naming    
-public slots:
+public Q_SLOTS:
     QDBusReply<QString> hello()
     { return Hello(); }
     QDBusReply<void> reloadConfig()
@@ -121,33 +121,33 @@
     QDBusReply<QStringList> listNames()
     { return ListNames(); }
         
-    QDBusReply<bool> nameHasOwner(const QString &service)
-    { return NameHasOwner(service); }
+    QDBusReply<bool> nameHasOwner(const QString &serviceName)
+    { return NameHasOwner(serviceName); }
     QDBusReply<QString> nameOwner(const QString &name)
     { return GetNameOwner(name); }
-    QDBusReply<ReleaseNameReply> releaseName(const QString &service)
-    { return ReleaseName(service); }
-    QDBusReply<RequestNameReply> requestName(const QString &service, RequestNameOptions flags)
-    { return RequestName(service, flags); }
-    QDBusReply<QStringList> listQueuedOwners(const QString &service)
-    { return ListQueuedOwners(service); }
+    QDBusReply<ReleaseNameReply> releaseName(const QString &serviceName)
+    { return ReleaseName(serviceName); }
+    QDBusReply<RequestNameReply> requestName(const QString &serviceName, RequestNameOptions flags)
+    { return RequestName(serviceName, flags); }
+    QDBusReply<QStringList> listQueuedOwners(const QString &serviceName)
+    { return ListQueuedOwners(serviceName); }
 
     QDBusReply<void> addMatch(const QString &rule)
     { return AddMatch(rule); }
     QDBusReply<void> removeMatch(const QString &rule)
     { return RemoveMatch(rule); }
 
-    QDBusReply<QByteArray> connectionSELinuxSecurityContext(const QString &service)
-    { return GetConnectionSELinuxSecurityContext(service); }
-    QDBusReply<uint> connectionUnixProcessID(const QString &service)
-    { return GetConnectionUnixProcessID(service); }
-    QDBusReply<uint> connectionUnixUser(const QString &service)
-    { return GetConnectionUnixUser(service); }
+    QDBusReply<QByteArray> connectionSELinuxSecurityContext(const QString &serviceName)
+    { return GetConnectionSELinuxSecurityContext(serviceName); }
+    QDBusReply<uint> connectionUnixProcessID(const QString &serviceName)
+    { return GetConnectionUnixProcessID(serviceName); }
+    QDBusReply<uint> connectionUnixUser(const QString &serviceName)
+    { return GetConnectionUnixUser(serviceName); }
 
     QDBusReply<StartServiceReply> startServiceByName(const QString &name, uint flags)
     { return StartServiceByName(name, flags); }
 
-signals:
+Q_SIGNALS:
     void nameAcquired(const QString &service);
     void nameLost(const QString &service);
     void nameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);

Index: qdbusconnection.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusconnection.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusconnection.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusconnection.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -294,7 +294,7 @@
     QDBusAbstractInterfacePrivate *p;
     p = retval.findInterface_helper(QLatin1String(DBUS_SERVICE_DBUS),
                                     QLatin1String(DBUS_PATH_DBUS),
-                                    QLatin1String(DBUS_INTERFACE_DBUS));
+                                    DBUS_INTERFACE_DBUS);
     if (p) {
         d->busService = new QDBusBusService(p);
         d->busService->setParent(d); // auto-deletion
@@ -330,7 +330,7 @@
     QDBusAbstractInterfacePrivate *p;
     p = retval.findInterface_helper(QLatin1String(DBUS_SERVICE_DBUS),
                                     QLatin1String(DBUS_PATH_DBUS),
-                                    QLatin1String(DBUS_INTERFACE_DBUS));
+                                    DBUS_INTERFACE_DBUS);
     if (p) {
         d->busService = new QDBusBusService(p);
         d->busService->setParent(d); // auto-deletion
@@ -451,7 +451,7 @@
     // avoid duplicating:
     QWriteLocker locker(&d->lock);
     QDBusConnectionPrivate::SignalHookHash::ConstIterator it = d->signalHooks.find(key);
-    for ( ; it != d->signalHooks.end() && it.key() == key; ++it) {
+    for ( ; it != d->signalHooks.constEnd() && it.key() == key; ++it) {
         const QDBusConnectionPrivate::SignalHook &entry = it.value();
         if (entry.sender == hook.sender &&
             entry.path == hook.path &&
@@ -481,6 +481,8 @@
 */
 bool QDBusConnection::registerObject(const QString &path, QObject *object, RegisterOptions options)
 {
+    Q_ASSERT_X(QDBusUtil::isValidObjectPath(path), "QDBusConnection::registerObject",
+               "Invalid object path given");
     if (!d || !d->connection || !object || !options || !QDBusUtil::isValidObjectPath(path))
         return false;
 
@@ -601,6 +603,12 @@
 QDBusInterface *QDBusConnection::findInterface(const QString& service, const QString& path,
                                                const QString& interface)
 {
+    Q_ASSERT_X(QDBusUtil::isValidBusName(service),
+               "QDBusConnection::findInterface", "Invalid service name");
+    Q_ASSERT_X(QDBusUtil::isValidObjectPath(path),
+               "QDBusConnection::findInterface", "Invalid object path given");
+    Q_ASSERT_X(interface.isEmpty() || QDBusUtil::isValidInterfaceName(interface),
+               "QDBusConnection::findInterface", "Invalid interface name");
     if (!d)
         return 0;
     
@@ -636,24 +644,31 @@
 
 QDBusAbstractInterfacePrivate *
 QDBusConnection::findInterface_helper(const QString &service, const QString &path,
-                                      const QString &interface)
+                                      const char *iface)
 {
+    QString interface = QLatin1String(iface);
+    // service and path can be empty here, but interface can't
+    Q_ASSERT_X(service.isEmpty() || QDBusUtil::isValidBusName(service),
+               "QDBusConnection::findInterface", "Invalid service name");
+    Q_ASSERT_X(path.isEmpty() || QDBusUtil::isValidObjectPath(path),
+               "QDBusConnection::findInterface", "Invalid object path given");
+    Q_ASSERT_X(QDBusUtil::isValidInterfaceName(interface),
+               "QDBusConnection::findInterface", "Invalid interface class!");
     if (!d)
         return 0;
-    if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface))
-        return 0;
-    
+
     QString owner;
     if (!service.isEmpty()) {
-        if (!QDBusUtil::isValidObjectPath(path))
-            return 0;
-
         // check if it's there first -- FIXME: add binding mode
         owner = d->getNameOwner(service);
-        if (owner.isEmpty())
-            return 0;
-    } else if (!path.isEmpty())
-        return 0;
+        if (owner.isEmpty()) {
+            QDBusAbstractInterfacePrivate *p;
+            p = new QDBusAbstractInterfacePrivate(*this, d, service, path, interface);
+            p->isValid = false;
+            p->lastError = d->lastError;
+            return p;
+        }
+    }
     
     return new QDBusAbstractInterfacePrivate(*this, d, owner, path, interface);
 }

Index: qdbusconnection.h
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusconnection.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusconnection.h	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusconnection.h	5 Jun 2006 18:13:07 -0000	1.2
@@ -101,17 +101,17 @@
 
 private:
     QDBusAbstractInterfacePrivate *findInterface_helper(const QString &, const QString &,
-                                                        const QString&);
+                                                        const char*);
     QDBusConnectionPrivate *d;
 };
 
 template<class Interface>
 inline Interface *QDBusConnection::findInterface(const QString &service, const QString &path)
 {
-    register QDBusAbstractInterfacePrivate *d;
-    d = findInterface_helper(service, path, Interface::staticInterfaceName());
-    if (d)
-        return new Interface(d);
+    register QDBusAbstractInterfacePrivate *d_ptr;
+    d_ptr = findInterface_helper(service, path, Interface::staticInterfaceName());
+    if (d_ptr)
+        return new Interface(d_ptr);
     return 0;
 }
 

Index: qdbuserror.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbuserror.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbuserror.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbuserror.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -135,11 +135,11 @@
                                 pre-defined values (\c org.freedesktop.DBus.Error.LimitsExceeded)
     \value AccessDenied         The call/operation tried to access a resource it isn't allowed to
                                 (\c org.freedesktop.DBus.Error.AccessDenied)
-    \value NoServer             \i{Documentation doesn't say what this is for}
+    \value NoServer             \e {Documentation doesn't say what this is for}
                                 (\c org.freedesktop.DBus.Error.NoServer)
-    \value Timeout              \i{Documentation doesn't say what this is for or how it's used}
+    \value Timeout              \e {Documentation doesn't say what this is for or how it's used}
                                 (\c org.freedesktop.DBus.Error.Timeout)
-    \value NoNetwork            \i{Documentation doesn't say what this is for}
+    \value NoNetwork            \e {Documentation doesn't say what this is for}
                                 (\c org.freedesktop.DBus.Error.NoNetwork)
     \value AddressInUse         QDBusServer tried to bind to an address that is already in use
                                 (\c org.freedesktop.DBus.Error.AddressInUse)
@@ -149,7 +149,7 @@
                                 (\c org.freedesktop.DBus.Error.InvalidArgs)
     \value UnknownMethod        The method called was not found in this object/interface with the
                                 given parameters (\c org.freedesktop.DBus.Error.UnknownMethod)
-    \value TimedOut             \i{Documentation doesn't say...}
+    \value TimedOut             \e {Documentation doesn't say...}
                                 (\c org.freedesktop.DBus.Error.TimedOut)
     \value InvalidSignature     The type signature is not valid or compatible
                                 (\c org.freedesktop.DBus.Error.InvalidSignature)
@@ -194,11 +194,11 @@
     \internal
     Constructs a QDBusError from a well-known error code
 */
-QDBusError::QDBusError(KnownErrors error, const QString &message)
+QDBusError::QDBusError(KnownErrors error, const QString &mess)
     : code(error)
 {
-    nm = errorMessages()->get(error);
-    msg = message;
+    nm = QLatin1String(errorMessages()->get(error));
+    msg = mess;
 }
 
 /*!
@@ -233,7 +233,7 @@
     match.
 */
 
-#ifndef QT_NO_DEBUG
+#ifndef QT_NO_DEBUG_STREAM
 QDebug operator<<(QDebug dbg, const QDBusError &msg)
 {
     dbg.nospace() << "QDBusError(" << msg.name() << ", " << msg.message() << ")";

Index: qdbuserror.h
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbuserror.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbuserror.h	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbuserror.h	5 Jun 2006 18:13:07 -0000	1.2
@@ -86,7 +86,7 @@
 inline bool operator!=(const QDBusError &p1, QDBusError::KnownErrors p2)
 { return !(p1 == p2); }
 
-#ifndef QT_NO_DEBUG
+#ifndef QT_NO_DEBUG_STREAM
 QDebug operator<<(QDebug, const QDBusError &);
 #endif
 

Index: qdbusintegrator.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusintegrator.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusintegrator.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusintegrator.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -507,13 +507,13 @@
     {
         const QMetaObject *mo = object->metaObject();
         QDBusTypeList typeList(msg.signature().toUtf8());
-        QByteArray name = msg.name().toUtf8();
+        QByteArray memberName = msg.name().toUtf8();
 
         // find a slot that matches according to the rules above
-        idx = ::findSlot(mo, name, flags, typeList, metaTypes);
+        idx = ::findSlot(mo, memberName, flags, typeList, metaTypes);
         if (idx == -1) {
             // try with no parameters, but with a QDBusMessage
-            idx = ::findSlot(mo, name, flags, QDBusTypeList(), metaTypes);
+            idx = ::findSlot(mo, memberName, flags, QDBusTypeList(), metaTypes);
             if (metaTypes.count() != 2 || metaTypes.at(1) != messageMetaType)
                 return false;
         }
@@ -594,7 +594,7 @@
             const QVariant &in = msg.at(i - 1);
             QVariant &out = auxParameters[auxParameters.count() - 1];
 
-            bool error = false;
+            bool isOk = true;
             if (id == QVariant::List) {
                 int mid = in.userType();
                 // the only conversion possible here is from a specialised QList<T> to QVariantList
@@ -615,7 +615,7 @@
                 else if (mid == QDBusTypeHelper<double>::listId())
                     out = qVariantFromValue(QDBusTypeHelper<double>::toVariantList(in));
                 else
-                    error = true;
+                    isOk = false;
             } else if (in.type() == QVariant::UInt) {
                 if (id == QMetaType::UChar) {
                     uchar uc = in.toUInt();
@@ -624,20 +624,20 @@
                     ushort us = in.toUInt();
                     out = qVariantFromValue(us);
                 } else {
-                    error = true;
+                    isOk = false;
                 }
             } else if (in.type() == QVariant::Int) {
                 if (id == QMetaType::Short) {
                     short s = in.toInt();
                     out = qVariantFromValue(s);
                 } else {
-                    error = true;
+                    isOk = false;
                 }
             } else {
-                error = true;
+                isOk = false;
             }
 
-            if (error)
+            if (!isOk)
                 qFatal("Internal error: got invalid meta type %d when trying to convert to meta type %d",
                        in.userType(), id);
 
@@ -697,10 +697,10 @@
     return;
 }
 
-void QDBusConnectionPrivate::customEvent(QEvent *event)
+void QDBusConnectionPrivate::customEvent(QEvent *e)
 {
     // nothing else should be sending custom events at us
-    CallDeliveryEvent* call = static_cast<CallDeliveryEvent *>(event);
+    CallDeliveryEvent* call = static_cast<CallDeliveryEvent *>(e);
 
     // self check:
     Q_ASSERT(call->conn == this);
@@ -708,8 +708,8 @@
     deliverCall(*call);
 }
 
-QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *parent)
-    : QObject(parent), ref(1), mode(InvalidMode), connection(0), server(0), busService(0)
+QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
+    : QObject(p), ref(1), mode(InvalidMode), connection(0), server(0), busService(0)
 {
     extern bool qDBusInitThreads();
     static const int msgType = registerMessageMetaType();
@@ -845,16 +845,16 @@
     obj->disconnect(this);
 }
 
-void QDBusConnectionPrivate::relaySignal(QObject *obj, const char *interface, const char *name,
+void QDBusConnectionPrivate::relaySignal(QObject *obj, const char *interface, const char *memberName,
                                          const QVariantList &args)
 {
     QReadLocker locker(&lock);
     QDBusMessage message = QDBusMessage::signal(QLatin1String("/"), QLatin1String(interface),
-                                                QLatin1String(name));
+                                                QLatin1String(memberName));
     message += args;
     DBusMessage *msg = message.toDBusMessage();
     if (!msg) {
-        qWarning("Could not emit signal %s.%s", interface, name);
+        qWarning("Could not emit signal %s.%s", interface, memberName);
         return;
     }
 
@@ -910,7 +910,7 @@
     }
     key = mname;
     key.reserve(interface.length() + 1 + mname.length());
-    key += ':';
+    key += QLatin1Char(':');
     key += interface;
 
     if (buildSignature) {
@@ -973,7 +973,7 @@
             QDBusAdaptorConnector::AdaptorMap::ConstIterator it;
             it = qLowerBound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
                              msg.interface());
-            if (it != connector->adaptors.end() && it->interface == msg.interface())
+            if (it != connector->adaptors.constEnd() && it->interface == msg.interface())
                 if (activateCall(it->adaptor, newflags, msg))
                 return true;
         }
@@ -1114,7 +1114,7 @@
 {
     QString key = msg.member();
     key.reserve(key.length() + 1 + msg.interface().length());
-    key += ':';
+    key += QLatin1Char(':');
     key += msg.interface();
 
     QReadLocker locker(&lock);
@@ -1257,9 +1257,9 @@
 }
 
 QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
-                                                   int mode)
+                                                   int sendMode)
 {
-    if (!QCoreApplication::instance() || mode == QDBusConnection::NoUseEventLoop) {
+    if (!QCoreApplication::instance() || sendMode == QDBusConnection::NoUseEventLoop) {
         DBusMessage *msg = message.toDBusMessage();
         if (!msg)
             return QDBusMessage();
@@ -1368,7 +1368,7 @@
     // add it to our list:
     QWriteLocker locker(&lock);
     SignalHookHash::ConstIterator it = signalHooks.find(key);
-    SignalHookHash::ConstIterator end = signalHooks.end();
+    SignalHookHash::ConstIterator end = signalHooks.constEnd();
     for ( ; it != end && it.key() == key; ++it) {
         const SignalHook &entry = it.value();
         if (entry.sender == hook.sender &&
@@ -1415,17 +1415,17 @@
     qWarning("QDBusConnectionPrivate::disconnectRelay called for a signal that was not found");
 }
 
-QString QDBusConnectionPrivate::getNameOwner(const QString& name)
+QString QDBusConnectionPrivate::getNameOwner(const QString& serviceName)
 {
-    if (QDBusUtil::isValidUniqueConnectionName(name))
-        return name;
-    if (!connection || !QDBusUtil::isValidBusName(name))
+    if (QDBusUtil::isValidUniqueConnectionName(serviceName))
+        return serviceName;
+    if (!connection || !QDBusUtil::isValidBusName(serviceName))
         return QString();
 
     QDBusMessage msg = QDBusMessage::methodCall(QLatin1String(DBUS_SERVICE_DBUS),
             QLatin1String(DBUS_PATH_DBUS), QLatin1String(DBUS_INTERFACE_DBUS),
             QLatin1String("GetNameOwner"));
-    msg << name;
+    msg << serviceName;
     QDBusMessage reply = sendWithReply(msg, QDBusConnection::NoUseEventLoop);
     if (!lastError.isValid() && reply.type() == QDBusMessage::ReplyMessage)
         return reply.first().toString();
@@ -1459,12 +1459,14 @@
             else if (owner.isEmpty())
                 p->lastError = QDBusError(QDBusError::ServiceUnknown,
                                           QString(QLatin1String("Service %1 is unknown")).arg(service));
+#if 0                           // caught by Q_ASSERT in QDBusConnection::findInterface
             else if (!QDBusUtil::isValidObjectPath(path))
                 p->lastError = QDBusError(QDBusError::InvalidArgs,
                                           QString(QLatin1String("Object path %1 is invalid")).arg(path));
             else if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface))
                 p->lastError = QDBusError(QDBusError::InvalidArgs,
                                           QString(QLatin1String("Interface %1 is invalid")).arg(interface));
+#endif
             else
                 p->lastError = QDBusError(QDBusError::Other, QLatin1String("Unknown error"));
         }

Index: qdbusinterface.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusinterface.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusinterface.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusinterface.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -75,7 +75,7 @@
     if (!_clname) return 0;
     if (!strcmp(_clname, "QDBusInterface"))
         return static_cast<void*>(const_cast<QDBusInterface*>(this));
-    if (d_func()->interface == _clname)
+    if (d_func()->interface.toLatin1() == _clname)
         return static_cast<void*>(const_cast<QDBusInterface*>(this));
     return QDBusAbstractInterface::qt_metacast(_clname);
 }
@@ -107,7 +107,7 @@
         } else if (mm.methodType() == QMetaMethod::Slot) {
             // method call relay from Qt world to D-Bus world
             // get D-Bus equivalent signature
-            QString methodName = metaObject->dbusNameForMethod(id);
+            QString methodName = QLatin1String(metaObject->dbusNameForMethod(id));
             const int *inputTypes = metaObject->inputTypesForMethod(id);
             const int *outputTypes = metaObject->outputTypesForMethod(id);
 
@@ -191,13 +191,13 @@
 }
 
 QDBusInterfacePtr::QDBusInterfacePtr(QDBusConnection &conn, const QString &service, const QString &path,
-                   const QString &interface)
-    : d(conn.findInterface(service, path, interface))
+                   const QString &iface)
+    : d(conn.findInterface(service, path, iface))
 {
 }
 
-QDBusInterfacePtr::QDBusInterfacePtr(const QString &service, const QString &path, const QString &interface)
-    : d(QDBus::sessionBus().findInterface(service, path, interface))
+QDBusInterfacePtr::QDBusInterfacePtr(const QString &service, const QString &path, const QString &iface)
+    : d(QDBus::sessionBus().findInterface(service, path, iface))
 {
 }
 

Index: qdbusinternalfilters.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusinternalfilters.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusinternalfilters.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusinternalfilters.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -165,7 +165,7 @@
         QDBusAdaptorConnector::AdaptorMap::ConstIterator it;
         it = qLowerBound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
                          interface_name);
-        if (it != connector->adaptors.end() && it->interface == interface_name)
+        if (it != connector->adaptors.constEnd() && it->interface == interface_name)
             value = it->adaptor->property(property_name);
     }
 

Index: qdbusmessage.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusmessage.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusmessage.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusmessage.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -55,12 +55,10 @@
 
     This object can represent any of four different types of messages possible on the bus
     (see MessageType)
-    \list
-      \o Method calls
-      \o Method return values
-      \o Signal emissions
-      \o Error codes
-    \endlist
+    - Method calls
+    - Method return values
+    - Signal emissions
+    - Error codes
 
     Objects of this type are created with the four static functions signal, methodCall,
     methodReply and error.
@@ -432,7 +430,7 @@
 
 /*!
     Sets the signature for the output arguments of this method call to be the value of \a
-    signature. This function has no meaning in other types of messages or when dealing with received
+    sig. This function has no meaning in other types of messages or when dealing with received
     method calls.
 
     A message's signature indicate the type of the parameters to
@@ -442,10 +440,10 @@
     when a variant of type QVariant::Invalid is converted to the type).
 
 */
-void QDBusMessage::setSignature(const QString &signature)
+void QDBusMessage::setSignature(const QString &sig)
 {
     qAtomicDetach(d_ptr);
-    d_ptr->signature = signature;
+    d_ptr->signature = sig;
 }
 
 /*!
@@ -569,7 +567,7 @@
     value.
 */
 
-#ifndef QT_NO_DEBUG
+#ifndef QT_NO_DEBUG_STREAM
 QDebug operator<<(QDebug dbg, QDBusMessage::MessageType t)
 {
     switch (t)

Index: qdbusmessage.h
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusmessage.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusmessage.h	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusmessage.h	5 Jun 2006 18:13:07 -0000	1.2
@@ -91,7 +91,7 @@
     QDBusMessagePrivate *d_ptr;
 };
 
-#ifndef QT_NO_DEBUG
+#ifndef QT_NO_DEBUG_STREAM
 QDebug operator<<(QDebug, const QDBusMessage &);
 #endif
 

Index: qdbusmetaobject.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusmetaobject.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusmetaobject.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusmetaobject.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -154,7 +154,7 @@
                 break;
             }
 
-            mm.inputSignature += arg.type;
+            mm.inputSignature += arg.type.toLatin1();
             mm.inputTypes.append(typeId);
 
             mm.parameters.append(arg.name.toLatin1());
@@ -175,7 +175,7 @@
                 break;
             }
 
-            mm.outputSignature += arg.type;
+            mm.outputSignature += arg.type.toLatin1();
             mm.outputTypes.append(typeId);
 
             if (i == 0) {
@@ -230,7 +230,7 @@
                 break;
             }
 
-            mm.inputSignature += arg.type;
+            mm.inputSignature += arg.type.toLatin1();
             mm.inputTypes.append(typeId);
 
             mm.parameters.append(arg.name.toLatin1());
@@ -297,16 +297,16 @@
     if (className.isEmpty())
         className = QLatin1String("QDBusInterface");
 
-    QVarLengthArray<int> data;
-    data.resize(sizeof(QDBusMetaObjectPrivate) / sizeof(int));
+    QVarLengthArray<int> idata;
+    idata.resize(sizeof(QDBusMetaObjectPrivate) / sizeof(int));
 
-    QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(data.data());
+    QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
     header->revision = 1;
     header->className = 0;
     header->classInfoCount = 0;
     header->classInfoData = 0;
     header->methodCount = methods.count();
-    header->methodData = data.size();
+    header->methodData = idata.size();
     header->propertyCount = properties.count();
     header->propertyData = header->methodData + header->methodCount * 5;
     header->enumeratorCount = 0;
@@ -314,12 +314,12 @@
     header->propertyDBusData = header->propertyData + header->propertyCount * 3;
     header->methodDBusData = header->propertyDBusData + header->propertyCount * intsPerProperty;
 
-    int data_size = data.size() +
+    int data_size = idata.size() +
                     (header->methodCount * (5+intsPerMethod)) +
                     (header->propertyCount * (3+intsPerProperty));
     foreach (const Method &mm, methods)
         data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count();
-    data.resize(data_size + 1);
+    idata.resize(data_size + 1);
 
     char null('\0');
     QByteArray stringdata = className.toLatin1();
@@ -329,7 +329,7 @@
     int offset = header->methodData;
     int signatureOffset = header->methodDBusData;
     int typeidOffset = header->methodDBusData + header->methodCount * intsPerMethod;
-    data[typeidOffset++] = 0;                           // eod
+    idata[typeidOffset++] = 0;                           // eod
 
     // add each method:
     for (QMap<QByteArray, Method>::ConstIterator it = methods.constBegin();
@@ -337,41 +337,41 @@
         // form "prototype\0parameters\0typeName\0tag\0inputSignature\0outputSignature"
         const Method &mm = it.value();
 
-        data[offset++] = stringdata.length();
+        idata[offset++] = stringdata.length();
         stringdata += it.key();                 // prototype
         stringdata += null;
-        data[offset++] = stringdata.length();
+        idata[offset++] = stringdata.length();
         stringdata += mm.parameters;
         stringdata += null;
-        data[offset++] = stringdata.length();
+        idata[offset++] = stringdata.length();
         stringdata += mm.typeName;
         stringdata += null;
-        data[offset++] = stringdata.length();
+        idata[offset++] = stringdata.length();
         stringdata += mm.tag;
         stringdata += null;
-        data[offset++] = mm.flags;
+        idata[offset++] = mm.flags;
 
-        data[signatureOffset++] = stringdata.length();
+        idata[signatureOffset++] = stringdata.length();
         stringdata += mm.inputSignature;
         stringdata += null;
-        data[signatureOffset++] = stringdata.length();
+        idata[signatureOffset++] = stringdata.length();
         stringdata += mm.outputSignature;
         stringdata += null;
 
-        data[signatureOffset++] = typeidOffset;
-        data[typeidOffset++] = mm.inputTypes.count();
-        memcpy(data.data() + typeidOffset, mm.inputTypes.data(), mm.inputTypes.count() * sizeof(int));
+        idata[signatureOffset++] = typeidOffset;
+        idata[typeidOffset++] = mm.inputTypes.count();
+        memcpy(idata.data() + typeidOffset, mm.inputTypes.data(), mm.inputTypes.count() * sizeof(int));
         typeidOffset += mm.inputTypes.count();
 
-        data[signatureOffset++] = typeidOffset;
-        data[typeidOffset++] = mm.outputTypes.count();
-        memcpy(data.data() + typeidOffset, mm.outputTypes.data(), mm.outputTypes.count() * sizeof(int));
+        idata[signatureOffset++] = typeidOffset;
+        idata[typeidOffset++] = mm.outputTypes.count();
+        memcpy(idata.data() + typeidOffset, mm.outputTypes.data(), mm.outputTypes.count() * sizeof(int));
         typeidOffset += mm.outputTypes.count();
     }
 
     Q_ASSERT(offset == header->propertyData);
     Q_ASSERT(signatureOffset == header->methodDBusData + header->methodCount * intsPerMethod);
-    Q_ASSERT(typeidOffset == data.size());
+    Q_ASSERT(typeidOffset == idata.size());
 
     // add each property
     signatureOffset = header->propertyDBusData;
@@ -380,18 +380,18 @@
         const Property &mp = it.value();
 
         // form is "name\0typeName\0signature\0"
-        data[offset++] = stringdata.length();
+        idata[offset++] = stringdata.length();
         stringdata += it.key();                 // name
         stringdata += null;
-        data[offset++] = stringdata.length();
+        idata[offset++] = stringdata.length();
         stringdata += mp.typeName;
         stringdata += null;
-        data[offset++] = mp.flags;
+        idata[offset++] = mp.flags;
 
-        data[signatureOffset++] = stringdata.length();
+        idata[signatureOffset++] = stringdata.length();
         stringdata += mp.signature;
         stringdata += null;
-        data[signatureOffset++] = mp.type;
+        idata[signatureOffset++] = mp.type;
     }
 
     Q_ASSERT(offset == header->propertyDBusData);
@@ -400,8 +400,8 @@
     char *string_data = new char[stringdata.length()];
     memcpy(string_data, stringdata, stringdata.length());
 
-    uint *uint_data = new uint[data.size()];
-    memcpy(uint_data, data.data(), data.size() * sizeof(int));
+    uint *uint_data = new uint[idata.size()];
+    memcpy(uint_data, idata.data(), idata.size() * sizeof(int));
 
     // put the metaobject together
     obj->d.data = uint_data;

Index: qdbusreply.h
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusreply.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusreply.h	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusreply.h	5 Jun 2006 18:13:07 -0000	1.2
@@ -53,13 +53,13 @@
         return *this;
     }
 
-    inline QDBusReply(const QDBusError &error = QDBusError())
-        : m_error(error), m_data(Type())
+    inline QDBusReply(const QDBusError &dbusError = QDBusError())
+        : m_error(dbusError), m_data(Type())
     {
     }
-    inline QDBusReply& operator=(const QDBusError& error)
+    inline QDBusReply& operator=(const QDBusError& dbusError)
     {
-        m_error = error;
+        m_error = dbusError;
         m_data = Type();
         return *this;
     }
@@ -114,8 +114,8 @@
         : m_error(reply)
     {
     }
-    inline QDBusReply(const QDBusError &error)
-        : m_error(error)
+    inline QDBusReply(const QDBusError &dbusError)
+        : m_error(dbusError)
     {
     }    
 

Index: qdbusserver.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusserver.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusserver.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusserver.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -25,8 +25,8 @@
 #include "qdbusserver.h"
 #include "qdbusconnection_p.h"
 
-QDBusServer::QDBusServer(const QString &addr, QObject *parent)
-    : QObject(parent)
+QDBusServer::QDBusServer(const QString &addr, QObject *p)
+    : QObject(p)
 {
     d = new QDBusConnectionPrivate(this);
 

Index: qdbusutil.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusutil.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusutil.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusutil.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -42,13 +42,11 @@
         Returns true if this is \a ifaceName is a valid interface name.
 
         Valid interface names must:
-        \list
-          \o not be empty
-          \o not exceed 255 characters in length
-          \o be composed of dot-separated string components that contain only ASCII letters, digits
-             and the underscore ("_") character
-          \o contain at least two such components
-        \endlist
+	- not be empty
+	- not exceed 255 characters in length
+	- be composed of dot-separated string components that contain only ASCII letters, digits
+	  and the underscore ("_") character
+        - contain at least two such components
     */
     bool isValidInterfaceName(const QString& ifaceName)
     {
@@ -96,13 +94,11 @@
         Returns true if \a busName is a valid bus name.
 
         A valid bus name is either a valid unique connection name or follows the rules:
-        \list
-          \o is not empty
-          \o does not exceed 255 characters in length
-          \o be composed of dot-separated string components that contain only ASCII letters, digits,
-             hyphens or underscores ("_"), but don't start with a digit
-          \o contains at least two such elements
-        \endlist
+	- is not empty
+	- does not exceed 255 characters in length
+	- be composed of dot-separated string components that contain only ASCII letters, digits,
+	  hyphens or underscores ("_"), but don't start with a digit
+        - contains at least two such elements
 
         \sa isValidUniqueConnectionName()
     */
@@ -137,7 +133,7 @@
         if (memberName.isEmpty() || memberName.length() > DBUS_MAXIMUM_NAME_LENGTH)
             return false;
 
-        QRegExp regex(QLatin1String("[a-zA-Z_][a-zA-Z0-9_]+"));
+        QRegExp regex(QLatin1String("[a-zA-Z_][a-zA-Z0-9_]*"));
         return regex.exactMatch(memberName);
     }
 
@@ -156,13 +152,11 @@
         Returns true if \a path is valid object path.
 
         Valid object paths follow the rules:
-        \list
-          \o start with the slash character ("/")
-          \o do not end in a slash, unless the path is just the initial slash
-          \o do not contain any two slashes in sequence
-          \o contain slash-separated parts, each of which is composed of ASCII letters, digits and
-             underscores ("_")
-        \endlist
+	- start with the slash character ("/")
+	- do not end in a slash, unless the path is just the initial slash
+	- do not contain any two slashes in sequence
+	- contain slash-separated parts, each of which is composed of ASCII letters, digits and
+	  underscores ("_")
     */
     bool isValidObjectPath(const QString &path)
     {

Index: qdbusxmlgenerator.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusxmlgenerator.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusxmlgenerator.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusxmlgenerator.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -62,7 +62,7 @@
                 continue;
 
             retval += QString(QLatin1String("    <property name=\"%1\" type=\"%2\" access=\"%3\" />\n"))
-                      .arg(mp.name())
+                      .arg(QLatin1String(mp.name()))
                       .arg(QLatin1String( QDBusUtil::typeToSignature( QVariant::Type(typeId) )))
                       .arg(QLatin1String( accessvalues[access] ));
         }
@@ -165,7 +165,8 @@
 
             if (interface.startsWith( QLatin1String("QDBus") )) {
                 interface.prepend( QLatin1String("com.trolltech.QtDBus.") );
-            } else if (interface.startsWith( QLatin1Char('Q') )) {
+            } else if (interface.startsWith( QLatin1Char('Q') ) &&
+                       interface.length() >= 2 && interface.at(1).isUpper()) {
                 // assume it's Qt
                 interface.prepend( QLatin1String("com.trolltech.Qt.") );
             } else if (!QCoreApplication::instance() ||
@@ -173,9 +174,14 @@
                 interface.prepend( QLatin1String("local.") );
             } else {
                 interface.prepend(QLatin1Char('.')).prepend( QCoreApplication::instance()->applicationName() );
-                QStringList domainName = QCoreApplication::instance()->organizationDomain().split(QLatin1Char('.'));
-                foreach (const QString &part, domainName)
-                    interface.prepend(QLatin1Char('.')).prepend(part);
+                QStringList domainName =
+                    QCoreApplication::instance()->organizationDomain().split(QLatin1Char('.'),
+                                                                             QString::SkipEmptyParts);
+                if (domainName.isEmpty())
+                    interface.prepend("local.");
+                else
+                    foreach (const QString &part, domainName)
+                        interface.prepend(QLatin1Char('.')).prepend(part);
             }
         }
     }

Index: qdbusxmlparser.cpp
===================================================================
RCS file: /cvs/dbus/dbus/qt/src/qdbusxmlparser.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qdbusxmlparser.cpp	4 Jun 2006 15:52:05 -0000	1.1
+++ qdbusxmlparser.cpp	5 Jun 2006 18:13:07 -0000	1.2
@@ -47,8 +47,11 @@
         QString name = ann.attribute(QLatin1String("name")),
                value = ann.attribute(QLatin1String("value"));
 
-        if (name.isEmpty())
+        if (!QDBusUtil::isValidInterfaceName(name)) {
+            qWarning("Invalid D-BUS annotation '%s' found while parsing introspection",
+                     qPrintable(name));
             continue;
+        }
 
         retval.insert(name, value);
     }
@@ -74,8 +77,11 @@
             if (arg.hasAttribute(QLatin1String("name")))
                 argData.name = arg.attribute(QLatin1String("name")); // can be empty
             argData.type = arg.attribute(QLatin1String("type"));
-            if (!QDBusUtil::isValidSingleSignature(argData.type))
+            if (!QDBusUtil::isValidSingleSignature(argData.type)) {
+                qWarning("Invalid D-BUS type signature '%s' found while parsing introspection",
+                         qPrintable(argData.type));
                 continue;
+            }
 
             retval << argData;
         }
@@ -106,13 +112,18 @@
     if (m_node.isNull())
         return retval;
 
-    QDomNodeList interfaces = m_node.elementsByTagName(QLatin1String("interface"));
-    for (int i = 0; i < interfaces.count(); ++i)
+    QDomNodeList interfaceList = m_node.elementsByTagName(QLatin1String("interface"));
+    for (int i = 0; i < interfaceList.count(); ++i)
     {
-        QDomElement iface = interfaces.item(i).toElement();
+        QDomElement iface = interfaceList.item(i).toElement();
         QString ifaceName = iface.attribute(QLatin1String("name"));
-        if (iface.isNull() || ifaceName.isEmpty())
+        if (iface.isNull())
             continue;           // for whatever reason
+        if (!QDBusUtil::isValidInterfaceName(ifaceName)) {
+            qWarning("Invalid D-BUS interface name '%s' found while parsing introspection",
+                     qPrintable(ifaceName));
+            continue;
+        }
 
         QDBusIntrospection::Interface *ifaceData = new QDBusIntrospection::Interface;
         ifaceData->name = ifaceName;
@@ -131,8 +142,13 @@
         {
             QDomElement method = list.item(j).toElement();
             QString methodName = method.attribute(QLatin1String("name"));
-            if (method.isNull() || methodName.isEmpty())
+            if (method.isNull())
                 continue;
+            if (!QDBusUtil::isValidMemberName(methodName)) {
+                qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
+                         qPrintable(methodName), qPrintable(ifaceName));
+                continue;
+            }
 
             QDBusIntrospection::Method methodData;
             methodData.name = methodName;
@@ -152,8 +168,13 @@
         {
             QDomElement signal = list.item(j).toElement();
             QString signalName = signal.attribute(QLatin1String("name"));
-            if (signal.isNull() || signalName.isEmpty())
+            if (signal.isNull())
                 continue;
+            if (!QDBusUtil::isValidMemberName(signalName)) {
+                qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
+                         qPrintable(signalName), qPrintable(ifaceName));
+                continue;
+            }
 
             QDBusIntrospection::Signal signalData;
             signalData.name = signalName;
@@ -172,8 +193,13 @@
         {
             QDomElement property = list.item(j).toElement();
             QString propertyName = property.attribute(QLatin1String("name"));
-            if (property.isNull() || propertyName.isEmpty())
+            if (property.isNull())
+                continue;
+            if (!QDBusUtil::isValidMemberName(propertyName)) {
+                qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
+                         qPrintable(propertyName), qPrintable(ifaceName));
                 continue;
+            }
 
             QDBusIntrospection::Property propertyData;
 
@@ -182,22 +208,27 @@
             propertyData.type = property.attribute(QLatin1String("type"));
             propertyData.annotations = parseAnnotations(property);
 
-            if (!QDBusUtil::isValidSingleSignature(propertyData.type))
+            if (!QDBusUtil::isValidSingleSignature(propertyData.type)) {
                 // cannot be!
+                qWarning("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection",
+                         qPrintable(propertyData.type), qPrintable(ifaceName),
+                         qPrintable(propertyName));
                 continue;
+            }
 
             QString access = property.attribute(QLatin1String("access"));
-            if (access.isEmpty())
-                // can't be empty either!
-                continue;
-            else if (access == QLatin1String("read"))
+            if (access == QLatin1String("read"))
                 propertyData.access = QDBusIntrospection::Property::Read;
             else if (access == QLatin1String("write"))
                 propertyData.access = QDBusIntrospection::Property::Write;
             else if (access == QLatin1String("readwrite"))
                 propertyData.access = QDBusIntrospection::Property::ReadWrite;
-            else
+            else {
+                qWarning("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection",
+                         qPrintable(access), qPrintable(ifaceName),
+                         qPrintable(propertyName));
                 continue;       // invalid one!
+            }
 
             // add it
             ifaceData->properties.insert(propertyName, propertyData);
@@ -231,18 +262,28 @@
         for (int i = 0; i < objects.count(); ++i) {
             QDomElement obj = objects.item(i).toElement();
             QString objName = obj.attribute(QLatin1String("name"));
-            if (obj.isNull() || objName.isEmpty())
+            if (obj.isNull())
                 continue;           // for whatever reason
+            if (!QDBusUtil::isValidObjectPath(m_path + QLatin1Char('/') + objName)) {
+                qWarning("Invalid D-BUS object path '%s/%s' found while parsing introspection",
+                         qPrintable(m_path), qPrintable(objName));
+                continue;
+            }
 
             objData->childObjects.append(objName);
         }
 
-        QDomNodeList interfaces = m_node.elementsByTagName(QLatin1String("interface"));
-        for (int i = 0; i < interfaces.count(); ++i) {
-            QDomElement iface = interfaces.item(i).toElement();
+        QDomNodeList interfaceList = m_node.elementsByTagName(QLatin1String("interface"));
+        for (int i = 0; i < interfaceList.count(); ++i) {
+            QDomElement iface = interfaceList.item(i).toElement();
             QString ifaceName = iface.attribute(QLatin1String("name"));
-            if (iface.isNull() || ifaceName.isEmpty())
+            if (iface.isNull())
+                continue;
+            if (!QDBusUtil::isValidInterfaceName(ifaceName)) {
+                qWarning("Invalid D-BUS interface name '%s' found while parsing introspection",
+                         qPrintable(ifaceName));
                 continue;
+            }
 
             objData->interfaces.append(ifaceName);
         }
@@ -287,8 +328,8 @@
         if (!obj.firstChild().isNull()) {
             // yes, introspect this object
             QString xml;
-            QTextStream ts(&xml);
-            obj.save(ts,0);
+            QTextStream ts2(&xml);
+            obj.save(ts2,0);
 
             // parse it
             QString objAbsName = m_path;



More information about the dbus-commit mailing list