diff --git a/src/libs/ifc/exception/vexception.cpp b/src/libs/ifc/exception/vexception.cpp index e50f9007b..9cce17db9 100644 --- a/src/libs/ifc/exception/vexception.cpp +++ b/src/libs/ifc/exception/vexception.cpp @@ -42,10 +42,10 @@ * @brief VException constructor exception * @param what string with error */ -VException::VException(const QString &what) V_NOEXCEPT_EXPR (true) - :QException(), what(what), moreInfo(QString()) +VException::VException(const QString &error) + :QException(), error(error), moreInfo(QString()) { - Q_ASSERT_X(not what.isEmpty(), Q_FUNC_INFO, "Error message is empty"); + Q_ASSERT_X(not error.isEmpty(), Q_FUNC_INFO, "Error message is empty"); } //--------------------------------------------------------------------------------------------------------------------- @@ -53,7 +53,7 @@ VException::VException(const QString &what) V_NOEXCEPT_EXPR (true) * @brief VException copy constructor * @param e exception */ -VException::VException(const VException &e):what(e.What()), moreInfo(e.MoreInformation()) +VException::VException(const VException &e):error(e.WhatUtf8()), moreInfo(e.MoreInformation()) {} //--------------------------------------------------------------------------------------------------------------------- @@ -63,7 +63,7 @@ VException &VException::operator=(const VException &e) { return *this; } - this->what = e.What(); + this->error = e.WhatUtf8(); this->moreInfo = e.MoreInformation(); return *this; } @@ -75,8 +75,7 @@ VException &VException::operator=(const VException &e) */ QString VException::ErrorMessage() const { - QString error = QString("Exception: %1").arg(what); - return error; + return QString("Exception: %1").arg(error); } //--------------------------------------------------------------------------------------------------------------------- @@ -137,9 +136,15 @@ Q_NORETURN void VException::raise() const throw *this; } +//--------------------------------------------------------------------------------------------------------------------- +const char* VException::what() const V_NOEXCEPT_EXPR (true) +{ + return error.toUtf8().constData(); +} + //-----------------------------------------VExceptionToolWasDeleted---------------------------------------------------- -VExceptionToolWasDeleted::VExceptionToolWasDeleted(const QString &what) V_NOEXCEPT_EXPR (true) - :VException(what) +VExceptionToolWasDeleted::VExceptionToolWasDeleted(const QString &error) + :VException(error) { } diff --git a/src/libs/ifc/exception/vexception.h b/src/libs/ifc/exception/vexception.h index 72213c9ff..2dde2b6aa 100644 --- a/src/libs/ifc/exception/vexception.h +++ b/src/libs/ifc/exception/vexception.h @@ -41,7 +41,7 @@ class VException : public QException { Q_DECLARE_TR_FUNCTIONS(VException) public: - explicit VException(const QString &what) V_NOEXCEPT_EXPR (true); + explicit VException(const QString &error); VException(const VException &e); VException &operator=(const VException &e); virtual ~VException() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE {} @@ -51,12 +51,14 @@ public: virtual VException *clone() const Q_DECL_OVERRIDE; virtual QString ErrorMessage() const; virtual QString DetailedInformation() const; - QString What() const; + QString WhatUtf8() const V_NOEXCEPT_EXPR (true); void AddMoreInformation(const QString &info); QString MoreInformation() const; + virtual const char* what() const V_NOEXCEPT_EXPR (true); + protected: - /** @brief what string with error */ - QString what; + /** @brief error string with error */ + QString error; /** @brief moreInfo more information about error */ QString moreInfo; @@ -69,9 +71,9 @@ protected: * @brief What return string with error * @return string with error */ -inline QString VException::What() const +inline QString VException::WhatUtf8() const V_NOEXCEPT_EXPR (true) { - return what; + return error; } //--------------------------------------------------------------------------------------------------------------------- @@ -89,7 +91,7 @@ class VExceptionToolWasDeleted : public VException { Q_DECLARE_TR_FUNCTIONS(VExceptionToolDeleted) public: - explicit VExceptionToolWasDeleted(const QString &what) V_NOEXCEPT_EXPR (true); + explicit VExceptionToolWasDeleted(const QString &error); VExceptionToolWasDeleted(const VExceptionToolWasDeleted &e); VExceptionToolWasDeleted &operator=(const VExceptionToolWasDeleted &e); virtual ~VExceptionToolWasDeleted() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE {} diff --git a/src/libs/ifc/exception/vexceptionbadid.cpp b/src/libs/ifc/exception/vexceptionbadid.cpp index cec574d53..80cad96fd 100644 --- a/src/libs/ifc/exception/vexceptionbadid.cpp +++ b/src/libs/ifc/exception/vexceptionbadid.cpp @@ -31,20 +31,20 @@ //--------------------------------------------------------------------------------------------------------------------- /** * @brief VExceptionBadId exception bad id - * @param what string with error + * @param error string with error * @param id id */ -VExceptionBadId::VExceptionBadId(const QString &what, const quint32 &id) - :VException(what), id(id), key(QString()){} +VExceptionBadId::VExceptionBadId(const QString &error, const quint32 &id) + :VException(error), id(id), key(QString()){} //--------------------------------------------------------------------------------------------------------------------- /** * @brief VExceptionBadId exception bad id - * @param what string with error + * @param error string with error * @param key string key */ -VExceptionBadId::VExceptionBadId(const QString &what, const QString &key) - :VException(what), id(NULL_ID), key(key){} +VExceptionBadId::VExceptionBadId(const QString &error, const QString &key) + :VException(error), id(NULL_ID), key(key){} //--------------------------------------------------------------------------------------------------------------------- /** @@ -77,11 +77,11 @@ QString VExceptionBadId::ErrorMessage() const QString error; if (key.isEmpty()) { - error = QString("ExceptionBadId: %1, id = %2").arg(what).arg(id); + error = QString("ExceptionBadId: %1, id = %2").arg(error).arg(id); } else { - error = QString("ExceptionBadId: %1, id = %2").arg(what).arg(key); + error = QString("ExceptionBadId: %1, id = %2").arg(error).arg(key); } return error; } diff --git a/src/libs/ifc/exception/vexceptionbadid.h b/src/libs/ifc/exception/vexceptionbadid.h index 2365f2b28..4e98f958e 100644 --- a/src/libs/ifc/exception/vexceptionbadid.h +++ b/src/libs/ifc/exception/vexceptionbadid.h @@ -37,8 +37,8 @@ class VExceptionBadId : public VException { public: - VExceptionBadId(const QString &what, const quint32 &id); - VExceptionBadId(const QString &what, const QString &key); + VExceptionBadId(const QString &error, const quint32 &id); + VExceptionBadId(const QString &error, const QString &key); VExceptionBadId(const VExceptionBadId &e); VExceptionBadId &operator=(const VExceptionBadId &e); virtual ~VExceptionBadId() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE {} diff --git a/src/libs/ifc/exception/vexceptionconversionerror.cpp b/src/libs/ifc/exception/vexceptionconversionerror.cpp index 8c8d8369c..a8ee62be8 100644 --- a/src/libs/ifc/exception/vexceptionconversionerror.cpp +++ b/src/libs/ifc/exception/vexceptionconversionerror.cpp @@ -31,11 +31,11 @@ //--------------------------------------------------------------------------------------------------------------------- /** * @brief VExceptionConversionError exception conversion error - * @param what string with error + * @param error string with error * @param str string, where happend error */ -VExceptionConversionError::VExceptionConversionError(const QString &what, const QString &str) - :VException(what), str(str) +VExceptionConversionError::VExceptionConversionError(const QString &error, const QString &str) + :VException(error), str(str) { Q_ASSERT_X(not str.isEmpty(), Q_FUNC_INFO, "Error converting string is empty"); } @@ -60,6 +60,6 @@ VExceptionConversionError::~VExceptionConversionError() V_NOEXCEPT_EXPR (true) */ QString VExceptionConversionError::ErrorMessage() const { - QString error = QString("ExceptionConversionError: %1 \"%2\"").arg(what, str); + QString error = QString("ExceptionConversionError: %1 \"%2\"").arg(error, str); return error; } diff --git a/src/libs/ifc/exception/vexceptionconversionerror.h b/src/libs/ifc/exception/vexceptionconversionerror.h index 9a413feea..99af2e6f3 100644 --- a/src/libs/ifc/exception/vexceptionconversionerror.h +++ b/src/libs/ifc/exception/vexceptionconversionerror.h @@ -37,7 +37,7 @@ class VExceptionConversionError : public VException { public: - VExceptionConversionError(const QString &what, const QString &str); + VExceptionConversionError(const QString &error, const QString &str); VExceptionConversionError(const VExceptionConversionError &e); virtual ~VExceptionConversionError() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE; virtual QString ErrorMessage() const Q_DECL_OVERRIDE; diff --git a/src/libs/ifc/exception/vexceptionemptyparameter.cpp b/src/libs/ifc/exception/vexceptionemptyparameter.cpp index 97fcc8679..fe5f647f2 100644 --- a/src/libs/ifc/exception/vexceptionemptyparameter.cpp +++ b/src/libs/ifc/exception/vexceptionemptyparameter.cpp @@ -69,7 +69,7 @@ VExceptionEmptyParameter::~VExceptionEmptyParameter() V_NOEXCEPT_EXPR (true) */ QString VExceptionEmptyParameter::ErrorMessage() const { - QString error = QString("ExceptionEmptyParameter: %1 %2").arg(what, name); + QString error = QString("ExceptionEmptyParameter: %1 %2").arg(error, name); return error; } diff --git a/src/libs/ifc/exception/vexceptionemptyparameter.h b/src/libs/ifc/exception/vexceptionemptyparameter.h index ad1ab1b08..8dfade909 100644 --- a/src/libs/ifc/exception/vexceptionemptyparameter.h +++ b/src/libs/ifc/exception/vexceptionemptyparameter.h @@ -39,7 +39,8 @@ class QDomElement; class VExceptionEmptyParameter : public VException { public: - VExceptionEmptyParameter(const QString &what, const QString &name, const QDomElement &domElement); + VExceptionEmptyParameter(const QString &error, const QString &name, + const QDomElement &domElement); VExceptionEmptyParameter(const VExceptionEmptyParameter &e); virtual ~VExceptionEmptyParameter() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE; virtual QString ErrorMessage() const Q_DECL_OVERRIDE; diff --git a/src/libs/ifc/exception/vexceptionobjecterror.cpp b/src/libs/ifc/exception/vexceptionobjecterror.cpp index 757e2ae84..302d75d7f 100644 --- a/src/libs/ifc/exception/vexceptionobjecterror.cpp +++ b/src/libs/ifc/exception/vexceptionobjecterror.cpp @@ -62,7 +62,7 @@ VExceptionObjectError::VExceptionObjectError(const VExceptionObjectError &e) */ QString VExceptionObjectError::ErrorMessage() const { - QString error = QString("ExceptionObjectError: %1").arg(what); + QString error = QString("ExceptionObjectError: %1").arg(error); return error; } diff --git a/src/libs/ifc/exception/vexceptionobjecterror.h b/src/libs/ifc/exception/vexceptionobjecterror.h index dbdf434f7..d7f9b77aa 100644 --- a/src/libs/ifc/exception/vexceptionobjecterror.h +++ b/src/libs/ifc/exception/vexceptionobjecterror.h @@ -39,7 +39,7 @@ class QDomElement; class VExceptionObjectError : public VException { public: - VExceptionObjectError(const QString &what, const QDomElement &domElement); + VExceptionObjectError(const QString &error, const QDomElement &domElement); VExceptionObjectError(const VExceptionObjectError &e); virtual ~VExceptionObjectError() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE {} virtual QString ErrorMessage() const Q_DECL_OVERRIDE; diff --git a/src/libs/ifc/exception/vexceptionundo.h b/src/libs/ifc/exception/vexceptionundo.h index c78d3c8fa..423e3e310 100644 --- a/src/libs/ifc/exception/vexceptionundo.h +++ b/src/libs/ifc/exception/vexceptionundo.h @@ -34,7 +34,7 @@ class VExceptionUndo : public VException { public: - explicit VExceptionUndo(const QString &what); + explicit VExceptionUndo(const QString &error); VExceptionUndo(const VExceptionUndo &e); virtual ~VExceptionUndo() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE; }; diff --git a/src/libs/ifc/exception/vexceptionwrongid.cpp b/src/libs/ifc/exception/vexceptionwrongid.cpp index 1a2c5e196..0265cf874 100644 --- a/src/libs/ifc/exception/vexceptionwrongid.cpp +++ b/src/libs/ifc/exception/vexceptionwrongid.cpp @@ -62,7 +62,7 @@ VExceptionWrongId::VExceptionWrongId(const VExceptionWrongId &e) */ QString VExceptionWrongId::ErrorMessage() const { - QString error = QString("ExceptionWrongId: %1").arg(what); + QString error = QString("ExceptionWrongId: %1").arg(error); return error; } diff --git a/src/libs/ifc/exception/vexceptionwrongid.h b/src/libs/ifc/exception/vexceptionwrongid.h index f96ed58b0..a4993845b 100644 --- a/src/libs/ifc/exception/vexceptionwrongid.h +++ b/src/libs/ifc/exception/vexceptionwrongid.h @@ -39,7 +39,7 @@ class QDomElement; class VExceptionWrongId : public VException { public: - VExceptionWrongId(const QString &what, const QDomElement &domElement); + VExceptionWrongId(const QString &error, const QDomElement &domElement); VExceptionWrongId(const VExceptionWrongId &e); virtual ~VExceptionWrongId() V_NOEXCEPT_EXPR (true) Q_DECL_OVERRIDE {} virtual QString ErrorMessage() const Q_DECL_OVERRIDE; diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 4dceb4b48..7d6793598 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -55,7 +55,7 @@ static const quint32 null_id = 0; # define V_NOEXCEPT_EXPR(x) noexcept(x) // GCC 4.7 and following have noexcept # endif # elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 180021114 -# define QMUP_NOEXCEPT_EXPR(x) noexcept(x) +# define V_NOEXCEPT_EXPR(x) noexcept(x) # else # define V_NOEXCEPT_EXPR(x) # endif