summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/shared')
-rw-r--r--tools/linguist/shared/proparserutils.h25
-rw-r--r--tools/linguist/shared/qm.cpp2
-rw-r--r--tools/linguist/shared/translator.cpp10
-rw-r--r--tools/linguist/shared/translator.h12
4 files changed, 49 insertions, 0 deletions
diff --git a/tools/linguist/shared/proparserutils.h b/tools/linguist/shared/proparserutils.h
index 9a83733..1ed3d6c 100644
--- a/tools/linguist/shared/proparserutils.h
+++ b/tools/linguist/shared/proparserutils.h
@@ -43,10 +43,35 @@
#define PROPARSERUTILS_H
#include <QtCore/QDir>
+#ifndef QT_BOOTSTRAPPED
#include <QtCore/QLibraryInfo>
+#endif
QT_BEGIN_NAMESPACE
+#ifdef QT_BOOTSTRAPPED
+// this is a stripped down version of the one found in QtCore
+class QLibraryInfo
+{
+public:
+ enum LibraryLocation
+ {
+ PrefixPath,
+ DocumentationPath,
+ HeadersPath,
+ LibrariesPath,
+ BinariesPath,
+ PluginsPath,
+ DataPath,
+ TranslationsPath,
+ SettingsPath,
+ DemosPath,
+ ExamplesPath
+ };
+ static QString location(LibraryLocation);
+};
+#endif
+
// Pre- and postcondition macros
#define PRE(cond) do {if (!(cond))qt_assert(#cond,__FILE__,__LINE__);} while (0)
#define POST(cond) do {if (!(cond))qt_assert(#cond,__FILE__,__LINE__);} while (0)
diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp
index 99aedef..e4c26bc 100644
--- a/tools/linguist/shared/qm.cpp
+++ b/tools/linguist/shared/qm.cpp
@@ -41,7 +41,9 @@
#include "translator.h"
+#ifndef QT_BOOTSTRAPPED
#include <QtCore/QCoreApplication>
+#endif
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QFile>
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index bc27daf..05fc6e5 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -56,6 +56,16 @@
QT_BEGIN_NAMESPACE
+#ifdef QT_BOOTSTRAPPED
+QString QObject::tr(const char *sourceText, const char *, int n)
+{
+ QString ret = QString::fromLatin1(sourceText);
+ if (n >= 0)
+ ret.replace(QLatin1String("%n"), QString::number(n));
+ return ret;
+}
+#endif
+
Translator::Translator() :
m_codecName("ISO-8859-1"),
m_locationsType(AbsoluteLocations)
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index eec704a..f29317b 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -54,6 +54,18 @@
QT_BEGIN_NAMESPACE
+#ifdef QT_BOOTSTRAPPED
+struct QObject {
+ static QString tr(const char *sourceText, const char * = 0, int n = -1);
+};
+struct QCoreApplication : public QObject {
+ enum Encoding { CodecForTr };
+ static QString translate(const char *, const char *sourceText, const char * = 0,
+ Encoding = CodecForTr, int n = -1)
+ { return tr(sourceText, 0, n); }
+};
+#endif
+
class QIODevice;
// A struct of "interesting" data passed to and from the load and save routines