Use c++11 auto keyword
[vlp.git] / src / lgconfig / lgconfig.cpp
index 58872ca4c0d5e8f2fdec39e213acc758abb1263d..7c7fcb2ef49ebf1a7fc6253e091a3086bd1c7fc6 100644 (file)
@@ -235,7 +235,7 @@ void QInstall::SetOptions()
        QLabel *tmpQLabel;
        QPushButton *addbtn, *delbtn, *okbtn, *cancelbtn;
        VLPEntry *pom;
-       int i, j;
+       int i;
        char pomstr[255];
 
        //dlg.setStyle(WindowsStyle);
@@ -274,7 +274,7 @@ void QInstall::SetOptions()
                        
                        while (nodesIterator.hasNext()) {
                                pom = nodesIterator.next();
-                               j = Nodes.indexOf(pom);
+                               i = Nodes.indexOf(pom);
                                sprintf(pomstr, "%s.cfg", pom->addr);
 
                                config_t cfg;
@@ -308,13 +308,13 @@ void QInstall::SetOptions()
                                        }
                                        config_setting_set_string(setting, "explicit");
                                }
-                               for (i = 0; i < Nodes.count(); i++) {
-                                       if (pom != Nodes.at(i)) {
+                               for (auto node : Nodes) {
+                                       if (pom != node) {
                                                setting = config_setting_get_member(root, "host");
                                                if (!setting) {
                                                        setting = config_setting_add(root, "host", CONFIG_TYPE_STRING);
                                                }
-                                               config_setting_set_string(setting, Nodes.at(i)->addr);
+                                               config_setting_set_string(setting, node->addr);
                                        }
                                }
 
@@ -323,7 +323,7 @@ void QInstall::SetOptions()
                                }
                                config_destroy(&cfg);
 
-                               pom = Nodes.at(j);
+                               pom = Nodes.at(i);
                        }
                }
        }