summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2018-02-19 10:23:57 +0200
committerTomi Korpipää <tomi.korpipaa@qt.io>2018-02-19 08:57:06 +0000
commitd454b2630ae3df37599aa1492a976db409e8c1c4 (patch)
treec8539bfa11474d14256b1cc39f058d88b63b4782
parentc80c7d10cf22c3d13ec027b6c520363cac7d5675 (diff)
Fix error dialog texts
Task-number: QT3DS-1143 Change-Id: I73cc9e7c9244d8dc494bd4c994ac1f08e02c1e53 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp10
-rw-r--r--src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.cpp7
-rw-r--r--src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.h2
-rw-r--r--src/Authoring/Studio/_Win/Workspace/Dialogs.cpp11
-rw-r--r--src/Runtime/Source/DataModel/Source/Qt3DSMetadata.cpp6
5 files changed, 14 insertions, 22 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
index 8d9969e0..15eed678 100644
--- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
+++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
@@ -163,11 +163,11 @@ struct SImportXmlErrorHandler : public CXmlErrorHandler
, m_fullPathToDocument(inFullPathToDocument.toQString())
{
}
- void OnXmlError(TWideXMLCharPtr errorName, int line, int) override
+ void OnXmlError(const QString &errorName, int line, int) override
{
if (m_handler) {
- const QString str = QObject::tr("Failed to parse Lua data\n%1 on line %2\n")
- .arg(Q3DStudio::CString(errorName).toQString()).arg(line);
+ const QString str = QObject::tr("Failed to parse XML data.\nLine %1: %2\n")
+ .arg(line).arg(errorName);
m_handler->DisplayImportFailed(m_fullPathToDocument, str, false);
}
}
@@ -4885,7 +4885,7 @@ IDocumentEditor::ParsePluginFile(const Q3DStudio::CFilePath &inFullPathToDocumen
QT3DS_ASSERT(false);
if (inHandler)
inHandler->DisplayImportFailed(inFullPathToDocument.toQString(),
- QObject::tr("Failed to parse Lua data"),
+ QObject::tr("Failed to parse plugin file"),
false);
}
CRenderPluginParser::NavigateToMetadata(theReaderPtr);
@@ -4910,7 +4910,7 @@ IDocumentEditor::ParseCustomMaterialFile(const Q3DStudio::CFilePath &inFullPathT
QT3DS_ASSERT(false);
if (inHandler)
inHandler->DisplayImportFailed(inFullPathToDocument.toQString(),
- QObject::tr("Failed to parse Lua data"),
+ QObject::tr("Failed to parse material file"),
false);
}
CCustomMaterialParser::NavigateToMetadata(theReaderPtr);
diff --git a/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.cpp b/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.cpp
index 62021970..2f6de944 100644
--- a/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.cpp
+++ b/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.cpp
@@ -1072,11 +1072,8 @@ struct DOMParser
}
if (sreader.hasError()) {
if (handler) {
- wchar_t *error = new wchar_t[sreader.errorString().length() + 1];
- sreader.errorString().toWCharArray(error);
- handler->OnXmlError((TWideXMLCharPtr)error,
- sreader.lineNumber(), sreader.columnNumber());
- delete [] error;
+ handler->OnXmlError(sreader.errorString(), sreader.lineNumber(),
+ sreader.columnNumber());
} else {
qWarning() << "XML parse error:" << sreader.errorString()
<< "line:" << sreader.lineNumber()
diff --git a/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.h b/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.h
index 1a23d117..5fe722f9 100644
--- a/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.h
+++ b/src/Authoring/QT3DSDM/Systems/Qt3DSDMXML.h
@@ -491,7 +491,7 @@ class CXmlErrorHandler
protected:
virtual ~CXmlErrorHandler() {}
public:
- virtual void OnXmlError(TWideXMLCharPtr errorName, int line, int column) = 0;
+ virtual void OnXmlError(const QString &errorName, int line, int column) = 0;
};
class CDOMSerializer
diff --git a/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp b/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp
index 7761387c..5a87b54d 100644
--- a/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp
+++ b/src/Authoring/Studio/_Win/Workspace/Dialogs.cpp
@@ -305,9 +305,9 @@ void CDialogs::DisplayImportFailed(const QUrl &inURL, const QString &inDescripti
bool theIsStudioObject = theAssetType != OBJTYPE_UNKNOWN;
- // Is this a LUA file, but perhaps incorrectly formatted?
+ // Is this a behavior file, but perhaps incorrectly formatted?
if (theAssetType == OBJTYPE_BEHAVIOR) {
- // Load the message about the LUA format
+ // Load the message about the behavior format
if (inWarningsOnly) {
theText = QObject::tr("Warnings were detected during import of the behavior script."
"\nPlease check the file.\n");
@@ -346,7 +346,7 @@ void CDialogs::DisplayImportFailed(const QUrl &inURL, const QString &inDescripti
theMsgText = !inWarningsOnly ? QObject::tr("Import resource failed:")
: QObject::tr("Import resource succeeded with warning(s):");
- theMsgText += QStringLiteral("\n%s\n\n").arg(inURL.toDisplayString()) + theText;
+ theMsgText += QStringLiteral("\n%1\n\n").arg(inURL.toDisplayString()) + theText;
// Display the failed import resource message.
if (m_ShowGUI) {
@@ -655,11 +655,6 @@ const wchar_t *CDialogs::GetWideMeshFileExtension()
return L"mesh";
}
-const wchar_t *CDialogs::GetWideLUAFileExtension()
-{
- return L"lua";
-}
-
const wchar_t **CDialogs::GetWideFontFileExtensions()
{
return wideFontExts;
diff --git a/src/Runtime/Source/DataModel/Source/Qt3DSMetadata.cpp b/src/Runtime/Source/DataModel/Source/Qt3DSMetadata.cpp
index cd6cd47d..7abde92c 100644
--- a/src/Runtime/Source/DataModel/Source/Qt3DSMetadata.cpp
+++ b/src/Runtime/Source/DataModel/Source/Qt3DSMetadata.cpp
@@ -61,10 +61,10 @@ namespace {
struct SImportXmlErrorHandler : public CXmlErrorHandler
{
- void OnXmlError(TWideXMLCharPtr errorName, int line, int) override
+ void OnXmlError(const QString &errorName, int line, int) override
{
qCCritical(INTERNAL_ERROR) << "XML error:"
- << QString::fromWCharArray(errorName) << "on line" << line;
+ << errorName << "on line" << line;
}
};
@@ -933,7 +933,7 @@ public:
struct PluginErrorHandler : public qt3dsdm::CXmlErrorHandler
{
- void OnXmlError(TWideXMLCharPtr, int, int) override {}
+ void OnXmlError(const QString &, int, int) override {}
};
bool LoadPluginXMLFile(const char *inType, const char *inId, const char *inName,