Commit b0227ce4 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

remove linguist-specific functions

parent a2f40fce
......@@ -2671,64 +2671,4 @@ void ProFileEvaluator::setParsePreAndPostFiles(bool on)
d->m_parsePreAndPostFiles = on;
}
void evaluateProFile(const ProFileEvaluator &visitor, QHash<QByteArray, QStringList> *varMap)
{
QStringList sourceFiles;
QString codecForTr;
QString codecForSource;
QStringList tsFileNames;
// app/lib template
sourceFiles += visitor.values(QLatin1String("SOURCES"));
sourceFiles += visitor.values(QLatin1String("HEADERS"));
tsFileNames = visitor.values(QLatin1String("TRANSLATIONS"));
QStringList trcodec = visitor.values(QLatin1String("CODEC"))
+ visitor.values(QLatin1String("DEFAULTCODEC"))
+ visitor.values(QLatin1String("CODECFORTR"));
if (!trcodec.isEmpty())
codecForTr = trcodec.last();
QStringList srccodec = visitor.values(QLatin1String("CODECFORSRC"));
if (!srccodec.isEmpty())
codecForSource = srccodec.last();
QStringList forms = visitor.values(QLatin1String("INTERFACES"))
+ visitor.values(QLatin1String("FORMS"))
+ visitor.values(QLatin1String("FORMS3"));
sourceFiles << forms;
sourceFiles.sort();
sourceFiles.removeDuplicates();
tsFileNames.sort();
tsFileNames.removeDuplicates();
varMap->insert("SOURCES", sourceFiles);
varMap->insert("CODECFORTR", QStringList() << codecForTr);
varMap->insert("CODECFORSRC", QStringList() << codecForSource);
varMap->insert("TRANSLATIONS", tsFileNames);
}
bool evaluateProFile(const QString &fileName, bool verbose, QHash<QByteArray, QStringList> *varMap)
{
QFileInfo fi(fileName);
if (!fi.exists())
return false;
ProFile pro(fi.absoluteFilePath());
ProFileEvaluator visitor;
visitor.setVerbose(verbose);
if (!visitor.queryProFile(&pro))
return false;
if (!visitor.accept(&pro))
return false;
evaluateProFile(visitor, varMap);
return true;
}
QT_END_NAMESPACE
......@@ -40,11 +40,6 @@
QT_BEGIN_NAMESPACE
class ProFileEvaluator;
void evaluateProFile(const ProFileEvaluator &visitor, QHash<QByteArray, QStringList> *varMap);
bool evaluateProFile(const QString &fileName, bool verbose, QHash<QByteArray, QStringList> *varMap);
class ProFileEvaluator
{
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment