Fixed previous commit. The name of the included moc file needs to be taken from the specified basename when available. The location of

the function call was also wrong.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/16/head
Michele Calgaro 6 years ago
parent 318a0abf7f
commit 415cca8630
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -102,12 +102,6 @@ static void closeNamespaces(const TQStringList& namespaces, TQTextStream& stream
}
}
static void writeIncludeMoc(const TQString& className, TQTextStream& stream)
{
stream << "#include \"" << className.lower() << "Proxy.moc\"" << endl;
stream << endl;
}
static void writeIncludes(const TQString& description, const TQStringList& includes,
TQTextStream& stream)
{
@ -1062,8 +1056,6 @@ bool ClassGenerator::generateProxy(const Class& classData,
closeNamespaces(classDataCopy.namespaces, sourceStream);
writeIncludeMoc(classData.name, sourceStream);
return true;
}
@ -1098,4 +1090,11 @@ bool ClassGenerator::generateNode(const Class& classData,
return true;
}
bool ClassGenerator::generateIncludeMoc(const TQString& baseName, TQTextStream& stream)
{
stream << "#include \"" << baseName << ".moc\"" << endl;
stream << endl;
return true;
}
// End of File

@ -47,6 +47,7 @@ public:
static bool generateNode(const Class& classData,
const TQValueList<Class>& interfaces,
TQTextStream& headerStream, TQTextStream& sourceStream);
static bool generateIncludeMoc(const TQString& baseName, TQTextStream& sourceStream);
};
#endif

@ -264,13 +264,17 @@ int main(int argc, char** argv)
if (baseName.isEmpty())
{
ClassGenerator::generateIncludeMoc((*it).name.lower() + "Proxy", sourceStream);
ClassGenerator::finishStreams((*it).name.lower() + "Proxy",
headerStream, sourceStream);
}
}
if (!baseName.isEmpty())
{
ClassGenerator::generateIncludeMoc(baseName, sourceStream);
ClassGenerator::finishStreams(baseName, headerStream, sourceStream);
}
}
if (generateNode || generateAll)

Loading…
Cancel
Save