From 185fdaf910fb816b958bdce780518dfdf40029b4 Mon Sep 17 00:00:00 2001 From: Christopher Harvey Date: Mon, 14 Jun 2010 19:15:54 -0400 Subject: Fixed adding optional entries when duplicate nodes don't start at 1 --- src/ventoo/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ventoo/main.py b/src/ventoo/main.py index af22595..e3ee2c8 100644 --- a/src/ventoo/main.py +++ b/src/ventoo/main.py @@ -295,12 +295,14 @@ class MainWindow(gtk.Window): numNeeded = augeas_utils.matchDiff(thisMult, have) #add the required ones. for i in range(numNeeded): - created = model.append(modelPathIter, [True, osp.join(augeasFileRoot, str(have+i+1)), '-------']) + created = model.append(modelPathIter, [True, osp.join(augeasFileRoot, str(maxIndex+i+1)), '-------']) self.__buildEditModel(model, match, created, xmlRoot) have += 1 + maxIndex += 1 needOption = not augeas_utils.matchExact(thisMult, have) if needOption: - created = model.append(modelPathIter, [False, str(have+1), '-------']) + created = model.append(modelPathIter, [False, str(maxIndex+1), '-------']) + maxIndex += 1 else: listedNodes = [] #a list of nodes that we already found and know about. for child in xChildren: -- cgit v1.2.3-65-gdbad