diff options
Diffstat (limited to 'src/tools/dbusxml2qt3/main.cpp')
-rw-r--r-- | src/tools/dbusxml2qt3/main.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/tools/dbusxml2qt3/main.cpp b/src/tools/dbusxml2qt3/main.cpp index 763c998..22bdd78 100644 --- a/src/tools/dbusxml2qt3/main.cpp +++ b/src/tools/dbusxml2qt3/main.cpp @@ -201,25 +201,26 @@ int main(int argc, char** argv) TQValueList<Class>::const_iterator endIt = interfaces.end(); for (; it != endIt; ++it) { + TQString streamName = (*it).name.lower() + "Interface"; if (baseName.isEmpty()) { - if (!ClassGenerator::initStreams((*it).name.lower() + "Interface", - headerStream, sourceStream)) + if (!ClassGenerator::initStreams(streamName, headerStream, sourceStream)) { std::cerr << "dbusxml2qt3: interface files, using base name '" - << baseName.local8Bit().data() + << streamName.local8Bit().data() << "', could not be opened for writing" << std::endl; exit(4); } } - ClassGenerator::generateInterface(*it, headerStream, sourceStream); + Class interfaceData = *it; + interfaceData.name += "Interface"; + ClassGenerator::generateInterface(interfaceData, headerStream, sourceStream); if (baseName.isEmpty()) { - ClassGenerator::finishStreams((*it).name.lower() + "Interface", - headerStream, sourceStream); + ClassGenerator::finishStreams(streamName, headerStream, sourceStream); } } @@ -249,26 +250,27 @@ int main(int argc, char** argv) TQValueList<Class>::const_iterator endIt = interfaces.end(); for (; it != endIt; ++it) { + TQString streamName = (*it).name.lower() + "Proxy"; if (baseName.isEmpty()) { - if (!ClassGenerator::initStreams((*it).name.lower() + "Proxy", - headerStream, sourceStream)) + if (!ClassGenerator::initStreams(streamName, headerStream, sourceStream)) { std::cerr << "dbusxml2qt3: proxy files, using base name '" - << baseName.local8Bit().data() + << streamName.local8Bit().data() << "', could not be opened for writing" << std::endl; exit(4); } } - ClassGenerator::generateProxy(*it, headerStream, sourceStream); + Class proxyData = *it; + proxyData.name += "Proxy"; + ClassGenerator::generateProxy(proxyData, headerStream, sourceStream); if (baseName.isEmpty()) { - ClassGenerator::generateIncludeMoc((*it).name.lower() + "Proxy", sourceStream); - ClassGenerator::finishStreams((*it).name.lower() + "Proxy", - headerStream, sourceStream); + ClassGenerator::generateIncludeMoc(streamName, sourceStream); + ClassGenerator::finishStreams(streamName, headerStream, sourceStream); } } @@ -285,8 +287,10 @@ int main(int argc, char** argv) { tqDebug("Generating org.freedesktop.DBus.Introspectable on demand"); + TQString baseClassName = "Introspectable"; + TQString streamName = baseClassName.lower() + "Interface"; Class classData; - classData.name = "Introspectable"; + classData.name = baseClassName + "Interface"; classData.dbusName = "org.freedesktop.DBus.Introspectable"; classData.namespaces << "org" << "freedesktop" << "DBus"; @@ -313,11 +317,10 @@ int main(int argc, char** argv) TQTextStream headerStream; TQTextStream sourceStream; - if (!ClassGenerator::initStreams(classData.name.lower() + "Interface", - headerStream, sourceStream)) + if (!ClassGenerator::initStreams(streamName, headerStream, sourceStream)) { std::cerr << "dbusxml2qt3: interface files, using base name '" - << classData.name.lower().local8Bit().data() << "Interface" + << streamName.local8Bit().data() << "', could not be opened for writing" << std::endl; exit(4); @@ -326,8 +329,7 @@ int main(int argc, char** argv) ClassGenerator::generateInterface(classData, headerStream, sourceStream); - ClassGenerator::finishStreams(classData.name.lower() + "Interface", - headerStream, sourceStream); + ClassGenerator::finishStreams(streamName, headerStream, sourceStream); } TQString nodeClassName = options["classname"]; |