From f146cd42ce84a08879eb286ecd2ed2aa8ad82300 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Feb 2014 15:46:02 +0300 Subject: fix code style. --- src/gui/widgets/avatarlistbox.h | 4 ---- src/gui/widgets/listbox.h | 2 -- src/gui/widgets/radiogroup.h | 2 -- src/gui/widgets/setupitem.h | 2 +- src/gui/widgets/setuptouchitem.cpp | 4 +--- src/gui/widgets/setuptouchitem.h | 2 -- src/gui/widgets/shortcutcontainer.cpp | 2 +- src/gui/widgets/tabs/setup_audio.cpp | 1 - src/gui/widgets/tabs/setup_theme.cpp | 1 - src/gui/widgets/tabstrip.h | 2 -- src/gui/widgets/widget.cpp | 10 ---------- src/gui/widgets/widget.h | 6 ++++-- src/gui/widgets/window.cpp | 1 - src/gui/widgets/window.h | 24 ------------------------ 14 files changed, 7 insertions(+), 56 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index e4f65a992..e0711a7b7 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -22,14 +22,10 @@ #ifndef GUI_WIDGETS_AVATARLISTBOX_H #define GUI_WIDGETS_AVATARLISTBOX_H -#include "avatar.h" - #include "listeners/configlistener.h" #include "gui/widgets/listbox.h" -#include "gui/models/listmodel.h" - #include class AvatarListModel; diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 0c3a62609..64faa6eb5 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -27,8 +27,6 @@ #include "gui/base/widgets/listbox.hpp" -#include "render/graphics.h" - #include "localconsts.h" class Skin; diff --git a/src/gui/widgets/radiogroup.h b/src/gui/widgets/radiogroup.h index b553c629a..41193b3d6 100644 --- a/src/gui/widgets/radiogroup.h +++ b/src/gui/widgets/radiogroup.h @@ -23,8 +23,6 @@ #include "gui/widgets/widgetgroup.h" -#include "gui/widgets/widget.h" - class RadioGroup final : public WidgetGroup { public: diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index 51f2eb94e..7dee860be 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -95,7 +95,7 @@ class SetupItem : public ActionListener, virtual void rereadValue(); - void setValue(const std::string str) + void setValue(const std::string &str) { mValue = str; } std::string getValue() const diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp index 99a774ecd..3c8238fd0 100644 --- a/src/gui/widgets/setuptouchitem.cpp +++ b/src/gui/widgets/setuptouchitem.cpp @@ -20,8 +20,6 @@ #include "gui/widgets/setuptouchitem.h" -#include "gui/setupactiondata.h" - #include "gui/models/touchactionmodel.h" #include "gui/widgets/dropdown.h" @@ -31,7 +29,7 @@ #include "gui/widgets/tabs/setuptabscroll.h" -#include +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/widgets/setuptouchitem.h b/src/gui/widgets/setuptouchitem.h index 2c1aa05d0..f7bbf2691 100644 --- a/src/gui/widgets/setuptouchitem.h +++ b/src/gui/widgets/setuptouchitem.h @@ -21,8 +21,6 @@ #ifndef GUI_WIDGETS_SETUPTOUCHITEM_H #define GUI_WIDGETS_SETUPTOUCHITEM_H -#include "gui/models/namesmodel.h" - #include "gui/widgets/setupitem.h" class TouchActionsModel; diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index d3781b421..0d9aa64a6 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -61,7 +61,7 @@ void ShortcutContainer::widgetResized(const Event &event A_UNUSED) if (mGridWidth < 1) mGridWidth = 1; - mGridHeight = mMaxItems / mGridWidth; + mGridHeight = mMaxItems / static_cast(mGridWidth); if (mMaxItems % mGridWidth != 0 || mGridHeight < 1) ++mGridHeight; diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp index c8e625ca4..6cf675635 100644 --- a/src/gui/widgets/tabs/setup_audio.cpp +++ b/src/gui/widgets/tabs/setup_audio.cpp @@ -30,7 +30,6 @@ #include "gui/viewport.h" -#include "gui/models/namesmodel.h" #include "gui/models/soundsmodel.h" #include "gui/widgets/layouthelper.h" diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index 419400853..424828694 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -28,7 +28,6 @@ #include "gui/models/extendedlistmodel.h" #include "gui/models/fontsmodel.h" -#include "gui/models/namesmodel.h" #include "gui/models/themesmodel.h" #include "gui/widgets/button.h" diff --git a/src/gui/widgets/tabstrip.h b/src/gui/widgets/tabstrip.h index b2dfc99e2..a89dd5144 100644 --- a/src/gui/widgets/tabstrip.h +++ b/src/gui/widgets/tabstrip.h @@ -23,8 +23,6 @@ #include "gui/widgets/widgetgroup.h" -#include "gui/widgets/widget.h" - class TabStrip final : public WidgetGroup { public: diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp index 23edadac0..5b2024b1f 100644 --- a/src/gui/widgets/widget.cpp +++ b/src/gui/widgets/widget.cpp @@ -604,16 +604,6 @@ void Widget::setInternalFocusHandler(FocusHandler* focusHandler) mInternalFocusHandler = focusHandler; } -void Widget::setId(const std::string& id) -{ - mId = id; -} - -const std::string& Widget::getId() -{ - return mId; -} - void Widget::distributeResizedEvent() { for (WidgetListenerIterator iter = mWidgetListeners.begin(); diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index e05844e4c..17f016c76 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -973,7 +973,8 @@ class Widget : public Widget2 * @see getId, BasicContainer::findWidgetById * @since 0.8.0 */ - void setId(const std::string& id); + void setId(const std::string& id) + { mId = id; } /** * Gets the id of a widget. An id can be useful if a widget needs to be @@ -985,7 +986,8 @@ class Widget : public Widget2 * @see setId, BasicContainer::findWidgetById * @since 0.8.0 */ - const std::string& getId() A_WARN_UNUSED; + const std::string& getId() const A_WARN_UNUSED + { return mId; } /** * Shows a certain part of a widget in the widget's parent. diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 8b106b489..ec83af9a8 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -99,7 +99,6 @@ Window::Window(const std::string &caption, const bool modal, mPadding(2), mTitleBarHeight(16), mMovable(true), - mOpaque(true), mDragOffsetX(0), mDragOffsetY(0), mMoved(false), diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 7cf34c67c..6369990bb 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -555,25 +555,6 @@ class Window : public gcn::Container, bool isMovable() const { return mMovable; } - /** - * Sets the window to be opaque or not. An opaque window will draw it's background - * and it's content. A non opaque window will only draw it's content. - * - * @param opaque True if the window should be opaque, false otherwise. - * @see isOpaque - */ - void setOpaque(bool opaque) - { mOpaque = opaque; } - - /** - * Checks if the window is opaque. - * - * @return True if the window is opaque, false otherwise. - * @see setOpaque - */ - bool isOpaque() - { return mOpaque; } - virtual Rect getChildrenArea(); /** @@ -625,11 +606,6 @@ class Window : public gcn::Container, */ bool mMovable; - /** - * True if the window is opaque, false otherwise. - */ - bool mOpaque; - /** * Holds a drag offset as an x coordinate where the drag of the window * started if the window is being dragged. It's used to move the window -- cgit v1.2.3-70-g09d2