7#include <QtCore/qtcore-config.h>
8#include <QtTools/private/qttools-config_p.h>
10#include <QtCore/QList>
11#include <QtCore/QHash>
12#include <QtCore/QCoreApplication>
13#include <QtCore/QString>
14#include <QtCore/QStringList>
15#include <QtCore/QTranslator>
38Q_DECLARE_FLAGS(UpdateOptions, UpdateOption)
39Q_DECLARE_OPERATORS_FOR_FLAGS(UpdateOptions)
42 const Translator &tor,
const Translator &virginTor,
const QList<Translator> &aliens,
43 UpdateOptions options, QString &err);
56#define LUPDATE_FOR_EACH_TR_FUNCTION(UNARY_MACRO)
58 UNARY_MACRO(Q_DECLARE_TR_FUNCTIONS)
59 UNARY_MACRO(QT_TR_N_NOOP)
60 UNARY_MACRO(QT_TRID_N_NOOP)
61 UNARY_MACRO(QT_TRANSLATE_N_NOOP)
62 UNARY_MACRO(QT_TRANSLATE_N_NOOP3)
63 UNARY_MACRO(QT_TR_NOOP)
64 UNARY_MACRO(QT_TRID_NOOP)
65 UNARY_MACRO(QT_TRANSLATE_NOOP)
66 UNARY_MACRO(QT_TRANSLATE_NOOP3)
67 UNARY_MACRO(QT_TR_NOOP_UTF8)
68 UNARY_MACRO(QT_TRANSLATE_NOOP_UTF8)
69 UNARY_MACRO(QT_TRANSLATE_NOOP3_UTF8)
70 UNARY_MACRO(findMessage)
74 UNARY_MACRO(translate)
78 UNARY_MACRO(qsTranslate)
94#define MAKE_ENTRY(F) Function_##F,
109 {
return m_trFunctionAliases[trFunction].contains(identifier); }
117 void ensureTrFunctionHashUpdated()
const;
121 mutable NameToTrFunctionMap m_nameToTrFunctionMap;
126extern QT_PREPEND_NAMESPACE(TrFunctionAliasManager) trFunctionAliasManager;
int main(int argc, char *argv[])
[2]
void processProjects(bool topLevel, UpdateOptions options, const Projects &projects, bool nestComplain, Translator *parentTor, bool *fail) const
ProjectProcessor(const QString &sourceLanguage, const QString &targetLanguage)
~TrFunctionAliasManager()
QStringList availableFunctionsWithAliases() const
QStringList listAliases() const
int trFunctionByName(const QString &trFunctionName) const
void modifyAlias(int trFunction, const QString &alias, Operation op)
const NameToTrFunctionMap & nameToTrFunctionMap() const
bool isAliasFor(const QString &identifier, TrFunction trFunction) const
const TranslatorMessage & constMessage(int i) const
void loadCPP(Translator &translator, const QStringList &filenames, ConversionData &cd)
bool loadJava(Translator &translator, const QString &filename, ConversionData &cd)
bool loadJSModule(Translator &translator, const QString &filename, ConversionData &cd)
#define LUPDATE_FOR_EACH_TR_FUNCTION(UNARY_MACRO)
bool loadQml(Translator &translator, const QString &filename, ConversionData &cd)
bool loadPython(Translator &translator, const QString &fileName, ConversionData &cd)
bool loadQScript(Translator &translator, const QString &filename, ConversionData &cd)
bool loadUI(Translator &translator, const QString &filename, ConversionData &cd)
std::vector< Project > Projects
Q_STATIC_ASSERT(sizeof(SharedImageHeader) % 4==0)
static void printOut(const QString &out)
static void printErr(const QString &out)
static QStringList getResources(const QString &resourceFile)
static void processSources(Translator &fetchedTor, const QStringList &sourceFiles, ConversionData &cd, UpdateOptions options, bool *fail)
static QString m_defaultExtensions
static void printWarning(UpdateOptions options, const QString &msg, const QString &warningMsg={}, const QString &errorMsg={})
static QStringList availableFunctions()
static int trFunctionByDefaultName(const QString &trFunctionName)
static void removeExcludedSources(Projects &projects)
static const QString defaultTrFunctionNames[]
static void expandQrcFiles(Project &project)
static void recursiveFileInfoList(const QDir &dir, const QSet< QString > &nameFilters, QDir::Filters filter, QFileInfoList *fileinfolist)
TrFunctionAliasManager trFunctionAliasManager
static bool readFileContent(const QString &filePath, QByteArray *content, QString *errorString)
QString commandLineCompilationDatabaseDir
static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFileNames, const QStringList &alienFiles, const QString &sourceLanguage, const QString &targetLanguage, UpdateOptions options, bool *fail)
static bool processTs(Translator &fetchedTor, const QString &file, ConversionData &cd)
static QSet< QString > projectRoots(const QString &projectFile, const QStringList &sourceFiles)
static bool handleTrFunctionAliases(const QString &arg)
static QStringList extractQrcFiles(Project &project)