From 517b8c2446029901e9062e858b723906cf20d7ef Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 5 Jun 2006 18:13:07 +0000 Subject: * 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. --- qt/src/qdbusxmlgenerator.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'qt/src/qdbusxmlgenerator.cpp') diff --git a/qt/src/qdbusxmlgenerator.cpp b/qt/src/qdbusxmlgenerator.cpp index cbd5388b..135b8d1c 100644 --- a/qt/src/qdbusxmlgenerator.cpp +++ b/qt/src/qdbusxmlgenerator.cpp @@ -62,7 +62,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method continue; retval += QString(QLatin1String(" \n")) - .arg(mp.name()) + .arg(QLatin1String(mp.name())) .arg(QLatin1String( QDBusUtil::typeToSignature( QVariant::Type(typeId) ))) .arg(QLatin1String( accessvalues[access] )); } @@ -165,7 +165,8 @@ QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, con 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 @@ QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, con 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); } } } -- cgit