Adjusting class name moved from generators to caller.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/16/head
Slávek Banko 6 years ago
parent d3ff70c037
commit 20daa8eecb
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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

@ -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"];

Loading…
Cancel
Save