summaryrefslogtreecommitdiff
path: root/src/gui/widgets/setuptabscroll.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-15 23:05:16 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-15 23:05:16 +0300
commitb162094c7609fa37f2eef6be3fed0e26830bc506 (patch)
tree072b83f0ce6b7f871acd9a2d2c6c49b8dac7dc64 /src/gui/widgets/setuptabscroll.cpp
parent4031a5068859fb99f604dfecceb2fb1c954e166f (diff)
downloadmanaverse-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.gz
manaverse-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.bz2
manaverse-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.xz
manaverse-b162094c7609fa37f2eef6be3fed0e26830bc506.zip
Improve a bit widgets speed.
Diffstat (limited to 'src/gui/widgets/setuptabscroll.cpp')
-rw-r--r--src/gui/widgets/setuptabscroll.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp
index c668308c5..554ee5f62 100644
--- a/src/gui/widgets/setuptabscroll.cpp
+++ b/src/gui/widgets/setuptabscroll.cpp
@@ -66,12 +66,13 @@ void SetupTabScroll::addControl(SetupItem *const widget)
delete (*iter).second;
mItems.erase(iter);
}
- mItems[widget->getActionEventId()] = widget;
+ mItems[actionId] = widget;
}
mAllItems.insert(widget);
}
-void SetupTabScroll::addControl(SetupItem *const widget, std::string event)
+void SetupTabScroll::addControl(SetupItem *const widget,
+ const std::string &event)
{
const std::map<std::string, SetupItem*>::iterator iter
= mItems.find(event);
@@ -87,7 +88,8 @@ void SetupTabScroll::addControl(SetupItem *const widget, std::string event)
void SetupTabScroll::apply()
{
for (std::map<std::string, SetupItem*>::const_iterator
- iter = mItems.begin(); iter != mItems.end(); ++ iter)
+ iter = mItems.begin(), iter_end = mItems.end();
+ iter != iter_end; ++ iter)
{
if ((*iter).second)
(*iter).second->apply((*iter).first);
@@ -97,7 +99,8 @@ void SetupTabScroll::apply()
void SetupTabScroll::cancel()
{
for (std::map<std::string, SetupItem*>::const_iterator
- iter = mItems.begin(); iter != mItems.end(); ++ iter)
+ iter = mItems.begin(), iter_end = mItems.end();
+ iter != iter_end; ++ iter)
{
if ((*iter).second)
(*iter).second->cancel((*iter).first);
@@ -107,10 +110,11 @@ void SetupTabScroll::cancel()
void SetupTabScroll::externalUpdated()
{
for (std::map<std::string, SetupItem*>::const_iterator
- iter = mItems.begin(); iter != mItems.end(); ++ iter)
+ iter = mItems.begin(), iter_end = mItems.end();
+ iter != iter_end; ++ iter)
{
- const SetupItem *const widget = (*iter).second;
+ SetupItem *const widget = (*iter).second;
if (widget && !widget->isMainConfig())
- (*iter).second->externalUpdated((*iter).first);
+ widget->externalUpdated((*iter).first);
}
}