bool QInstall::check_id(int id)
{
VLPEntry *pom;
+ QListIterator<VLPEntry *> nodesIterator(Nodes);
- pom = Nodes.first();
- while (pom != NULL) {
+ while (nodesIterator.hasNext()) {
+ pom = nodesIterator.next();
if (pom->ID == id)
return FALSE;
- pom = Nodes.takeFirst();
}
return TRUE;
}
bool QInstall::check_addr(char *addr)
{
VLPEntry *pom;
+ QListIterator<VLPEntry *> nodesIterator(Nodes);
- pom = Nodes.first();
- while (pom != NULL) {
+ while (nodesIterator.hasNext()) {
+ pom = nodesIterator.next();
if (strcmp(pom->addr, addr) == 0)
return FALSE;
- pom = Nodes.takeFirst();
}
return TRUE;
}
if (nodelist->currentItem() >= 0) {
strcpy(pom, nodelist->text(nodelist->currentItem()).toStdString().c_str());
- vpom = Nodes.first();
- while (vpom != NULL) {
+
+ QListIterator<VLPEntry *> nodesIterator(Nodes);
+
+ while (nodesIterator.hasNext()) {
+ vpom = nodesIterator.next();
if (strcmp(pom, vpom->item) == 0)
break;
- vpom = Nodes.takeFirst();
}
if (vpom != NULL)
if (QMessageBox::question(this, "Delete VLP", "Are you sure?", "Yes", "No")) {
if (dlg.exec()) {
if (!Nodes.isEmpty()) {
- pom = Nodes.first();
- while (pom != NULL) {
+ QListIterator<VLPEntry *> nodesIterator(Nodes);
+
+ while (nodesIterator.hasNext()) {
+ pom = nodesIterator.next();
j = Nodes.indexOf(pom);
sprintf(pomstr, "%s.cfg", pom->addr);
config_destroy(&cfg);
pom = Nodes.at(j);
- pom = Nodes.takeFirst();
}
}
}