From 769219f9b8375e94b37dfd37237df024c3c90c01 Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 18 Oct 2014 19:33:49 +0300 Subject: [PATCH] Warnings from static analysis. --HG-- branch : develop --- src/app/exception/vexception.cpp | 12 ++++++++++++ src/app/exception/vexception.h | 1 + src/app/exception/vexceptionbadid.cpp | 13 +++++++++++++ src/app/exception/vexceptionbadid.h | 1 + 4 files changed, 27 insertions(+) diff --git a/src/app/exception/vexception.cpp b/src/app/exception/vexception.cpp index fef48ed4a..a00b963f7 100644 --- a/src/app/exception/vexception.cpp +++ b/src/app/exception/vexception.cpp @@ -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::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 diff --git a/src/app/exception/vexception.h b/src/app/exception/vexception.h index e057d8db2..ebd560157 100644 --- a/src/app/exception/vexception.h +++ b/src/app/exception/vexception.h @@ -45,6 +45,7 @@ class VException : public QException public: VException(const QString &what); VException(const VException &e); + VException &operator=(const VException &e); virtual ~VException() V_NOEXCEPT_EXPR (true){} Q_NORETURN virtual void raise() const; diff --git a/src/app/exception/vexceptionbadid.cpp b/src/app/exception/vexceptionbadid.cpp index 424d0662e..c26f03182 100644 --- a/src/app/exception/vexceptionbadid.cpp +++ b/src/app/exception/vexceptionbadid.cpp @@ -55,6 +55,19 @@ VExceptionBadId::VExceptionBadId(const QString &what, const QString &key) VExceptionBadId::VExceptionBadId(const VExceptionBadId &e) :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 diff --git a/src/app/exception/vexceptionbadid.h b/src/app/exception/vexceptionbadid.h index 81c2e1a0c..59fe25d15 100644 --- a/src/app/exception/vexceptionbadid.h +++ b/src/app/exception/vexceptionbadid.h @@ -40,6 +40,7 @@ public: VExceptionBadId(const QString &what, const quint32 &id); VExceptionBadId(const QString &what, const QString &key); VExceptionBadId(const VExceptionBadId &e); + VExceptionBadId &operator=(const VExceptionBadId &e); virtual ~VExceptionBadId() V_NOEXCEPT_EXPR (true){} virtual QString ErrorMessage() const; quint32 BadId() const;