summaryrefslogtreecommitdiffstats
path: root/qt/src/qdbusxmlgenerator.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago@kde.org>2006-06-05 18:13:07 +0000
committerThiago Macieira <thiago@kde.org>2006-06-05 18:13:07 +0000
commit517b8c2446029901e9062e858b723906cf20d7ef (patch)
tree61a02acb1f4769993c985d7a0aa91fab9c2694c7 /qt/src/qdbusxmlgenerator.cpp
parent54b762aa4c692596f70892f7fb3d7e495bd8268a (diff)
* 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.
Diffstat (limited to 'qt/src/qdbusxmlgenerator.cpp')
-rw-r--r--qt/src/qdbusxmlgenerator.cpp16
1 files changed, 11 insertions, 5 deletions
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(" <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 @@ 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);
}
}
}