ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/XmlTools2/trunk/xmltools.cpp
(Generate patch)

Comparing XmlTools2/trunk/xmltools.cpp (file contents):
Revision 906 by s10k, Sat Feb 1 14:27:58 2014 UTC vs.
Revision 910 by s10k, Sat Feb 1 16:02:56 2014 UTC

# Line 6 | Line 6 | XmlTools::XmlTools(QString filesWildcard
6      this->filters=filter;
7      this->backupsEnabled=!noBackups;
8  
9 <    if(this->filesToProcess.size()==0){
9 >    if(this->filesToProcess.isEmpty()){
10          UtilXmlTools::displayErrorMessage("Loading xml files","No XML files were found for the wildcard: "+filesWildcard);
11      }
12   }
# Line 66 | Line 66 | void XmlTools::removeValues(QString valu
66              for(int k=0; k<currValuesList.size(); k++){
67                  for(int m=0; m<valuesToRemoveList.size(); m++){
68                      if(currValuesList[k]==valuesToRemoveList[m]){
69 <                        currValuesList[k]=""; // remove it
69 >                        currValuesList[k]=""; // flag to deletion
70                          elementChanged=true;
71                      }
72                  }
73              }
74  
75              if(elementChanged){ // If curr element changed update the XML
76 +                currValuesList.removeAll(""); // remove all files flagged to deletion
77                  elements[j].text()=currValuesList.join(' ').toLatin1().constData();
78                  elementChanged=false;
79              }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)