Mgr: fix a bug deleting entries from Task Selection control introduced on 9 November

svn path=/trunk/boinc/; revision=24577
This commit is contained in:
Charlie Fenton 2011-11-11 11:40:57 +00:00
parent 248c9e8bc7
commit 46157c721d
2 changed files with 29 additions and 18 deletions

View File

@ -8374,3 +8374,12 @@ Charlie 9 Nov 2011
cs_cmdline.cpp
clientgui/
BOINCGUIApp.cpp
Charlie 11 Nov 2011
- Mgr: fix a bug deleting entries from Task Selection control which I
introduced on 9 November. Deleting an entry cvan create a gap in
the alphabetically sorted sequence, so we can't use my earlier
shortcut in checking for existing entries.
clientgui/
sg_TaskPanel.cpp

View File

@ -736,6 +736,11 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
is_alive.at(j) = true;
break; // skip out of this loop
}
}
// if it isn't currently in the list then we have a new one! lets add it
if (!found) {
for(j = 0; j < count; ++j) {
alphaOrder = (m_TaskSelectionCtrl->GetString(j)).Cmp(resname);
#if SORTTASKLIST
if (alphaOrder > 0) {
@ -750,12 +755,9 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
#if !SORTTASKLIST
j = -1; // If not sorted, check new name from start for duplicate
#endif
continue;
}
}
// if it isn't currently in the list then we have a new one! lets add it
if (!found) {
selData = new TaskSelectionData;
selData->result = result;
strncpy(selData->result_name, result->name, sizeof(selData->result_name));
@ -785,8 +787,8 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) {
is_alive.push_back(true);
}
++count;
}
}
} // End if (!found)
} // End for (i) loop
// Check items in descending order so deletion won't change indexes of items yet to be checked
for(j = count-1; j >=0; --j) {