summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-04-30 18:23:59 +0200
committerSlávek Banko <slavek.banko@axis.cz>2019-04-30 18:23:59 +0200
commit20daa8eecb0f04133aad4771d88076c349fcefd6 (patch)
tree3c5a914769cb4efe137764b42a73a813f41ba92a /src
parentd3ff70c037825a37a7c40f12955397ad063f91f7 (diff)
downloaddbus-1-tqt-20daa8eecb0f04133aad4771d88076c349fcefd6.tar.gz
dbus-1-tqt-20daa8eecb0f04133aad4771d88076c349fcefd6.zip
Adjusting class name moved from generators to caller.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'src')
-rw-r--r--src/tools/dbusxml2qt3/classgen.cpp2
-rw-r--r--src/tools/dbusxml2qt3/main.cpp40
2 files changed, 21 insertions, 21 deletions
diff --git a/src/tools/dbusxml2qt3/classgen.cpp b/src/tools/dbusxml2qt3/classgen.cpp
index c410d45..d4ca679 100644
--- a/src/tools/dbusxml2qt3/classgen.cpp
+++ b/src/tools/dbusxml2qt3/classgen.cpp
@@ -990,7 +990,6 @@ bool ClassGenerator::generateInterface(const Class& classData,
TQTextStream& sourceStream)
{
Class classDataCopy = classData;
- classDataCopy.name += "Interface";
splitAsyncInterfaceMethods(classDataCopy);
// create header
@@ -1029,7 +1028,6 @@ bool ClassGenerator::generateProxy(const Class& classData,
TQTextStream& sourceStream)
{
Class classDataCopy = classData;
- classDataCopy.name += "Proxy";
splitAsyncProxyMethods(classDataCopy);
// create header
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"];