diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-15 23:05:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-15 23:05:16 +0300 |
commit | b162094c7609fa37f2eef6be3fed0e26830bc506 (patch) | |
tree | 072b83f0ce6b7f871acd9a2d2c6c49b8dac7dc64 /src/gui/widgets/setuptabscroll.cpp | |
parent | 4031a5068859fb99f604dfecceb2fb1c954e166f (diff) | |
download | manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.gz manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.bz2 manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.xz manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.zip |
Improve a bit widgets speed.
Diffstat (limited to 'src/gui/widgets/setuptabscroll.cpp')
-rw-r--r-- | src/gui/widgets/setuptabscroll.cpp | 18 |
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); } } |