From 7d2f3c25893bacbb4746584d07086f91c41a7f15 Mon Sep 17 00:00:00 2001
From: Konstantin Tokarev <annulen@yandex.ru>
Date: Wed, 15 Aug 2012 14:37:04 +0400
Subject: [PATCH] ResourceFile: Don't use "Designer" translation context.

Change-Id: Ice82d5ce76c97f90b76745eb64546ebf8bb4e690
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
---
 .../resourceeditor/qrceditor/resourcefile.cpp | 20 +++++--------------
 .../resourceeditor/qrceditor/resourcefile_p.h |  2 ++
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
index 33fc8accb4c..68efd3e8e14 100644
--- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
+++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
@@ -49,16 +49,6 @@
 
 #include <QDomDocument>
 
-
-/*
-TRANSLATOR ResourceEditor::ResourceModel
-*/
-
-static QString msgFileNameEmpty()
-{
-    return QCoreApplication::translate("Designer", "The file name is empty.");
-}
-
 using namespace ResourceEditor;
 using namespace ResourceEditor::Internal;
 
@@ -126,7 +116,7 @@ bool ResourceFile::load()
     m_error_message.clear();
 
     if (m_file_name.isEmpty()) {
-        m_error_message = msgFileNameEmpty();
+        m_error_message = tr("The file name is empty.");
         return false;
     }
 
@@ -143,14 +133,14 @@ bool ResourceFile::load()
     QString error_msg;
     int error_line, error_col;
     if (!doc.setContent(&file, &error_msg, &error_line, &error_col)) {
-        m_error_message = QCoreApplication::translate("Designer", "XML error on line %1, col %2: %3")
+        m_error_message = tr("XML error on line %1, col %2: %3")
                     .arg(error_line).arg(error_col).arg(error_msg);
         return false;
     }
 
     QDomElement root = doc.firstChildElement(QLatin1String("RCC"));
     if (root.isNull()) {
-        m_error_message = QCoreApplication::translate("Designer", "The <RCC> root element is missing.");
+        m_error_message = tr("The <RCC> root element is missing.");
         return false;
     }
 
@@ -189,7 +179,7 @@ bool ResourceFile::save()
     m_error_message.clear();
 
     if (m_file_name.isEmpty()) {
-        m_error_message = msgFileNameEmpty();
+        m_error_message = tr("The file name is empty.");
         return false;
     }
 
@@ -238,7 +228,7 @@ bool ResourceFile::save()
 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
     stream.flush();
     if (stream.status() != QTextStream::Ok) {
-        m_error_message = QCoreApplication::translate("Designer", "Cannot write file. Disk full?");
+        m_error_message = tr("Cannot write file. Disk full?");
         return false;
     }
 #endif
diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h
index ffcc09025db..412a368f7dd 100644
--- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h
+++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h
@@ -32,6 +32,7 @@
 #define RESOURCEFILE_P_H
 
 #include <QAbstractItemModel>
+#include <QCoreApplication>
 #include <QMap>
 #include <QString>
 #include <QStringList>
@@ -123,6 +124,7 @@ typedef QList<Prefix *> PrefixList;
 */
 class ResourceFile
 {
+    Q_DECLARE_TR_FUNCTIONS(ResourceFile)
 public:
     ResourceFile(const QString &file_name = QString());
     ~ResourceFile();
-- 
GitLab