diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:09 +0300 |
commit | 4fbb944f132eb886a6f5b350e5a14a4fe380aacf (patch) | |
tree | 6df2ed96430610ee7c35a7ca4902bbdade0e8e34 /src/gui/models | |
parent | 1dc012a3bb44218778568e8f80c4e9b445802195 (diff) | |
download | manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.gz manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.bz2 manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.xz manaverse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.zip |
Add missing checks into gui.
Diffstat (limited to 'src/gui/models')
-rw-r--r-- | src/gui/models/beingslistmodel.h | 2 | ||||
-rw-r--r-- | src/gui/models/colormodel.cpp | 2 | ||||
-rw-r--r-- | src/gui/models/colormodel.h | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/models/beingslistmodel.h b/src/gui/models/beingslistmodel.h index 7e8caced2..4d587d763 100644 --- a/src/gui/models/beingslistmodel.h +++ b/src/gui/models/beingslistmodel.h @@ -43,7 +43,7 @@ class BeingsListModel final : public AvatarListModel mMembers.clear(); } - std::vector<Avatar*> *getMembers() + std::vector<Avatar*> *getMembers() RETURNS_NONNULL A_WARN_UNUSED { return &mMembers; } diff --git a/src/gui/models/colormodel.cpp b/src/gui/models/colormodel.cpp index f7b18d300..a31b245c4 100644 --- a/src/gui/models/colormodel.cpp +++ b/src/gui/models/colormodel.cpp @@ -51,7 +51,7 @@ std::string ColorModel::getElementAt(int i) const ColorPair *ColorModel::getColorAt(const int i) const { if (i >= static_cast<int>(mColors.size()) || i < 0) - return nullptr; + return &mColors[0]; return &mColors[i]; } diff --git a/src/gui/models/colormodel.h b/src/gui/models/colormodel.h index 81d8d8cbe..9537d7766 100644 --- a/src/gui/models/colormodel.h +++ b/src/gui/models/colormodel.h @@ -45,7 +45,8 @@ class ColorModel final : public ListModel std::string getElementAt(int i) override final A_WARN_UNUSED; - virtual const ColorPair *getColorAt(const int i) const A_WARN_UNUSED; + const ColorPair *getColorAt(const int i) + const RETURNS_NONNULL A_WARN_UNUSED; StringVect &getNames() A_WARN_UNUSED { return mNames; } @@ -53,10 +54,12 @@ class ColorModel final : public ListModel size_t size() A_WARN_UNUSED { return mNames.size(); } - void add(const std::string &name, const Color *const color1, + void add(const std::string &name, + const Color *const color1, const Color *const color2); - static ColorModel *createDefault(const Widget2 *const widget); + static ColorModel *createDefault(const Widget2 *const widget) + RETURNS_NONNULL; protected: StringVect mNames; |