Warnings from static analysis.

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-18 19:33:49 +03:00
parent c717196199
commit 769219f9b8
4 changed files with 27 additions and 0 deletions

View File

@ -51,6 +51,18 @@ VException::VException(const QString &what):QException(), what(what), moreInfo(Q
VException::VException(const VException &e):what(e.What()), moreInfo(e.MoreInformation()) VException::VException(const VException &e):what(e.What()), moreInfo(e.MoreInformation())
{} {}
//---------------------------------------------------------------------------------------------------------------------
VException &VException::operator=(const VException &e)
{
if ( &e == this )
{
return *this;
}
this->what = e.What();
this->moreInfo = e.MoreInformation();
return *this;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief ErrorMessage return main error message * @brief ErrorMessage return main error message

View File

@ -45,6 +45,7 @@ class VException : public QException
public: public:
VException(const QString &what); VException(const QString &what);
VException(const VException &e); VException(const VException &e);
VException &operator=(const VException &e);
virtual ~VException() V_NOEXCEPT_EXPR (true){} virtual ~VException() V_NOEXCEPT_EXPR (true){}
Q_NORETURN virtual void raise() const; Q_NORETURN virtual void raise() const;

View File

@ -55,6 +55,19 @@ VExceptionBadId::VExceptionBadId(const QString &what, const QString &key)
VExceptionBadId::VExceptionBadId(const VExceptionBadId &e) VExceptionBadId::VExceptionBadId(const VExceptionBadId &e)
:VException(e), id(e.BadId()), key(e.BadKey()){} :VException(e), id(e.BadId()), key(e.BadKey()){}
//---------------------------------------------------------------------------------------------------------------------
VExceptionBadId &VExceptionBadId::operator=(const VExceptionBadId &e)
{
if ( &e == this )
{
return *this;
}
VException::operator=(e);
this->id = e.BadId();
this->key = e.BadKey();
return *this;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief ErrorMessage return main error message * @brief ErrorMessage return main error message

View File

@ -40,6 +40,7 @@ public:
VExceptionBadId(const QString &what, const quint32 &id); VExceptionBadId(const QString &what, const quint32 &id);
VExceptionBadId(const QString &what, const QString &key); VExceptionBadId(const QString &what, const QString &key);
VExceptionBadId(const VExceptionBadId &e); VExceptionBadId(const VExceptionBadId &e);
VExceptionBadId &operator=(const VExceptionBadId &e);
virtual ~VExceptionBadId() V_NOEXCEPT_EXPR (true){} virtual ~VExceptionBadId() V_NOEXCEPT_EXPR (true){}
virtual QString ErrorMessage() const; virtual QString ErrorMessage() const;
quint32 BadId() const; quint32 BadId() const;