reduce scope of pointer variables, this resolves issue#2

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/3/head
gregory guy 6 years ago
parent 51508c184d
commit 1f0d6dd2d7
No known key found for this signature in database
GPG Key ID: 6EFE0EF249A874C0

@ -148,12 +148,14 @@ void SkinSettings::slotPopulate()
skin_icon.load(skin_icon_url.path()); skin_icon.load(skin_icon_url.path());
bool exists = false; bool exists = false;
SkinListItem* item = 0; /* SkinListItem* item = 0;
* moved in the while loop to reduce pointer variable scope
*/
TQListViewItemIterator it2(skins_list); TQListViewItemIterator it2(skins_list);
while (it2.current()) while (it2.current())
{ {
SkinListItem* item = 0;
item = static_cast<SkinListItem*>(it2.current()); item = static_cast<SkinListItem*>(it2.current());
if (item && item->name() == skin_name) exists = true; if (item && item->name() == skin_name) exists = true;
++it2; ++it2;
@ -415,12 +417,14 @@ void SkinSettings::slotResetSelection()
void SkinSettings::slotUpdateSelection(const TQString& selection) void SkinSettings::slotUpdateSelection(const TQString& selection)
{ {
selected = selection; selected = selection;
SkinListItem* skin = 0; /* SkinListItem* skin = 0;
* moved in the while loop to reduce pointer variable scope
*/
TQListViewItemIterator it(skins_list); TQListViewItemIterator it(skins_list);
while (it.current()) while (it.current())
{ {
SkinListItem* skin = 0;
skin = static_cast<SkinListItem*>(it.current()); skin = static_cast<SkinListItem*>(it.current());
if (skin && skin->name() == selected) if (skin && skin->name() == selected)

Loading…
Cancel
Save