summaryrefslogtreecommitdiff
path: root/src/linguist
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-01-13 11:23:58 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-01-16 10:30:55 +0100
commitb0ae730d4e6c76a48fa573651ef9f1351d71366e (patch)
treec30fabc8c30954a0e33f915c4fe6a4c59cfe3540 /src/linguist
parent86f290ee73923ccb7059c9c7bd9d44a9c49ea40f (diff)
downloadqttools-b0ae730d4e6c76a48fa573651ef9f1351d71366e.tar.gz
linguist: Split out helper class FMT
A single definition is required for CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I5b68e31ae19a92fdc1796dddb81d85e14a8e60ec Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/linguist')
-rw-r--r--src/linguist/shared/fmt.h17
-rw-r--r--src/linguist/shared/projectdescriptionreader.cpp5
-rw-r--r--src/linguist/shared/qrcreader.cpp5
-rw-r--r--src/linguist/shared/runqttool.cpp5
-rw-r--r--src/linguist/shared/translator.h5
5 files changed, 21 insertions, 16 deletions
diff --git a/src/linguist/shared/fmt.h b/src/linguist/shared/fmt.h
new file mode 100644
index 000000000..b40cdd308
--- /dev/null
+++ b/src/linguist/shared/fmt.h
@@ -0,0 +1,17 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef FMT_H
+#define FMT_H
+
+#include <QtCore/qcoreapplication.h>
+
+QT_BEGIN_NAMESPACE
+
+class FMT {
+ Q_DECLARE_TR_FUNCTIONS(Linguist)
+};
+
+QT_END_NAMESPACE
+
+#endif // FMT_H
diff --git a/src/linguist/shared/projectdescriptionreader.cpp b/src/linguist/shared/projectdescriptionreader.cpp
index 44f431098..eded3a650 100644
--- a/src/linguist/shared/projectdescriptionreader.cpp
+++ b/src/linguist/shared/projectdescriptionreader.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "projectdescriptionreader.h"
+#include "fmt.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qfile.h>
@@ -15,10 +16,6 @@
using std::placeholders::_1;
-class FMT {
- Q_DECLARE_TR_FUNCTIONS(Linguist)
-};
-
class Validator
{
public:
diff --git a/src/linguist/shared/qrcreader.cpp b/src/linguist/shared/qrcreader.cpp
index e63ade76a..66f14bea6 100644
--- a/src/linguist/shared/qrcreader.cpp
+++ b/src/linguist/shared/qrcreader.cpp
@@ -2,15 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qrcreader.h"
+#include "fmt.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qxmlstream.h>
-class FMT {
- Q_DECLARE_TR_FUNCTIONS(Linguist)
-};
-
static bool isSupportedExtension(const QString &ext)
{
return ext == QLatin1String("qml")
diff --git a/src/linguist/shared/runqttool.cpp b/src/linguist/shared/runqttool.cpp
index d355b9dc8..1257ff899 100644
--- a/src/linguist/shared/runqttool.cpp
+++ b/src/linguist/shared/runqttool.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "runqttool.h"
+#include "fmt.h"
#include "profileutils.h"
@@ -16,10 +17,6 @@
#include <sys/wait.h>
#endif
-class FMT {
- Q_DECLARE_TR_FUNCTIONS(Linguist)
-};
-
static QString qtToolFilePath(const QString &toolName, QLibraryInfo::LibraryPath location)
{
QString filePath = QLibraryInfo::path(location) + QLatin1Char('/') + toolName;
diff --git a/src/linguist/shared/translator.h b/src/linguist/shared/translator.h
index 778491bb4..4bc88c7df 100644
--- a/src/linguist/shared/translator.h
+++ b/src/linguist/shared/translator.h
@@ -5,6 +5,7 @@
#define METATRANSLATOR_H
#include "translatormessage.h"
+#include "fmt.h"
#include <QCoreApplication>
#include <QDir>
@@ -17,10 +18,6 @@
QT_BEGIN_NAMESPACE
-class FMT {
- Q_DECLARE_TR_FUNCTIONS(Linguist)
-};
-
class QIODevice;
// A struct of "interesting" data passed to and from the load and save routines