diff options
Diffstat (limited to 'src/gui/models')
-rw-r--r-- | src/gui/models/langlistmodel.h | 7 | ||||
-rw-r--r-- | src/gui/models/modelistmodel.cpp | 1 | ||||
-rw-r--r-- | src/gui/models/modelistmodel.h | 2 | ||||
-rw-r--r-- | src/gui/models/playertablemodel.cpp | 10 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/models/langlistmodel.h b/src/gui/models/langlistmodel.h index bc807fcf2..d039b61b0 100644 --- a/src/gui/models/langlistmodel.h +++ b/src/gui/models/langlistmodel.h @@ -19,7 +19,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "gui/models/listmodel.h" +#ifndef GUI_MODELS_LANGLISTMODEL_H +#define GUI_MODELS_LANGLISTMODEL_H + +#include "gui/models/extendedlistmodel.h" #include "resources/resourcemanager.h" @@ -119,3 +122,5 @@ public: Image *mIcons[langs_count]; }; + +#endif // GUI_MODELS_LANGLISTMODEL_H diff --git a/src/gui/models/modelistmodel.cpp b/src/gui/models/modelistmodel.cpp index 20e4348bb..411bb3450 100644 --- a/src/gui/models/modelistmodel.cpp +++ b/src/gui/models/modelistmodel.cpp @@ -98,4 +98,3 @@ int ModeListModel::getIndexOf(const std::string &widthXHeightMode) } return -1; } - diff --git a/src/gui/models/modelistmodel.h b/src/gui/models/modelistmodel.h index a34ba810a..2802b720e 100644 --- a/src/gui/models/modelistmodel.h +++ b/src/gui/models/modelistmodel.h @@ -25,6 +25,8 @@ #include "gui/models/listmodel.h" +#include "utils/stringvector.h" + #include "localconsts.h" class ModeListModel final : public ListModel diff --git a/src/gui/models/playertablemodel.cpp b/src/gui/models/playertablemodel.cpp index d3d198eb1..119a4fba8 100644 --- a/src/gui/models/playertablemodel.cpp +++ b/src/gui/models/playertablemodel.cpp @@ -25,14 +25,11 @@ #include "gui/widgets/dropdown.h" #include "gui/widgets/label.h" -#include "gui/widgets/tabs/setup_relations.h" - #include "gui/models/playerrelationlistmodel.h" #include "gui/models/tablemodel.h" #include "utils/delete2.h" #include "utils/dtor.h" -#include "utils/gettext.h" #include "debug.h" @@ -145,7 +142,10 @@ void PlayerTableModel::freeWidgets() std::string PlayerTableModel::getPlayerAt(const int index) const { - if (index < 0 || index >= static_cast<signed>(mPlayers->size())) - return ""; + if (!mPlayers || index < 0 + || index >= static_cast<signed>(mPlayers->size())) + { + return std::string(); + } return (*mPlayers)[index]; } |