From d2e02bed6c128ec055eaa3a32aaca6ce5523576d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 16 May 2014 12:11:38 +0300 Subject: Fix code style. --- src/gui/models/langlistmodel.h | 7 ++++++- src/gui/models/modelistmodel.cpp | 1 - src/gui/models/modelistmodel.h | 2 ++ src/gui/models/playertablemodel.cpp | 10 +++++----- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/gui/models') 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 . */ -#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(mPlayers->size())) - return ""; + if (!mPlayers || index < 0 + || index >= static_cast(mPlayers->size())) + { + return std::string(); + } return (*mPlayers)[index]; } -- cgit v1.2.3-60-g2f50