ResourceFile: Don't use "Designer" translation context.

Change-Id: Ice82d5ce76c97f90b76745eb64546ebf8bb4e690
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Konstantin Tokarev
2012-08-15 14:37:04 +04:00
committed by Eike Ziller
parent fd78ec9f42
commit 7d2f3c2589
2 changed files with 7 additions and 15 deletions

View File

@@ -49,16 +49,6 @@
#include <QDomDocument> #include <QDomDocument>
/*
TRANSLATOR ResourceEditor::ResourceModel
*/
static QString msgFileNameEmpty()
{
return QCoreApplication::translate("Designer", "The file name is empty.");
}
using namespace ResourceEditor; using namespace ResourceEditor;
using namespace ResourceEditor::Internal; using namespace ResourceEditor::Internal;
@@ -126,7 +116,7 @@ bool ResourceFile::load()
m_error_message.clear(); m_error_message.clear();
if (m_file_name.isEmpty()) { if (m_file_name.isEmpty()) {
m_error_message = msgFileNameEmpty(); m_error_message = tr("The file name is empty.");
return false; return false;
} }
@@ -143,14 +133,14 @@ bool ResourceFile::load()
QString error_msg; QString error_msg;
int error_line, error_col; int error_line, error_col;
if (!doc.setContent(&file, &error_msg, &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); .arg(error_line).arg(error_col).arg(error_msg);
return false; return false;
} }
QDomElement root = doc.firstChildElement(QLatin1String("RCC")); QDomElement root = doc.firstChildElement(QLatin1String("RCC"));
if (root.isNull()) { 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; return false;
} }
@@ -189,7 +179,7 @@ bool ResourceFile::save()
m_error_message.clear(); m_error_message.clear();
if (m_file_name.isEmpty()) { if (m_file_name.isEmpty()) {
m_error_message = msgFileNameEmpty(); m_error_message = tr("The file name is empty.");
return false; return false;
} }
@@ -238,7 +228,7 @@ bool ResourceFile::save()
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0) #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
stream.flush(); stream.flush();
if (stream.status() != QTextStream::Ok) { 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; return false;
} }
#endif #endif

View File

@@ -32,6 +32,7 @@
#define RESOURCEFILE_P_H #define RESOURCEFILE_P_H
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include <QCoreApplication>
#include <QMap> #include <QMap>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
@@ -123,6 +124,7 @@ typedef QList<Prefix *> PrefixList;
*/ */
class ResourceFile class ResourceFile
{ {
Q_DECLARE_TR_FUNCTIONS(ResourceFile)
public: public:
ResourceFile(const QString &file_name = QString()); ResourceFile(const QString &file_name = QString());
~ResourceFile(); ~ResourceFile();