diff options
author | gregory guy <g-gregory@gmx.fr> | 2018-09-07 19:29:04 +0200 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-09-08 15:35:51 +0900 |
commit | c65e18412a96098aea5d69e6921261479d93ac33 (patch) | |
tree | 372731efb972172c7c95991defe1943d02454a63 | |
parent | fd4ddb33126d33e94be58a9e1159ee8c6be6bebe (diff) | |
download | yakuake-c65e18412a96098aea5d69e6921261479d93ac33.tar.gz yakuake-c65e18412a96098aea5d69e6921261479d93ac33.zip |
reduce scope of pointer variables, this resolves issue#2
Signed-off-by: gregory guy <g-gregory@gmx.fr>
(cherry picked from commit 1f0d6dd2d76e34cd71700ed77e410040e2a6a8c1)
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | yakuake/src/skin_settings.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/yakuake/src/skin_settings.cpp b/yakuake/src/skin_settings.cpp index 8bbbdca..aabfd1b 100644 --- a/yakuake/src/skin_settings.cpp +++ b/yakuake/src/skin_settings.cpp @@ -148,12 +148,14 @@ void SkinSettings::slotPopulate() skin_icon.load(skin_icon_url.path()); bool exists = false; - SkinListItem* item = 0; - + /* SkinListItem* item = 0; + * moved in the while loop to reduce pointer variable scope + */ TQListViewItemIterator it2(skins_list); while (it2.current()) { + SkinListItem* item = 0; item = static_cast<SkinListItem*>(it2.current()); if (item && item->name() == skin_name) exists = true; ++it2; @@ -415,12 +417,14 @@ void SkinSettings::slotResetSelection() void SkinSettings::slotUpdateSelection(const TQString& selection) { selected = selection; - SkinListItem* skin = 0; - +/* SkinListItem* skin = 0; + * moved in the while loop to reduce pointer variable scope + */ TQListViewItemIterator it(skins_list); while (it.current()) { + SkinListItem* skin = 0; skin = static_cast<SkinListItem*>(it.current()); if (skin && skin->name() == selected) |