diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-06-30 20:50:32 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-02 11:43:25 +0200 |
commit | 11ef1b9bae383c46f7893db0d26c99d354642609 (patch) | |
tree | b86f5fb5a09a21f11149e62c4e8bd04c6705ea0e /src/dbus/qdbusxmlgenerator.cpp | |
parent | 353dacb5e4c45e860ae8be228df9647c5a71093e (diff) | |
download | qt4-tools-11ef1b9bae383c46f7893db0d26c99d354642609.tar.gz |
Add a function to check if an interface is implemented by an object.
Also reorganise a bit, moving the function to create the interface
name from an object's class name to qdbusmisc.cpp too.
Reviewed-By: Trust Me
Diffstat (limited to 'src/dbus/qdbusxmlgenerator.cpp')
-rw-r--r-- | src/dbus/qdbusxmlgenerator.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp index 82bd762e88..b426abdf5a 100644 --- a/src/dbus/qdbusxmlgenerator.cpp +++ b/src/dbus/qdbusxmlgenerator.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include <QtCore/qcoreapplication.h> #include <QtCore/qmetaobject.h> #include <QtCore/qstringlist.h> @@ -232,42 +231,6 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method return retval; } -QString qDBusInterfaceFromMetaObject(const QMetaObject *mo) -{ - QString interface; - - int idx = mo->indexOfClassInfo(QCLASSINFO_DBUS_INTERFACE); - if (idx >= mo->classInfoOffset()) { - interface = QLatin1String(mo->classInfo(idx).value()); - } else { - interface = QLatin1String(mo->className()); - interface.replace(QLatin1String("::"), QLatin1String(".")); - - if (interface.startsWith(QLatin1String("QDBus"))) { - interface.prepend(QLatin1String("com.trolltech.QtDBus.")); - } 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()|| - QCoreApplication::instance()->applicationName().isEmpty()) { - interface.prepend(QLatin1String("local.")); - } else { - interface.prepend(QLatin1Char('.')).prepend(QCoreApplication::instance()->applicationName()); - QStringList domainName = - QCoreApplication::instance()->organizationDomain().split(QLatin1Char('.'), - QString::SkipEmptyParts); - if (domainName.isEmpty()) - interface.prepend(QLatin1String("local.")); - else - for (int i = 0; i < domainName.count(); ++i) - interface.prepend(QLatin1Char('.')).prepend(domainName.at(i)); - } - } - - return interface; - } - QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, const QMetaObject *base, int flags) { |