summaryrefslogtreecommitdiff
path: root/src/gui/models
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-16 12:11:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-16 12:11:38 +0300
commitd2e02bed6c128ec055eaa3a32aaca6ce5523576d (patch)
tree1b0c5ada01c953f7cc82de4c742d783917632510 /src/gui/models
parente5a14c0a1c74b66246f7c54e56c7cc2c33fef29d (diff)
downloadmanaverse-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.tar.gz
manaverse-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.tar.bz2
manaverse-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.tar.xz
manaverse-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.zip
Fix code style.
Diffstat (limited to 'src/gui/models')
-rw-r--r--src/gui/models/langlistmodel.h7
-rw-r--r--src/gui/models/modelistmodel.cpp1
-rw-r--r--src/gui/models/modelistmodel.h2
-rw-r--r--src/gui/models/playertablemodel.cpp10
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];
}