summaryrefslogtreecommitdiff
path: root/src
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
parente5a14c0a1c74b66246f7c54e56c7cc2c33fef29d (diff)
downloadmv-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.tar.gz
mv-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.tar.bz2
mv-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.tar.xz
mv-d2e02bed6c128ec055eaa3a32aaca6ce5523576d.zip
Fix code style.
Diffstat (limited to 'src')
-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
-rw-r--r--src/gui/popups/popupmenu.h1
-rw-r--r--src/gui/theme.cpp4
-rw-r--r--src/gui/widgets/browserbox.h1
-rw-r--r--src/gui/widgets/containerplacer.cpp2
-rw-r--r--src/gui/widgets/guitable.cpp1
-rw-r--r--src/gui/widgets/layout.cpp8
-rw-r--r--src/gui/widgets/layout.h5
-rw-r--r--src/gui/widgets/layoutarray.cpp6
-rw-r--r--src/gui/widgets/layoutarray.h4
-rw-r--r--src/gui/widgets/layoutcell.cpp3
-rw-r--r--src/gui/widgets/layoutcell.h6
-rw-r--r--src/gui/widgets/layouthelper.h1
-rw-r--r--src/gui/widgets/layouttype.h2
-rw-r--r--src/gui/widgets/linepart.h1
-rw-r--r--src/gui/widgets/tabs/setup_relations.cpp2
-rw-r--r--src/gui/widgets/tabs/setup_theme.cpp3
-rw-r--r--src/gui/widgets/tabs/setup_video.cpp3
-rw-r--r--src/gui/windows/changepassworddialog.cpp2
-rw-r--r--src/gui/windows/charselectdialog.cpp2
-rw-r--r--src/gui/windows/connectiondialog.cpp2
-rw-r--r--src/gui/windows/debugwindow.cpp2
-rw-r--r--src/gui/windows/itemamountwindow.cpp2
-rw-r--r--src/gui/windows/killstats.cpp2
-rw-r--r--src/gui/windows/logindialog.cpp2
-rw-r--r--src/gui/windows/quitdialog.cpp2
-rw-r--r--src/gui/windows/registerdialog.cpp2
-rw-r--r--src/gui/windows/shopwindow.cpp3
-rw-r--r--src/gui/windows/textcommandeditor.cpp2
-rw-r--r--src/listeners/guitableactionlistener.cpp1
-rw-r--r--src/listeners/guitableactionlistener.h2
-rw-r--r--src/listeners/renamelistener.cpp6
-rw-r--r--src/net/tmwa/pethandler.cpp2
36 files changed, 33 insertions, 74 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];
}
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index 1fc124b16..72c16ce50 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -26,7 +26,6 @@
#include "gui/widgets/linkhandler.h"
#include "gui/widgets/popup.h"
-#include "listeners/actionlistener.h"
#include "listeners/playerlistener.h"
#include "listeners/renamelistener.h"
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 6ac18b412..c11132d8d 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -24,7 +24,6 @@
#include "gui/theme.h"
-#include "client.h"
#include "configuration.h"
#include "graphicsmanager.h"
@@ -35,13 +34,10 @@
#include "resources/image.h"
#include "resources/resourcemanager.h"
-#include "utils/delete2.h"
#include "utils/dtor.h"
#include "utils/files.h"
#include "utils/physfstools.h"
-#include <algorithm>
-
#include "debug.h"
static std::string defaultThemePath;
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index 144eddae3..85bb758f9 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -34,7 +34,6 @@
#include "localconsts.h"
-class Image;
class LinkHandler;
struct BrowserLink final
diff --git a/src/gui/widgets/containerplacer.cpp b/src/gui/widgets/containerplacer.cpp
index 1e9ac98ff..91b4e45ff 100644
--- a/src/gui/widgets/containerplacer.cpp
+++ b/src/gui/widgets/containerplacer.cpp
@@ -23,7 +23,7 @@
#include "gui/widgets/containerplacer.h"
#include "gui/widgets/basiccontainer2.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "debug.h"
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 298348f78..400365a84 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -30,7 +30,6 @@
#include "input/keydata.h"
-#include "listeners/actionlistener.h"
#include "listeners/guitableactionlistener.h"
#include "render/graphics.h"
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp
index 1f67da953..463837cdd 100644
--- a/src/gui/widgets/layout.cpp
+++ b/src/gui/widgets/layout.cpp
@@ -22,14 +22,6 @@
#include "gui/widgets/layout.h"
-#include "logger.h"
-
-#include "gui/widgets/basiccontainer2.h"
-
-#include "utils/delete2.h"
-
-#include <cassert>
-
#include "debug.h"
Layout::Layout() :
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index 86b5dddcb..9c0154ff6 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -25,13 +25,8 @@
#include "gui/widgets/layoutcell.h"
-#include <vector>
-
#include "localconsts.h"
-class BasicContainer2;
-class Widget;
-
/**
* This class is an helper for setting the position of widgets. They are
* positioned along the cells of some rectangular tables. The layout may either
diff --git a/src/gui/widgets/layoutarray.cpp b/src/gui/widgets/layoutarray.cpp
index b174ba5b3..57a8f5f26 100644
--- a/src/gui/widgets/layoutarray.cpp
+++ b/src/gui/widgets/layoutarray.cpp
@@ -24,11 +24,9 @@
#include "logger.h"
-#include "gui/widgets/basiccontainer2.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "gui/widgets/layouttype.h"
-
-#include "utils/delete2.h"
+#include "gui/widgets/widget.h"
#include <cassert>
diff --git a/src/gui/widgets/layoutarray.h b/src/gui/widgets/layoutarray.h
index f6fffde18..bf41281cd 100644
--- a/src/gui/widgets/layoutarray.h
+++ b/src/gui/widgets/layoutarray.h
@@ -23,13 +23,11 @@
#ifndef GUI_WIDGETS_LAYOUTARRAY_H
#define GUI_WIDGETS_LAYOUTARRAY_H
-#include "gui/widgets/layoutcell.h"
-
#include <vector>
#include "localconsts.h"
-class BasicContainer2;
+class LayoutCell;
class Widget;
/**
diff --git a/src/gui/widgets/layoutcell.cpp b/src/gui/widgets/layoutcell.cpp
index 9f5996284..7a537d35c 100644
--- a/src/gui/widgets/layoutcell.cpp
+++ b/src/gui/widgets/layoutcell.cpp
@@ -22,7 +22,6 @@
#include "gui/widgets/layoutcell.h"
-#include "gui/widgets/layout.h"
#include "gui/widgets/layoutarray.h"
#include "gui/widgets/widget.h"
@@ -103,7 +102,7 @@ LayoutCell &LayoutCell::at(const int x, const int y)
return getArray().at(x, y);
}
-LayoutCell &LayoutCell::place(Widget *wg,
+LayoutCell &LayoutCell::place(Widget *const wg,
const int x, const int y,
const int w, const int h)
{
diff --git a/src/gui/widgets/layoutcell.h b/src/gui/widgets/layoutcell.h
index f262ebb05..25783558c 100644
--- a/src/gui/widgets/layoutcell.h
+++ b/src/gui/widgets/layoutcell.h
@@ -25,11 +25,7 @@
#include "localconsts.h"
-#include <vector>
-
-class BasicContainer2;
class LayoutArray;
-class LayoutCell;
class Widget;
/**
@@ -93,7 +89,7 @@ class LayoutCell
/**
* @see LayoutArray::place
*/
- LayoutCell &place(Widget *wg,
+ LayoutCell &place(Widget *const wg,
const int x, const int y,
const int w = 1, const int h = 1);
diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h
index 1877e1940..c96310e6f 100644
--- a/src/gui/widgets/layouthelper.h
+++ b/src/gui/widgets/layouthelper.h
@@ -27,6 +27,7 @@
#include "listeners/widgetlistener.h"
+class BasicContainer2;
class ContainerPlacer;
/**
diff --git a/src/gui/widgets/layouttype.h b/src/gui/widgets/layouttype.h
index aecd4bcd4..ffc2cb829 100644
--- a/src/gui/widgets/layouttype.h
+++ b/src/gui/widgets/layouttype.h
@@ -37,6 +37,6 @@ namespace LayoutType
SET = -43, /**< Uses the share as the new size. */
ADD = -44 /**< Adds the share to the current size. */
};
-}
+} // namespace LayoutType
#endif // GUI_WIDGETS_LAYOUTTYPE_H
diff --git a/src/gui/widgets/linepart.h b/src/gui/widgets/linepart.h
index 34bc76e8e..c1b1fb357 100644
--- a/src/gui/widgets/linepart.h
+++ b/src/gui/widgets/linepart.h
@@ -29,7 +29,6 @@
#include "localconsts.h"
class Image;
-class LinkHandler;
class LinePart final
{
diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp
index 4dcce4b9c..723131edc 100644
--- a/src/gui/widgets/tabs/setup_relations.cpp
+++ b/src/gui/widgets/tabs/setup_relations.cpp
@@ -27,7 +27,6 @@
#include "being/localplayer.h"
#include "gui/models/ignorechoiceslistmodel.h"
-#include "gui/models/playerrelationlistmodel.h"
#include "gui/models/playertablemodel.h"
#include "gui/widgets/button.h"
@@ -40,7 +39,6 @@
#include "gui/widgets/guitable.h"
#include "utils/delete2.h"
-#include "utils/dtor.h"
#include "utils/gettext.h"
#include "debug.h"
diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp
index 6ba74449d..5cf4e905b 100644
--- a/src/gui/widgets/tabs/setup_theme.cpp
+++ b/src/gui/widgets/tabs/setup_theme.cpp
@@ -27,7 +27,6 @@
#include "gui/windows/okdialog.h"
-#include "gui/models/extendedlistmodel.h"
#include "gui/models/fontsizechoicelistmodel.h"
#include "gui/models/fontsmodel.h"
#include "gui/models/langlistmodel.h"
@@ -44,8 +43,6 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
-#include "resources/resourcemanager.h"
-
#include "debug.h"
const char* ACTION_THEME = "theme";
diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp
index be3697426..c72b4a3ed 100644
--- a/src/gui/widgets/tabs/setup_video.cpp
+++ b/src/gui/widgets/tabs/setup_video.cpp
@@ -44,15 +44,12 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
-#include "utils/sdlhelper.h"
#include "test/testmain.h"
#include "gui/models/modelistmodel.h"
#include "gui/models/opengllistmodel.h"
-#include <algorithm>
-
#include "debug.h"
extern Graphics *mainGraphics;
diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp
index 383b6a63e..ea9084c5c 100644
--- a/src/gui/windows/changepassworddialog.cpp
+++ b/src/gui/windows/changepassworddialog.cpp
@@ -30,7 +30,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/passwordfield.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "net/logindata.h"
#include "net/loginhandler.h"
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 1984bacd7..c9801e26a 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -43,7 +43,7 @@
#include "gui/widgets/characterviewnormal.h"
#include "gui/widgets/characterviewsmall.h"
#include "gui/widgets/containerplacer.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "net/logindata.h"
#include "net/loginhandler.h"
diff --git a/src/gui/windows/connectiondialog.cpp b/src/gui/windows/connectiondialog.cpp
index fece71b0a..93b7f7e7b 100644
--- a/src/gui/windows/connectiondialog.cpp
+++ b/src/gui/windows/connectiondialog.cpp
@@ -24,7 +24,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "gui/widgets/progressindicator.h"
#include "utils/gettext.h"
diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp
index 26514575b..62a82704c 100644
--- a/src/gui/windows/debugwindow.cpp
+++ b/src/gui/windows/debugwindow.cpp
@@ -35,7 +35,7 @@
#include "gui/widgets/containerplacer.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/tabbedarea.h"
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index ffce4ee8b..b8d1cb606 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -45,7 +45,7 @@
#include "gui/widgets/dropdown.h"
#include "gui/widgets/icon.h"
#include "gui/widgets/inttextfield.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "gui/widgets/label.h"
#include "gui/widgets/slider.h"
diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp
index 199c1d84c..7bb0b7397 100644
--- a/src/gui/windows/killstats.cpp
+++ b/src/gui/windows/killstats.cpp
@@ -24,7 +24,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "actormanager.h"
#include "client.h"
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp
index d1202dea7..f3fcec167 100644
--- a/src/gui/windows/logindialog.cpp
+++ b/src/gui/windows/logindialog.cpp
@@ -38,8 +38,8 @@
#include "gui/widgets/checkbox.h"
#include "gui/widgets/dropdown.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/layout.h"
#include "gui/widgets/passwordfield.h"
+#include "gui/widgets/layoutcell.h"
#include "net/charserverhandler.h"
#include "net/logindata.h"
diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp
index 9ed503664..ccb3e469c 100644
--- a/src/gui/windows/quitdialog.cpp
+++ b/src/gui/windows/quitdialog.cpp
@@ -35,7 +35,7 @@
#include "gui/viewport.h"
#include "gui/widgets/containerplacer.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "gui/widgets/button.h"
#include "gui/widgets/radiobutton.h"
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index e1c78141b..375a34137 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -33,7 +33,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/containerplacer.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "gui/widgets/passwordfield.h"
#include "gui/widgets/radiobutton.h"
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index 67270ef36..7e4f71e50 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -25,6 +25,7 @@
#include "gui/chatconsts.h"
#include "gui/windows/buydialog.h"
+#include "gui/windows/chatwindow.h"
#include "gui/windows/confirmdialog.h"
#include "gui/windows/itemamountwindow.h"
#include "gui/windows/selldialog.h"
@@ -41,8 +42,6 @@
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/shoplistbox.h"
-#include "gui/widgets/tabs/chattab.h"
-
#include "actormanager.h"
#include "auctionmanager.h"
#include "client.h"
diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp
index dce17dede..d35334e36 100644
--- a/src/gui/windows/textcommandeditor.cpp
+++ b/src/gui/windows/textcommandeditor.cpp
@@ -36,7 +36,7 @@
#include "gui/widgets/dropdown.h"
#include "gui/widgets/inttextfield.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/layout.h"
+#include "gui/widgets/layoutcell.h"
#include "gui/widgets/radiobutton.h"
#include "utils/delete2.h"
diff --git a/src/listeners/guitableactionlistener.cpp b/src/listeners/guitableactionlistener.cpp
index df9b46130..86d6acaff 100644
--- a/src/listeners/guitableactionlistener.cpp
+++ b/src/listeners/guitableactionlistener.cpp
@@ -57,4 +57,3 @@ void GuiTableActionListener::action(const ActionEvent &actionEvent A_UNUSED)
mTable->setSelected(mRow, mColumn);
mTable->distributeActionEvent();
}
-
diff --git a/src/listeners/guitableactionlistener.h b/src/listeners/guitableactionlistener.h
index 27352f71e..acb803c63 100644
--- a/src/listeners/guitableactionlistener.h
+++ b/src/listeners/guitableactionlistener.h
@@ -49,4 +49,4 @@ class GuiTableActionListener final : public ActionListener
Widget *mWidget;
};
-#endif // GUITABLEACTIONLISTENER_H
+#endif // LISTENERS_GUITABLEACTIONLISTENER_H
diff --git a/src/listeners/renamelistener.cpp b/src/listeners/renamelistener.cpp
index 2b928cdb0..6b33cdd3b 100644
--- a/src/listeners/renamelistener.cpp
+++ b/src/listeners/renamelistener.cpp
@@ -20,17 +20,11 @@
#include "listeners/renamelistener.h"
-#include "actormanager.h"
-
-#include "being/being.h"
-
#include "gui/viewport.h"
#include "gui/windows/socialwindow.h"
#include "gui/windows/textdialog.h"
-#include "gui/popups/popupmenu.h"
-
#include "resources/map/map.h"
#include "resources/map/mapitem.h"
#include "resources/map/speciallayer.h"
diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp
index 5c277891e..edc18b02d 100644
--- a/src/net/tmwa/pethandler.cpp
+++ b/src/net/tmwa/pethandler.cpp
@@ -22,8 +22,6 @@
#include "gui/chatconsts.h"
-#include "gui/widgets/tabs/chattab.h"
-
#include "net/net.h"
#include "net/chathandler.h"