From 195315b65cfb8e74bf09ff416f69e80c50a01f74 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 28 Mar 2016 18:16:53 +0300 Subject: Rename static widgets collections in Widget. --- src/gui/widgets/widget.cpp | 20 ++++++++++---------- src/gui/widgets/widget.h | 5 +++-- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp index f2f112c61..986d97d99 100644 --- a/src/gui/widgets/widget.cpp +++ b/src/gui/widgets/widget.cpp @@ -76,8 +76,8 @@ #include "debug.h" Font* Widget::mGlobalFont = nullptr; -std::list Widget::mWidgets; -std::set Widget::mWidgetsSet; +std::list Widget::mAllWidgets; +std::set Widget::mAllWidgetsSet; Widget::Widget(const Widget2 *const widget) : Widget2(widget), @@ -107,8 +107,8 @@ Widget::Widget(const Widget2 *const widget) : mMouseConsume(true), mRedraw(true) { - mWidgets.push_back(this); - mWidgetsSet.insert(this); + mAllWidgets.push_back(this); + mAllWidgetsSet.insert(this); } Widget::~Widget() @@ -121,8 +121,8 @@ Widget::~Widget() setFocusHandler(nullptr); - mWidgets.remove(this); - mWidgetsSet.erase(this); + mAllWidgets.remove(this); + mAllWidgetsSet.erase(this); } void Widget::setWidth(const int width) @@ -334,7 +334,7 @@ void Widget::setGlobalFont(Font *const font) { mGlobalFont = font; - FOR_EACH (std::list::const_iterator, iter, mWidgets) + FOR_EACH (std::list::const_iterator, iter, mAllWidgets) { if (!(*iter)->mCurrentFont) (*iter)->fontChanged(); @@ -349,14 +349,14 @@ void Widget::setFont(Font *const font) void Widget::distributeWindowResizeEvent() { - FOR_EACH (std::list::const_iterator, iter, mWidgets) + FOR_EACH (std::list::const_iterator, iter, mAllWidgets) (*iter)->windowResized(); } bool Widget::widgetExists(const Widget *const widget) { - return mWidgetsSet.find(const_cast(widget)) - != mWidgetsSet.end(); + return mAllWidgetsSet.find(const_cast(widget)) + != mAllWidgetsSet.end(); } void Widget::setSize(const int width, const int height) diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index d4b85e4b8..707b4dfb9 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -1250,12 +1250,13 @@ class Widget notfinal : public Widget2 */ static Font* mGlobalFont; + private: /** * Holds a list of all instances of widgets. */ - static std::list mWidgets; + static std::list mAllWidgets; - static std::set mWidgetsSet; + static std::set mAllWidgetsSet; }; #endif // GUI_WIDGETS_WIDGET_H -- cgit v1.2.3-70-g09d2