- Timestamp:
- Feb 1, 2014, 5:02:56 PM (11 years ago)
- Location:
- XmlTools2/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XmlTools2/trunk/multidimvar.cpp
r906 r910 57 57 } 58 58 59 result += QString::number(this->multiDimValue .size()-1,'G',9); // last one does not have a space at the end59 result += QString::number(this->multiDimValue[this->multiDimValue.size()-1],'G',9); // last one does not have a space at the end 60 60 61 61 return result; -
XmlTools2/trunk/xmlpatch.cpp
r906 r910 8 8 9 9 if(forceTargetFilesWildcard!=""){ 10 std::cout << "User forced patch in the target file(s): " << this->forceTargetFilesWildcard.toLatin1().constData() << std::endl;11 } 12 13 if(this->patchFilesToProcess. size()==0){10 std::cout << "User forced patch in the target file(s): " << forceTargetFilesWildcard.toLatin1().constData() << std::endl; 11 } 12 13 if(this->patchFilesToProcess.isEmpty()){ 14 14 UtilXmlTools::displayErrorMessage("Loading patch files","No .patch or .oni-patch files were found for the wildcard: "+patchFilesWildcard); 15 15 } … … 47 47 48 48 QStringList filesToProcess; 49 50 filesToProcess=UtilXmlTools::getAllXmlFilesByWildcard(filesWildcard);51 52 49 pugi::xml_node nodeToInsertion; 53 50 pugi::xml_document newNode; 54 51 pugi::xml_parse_result result; 55 52 53 filesToProcess=UtilXmlTools::getAllXmlFilesByWildcard(filesWildcard); 54 55 if(filesToProcess.isEmpty()){ 56 UtilXmlTools::displayErrorMessage("@ADD_INSIDE_NODE","No XML files were found for the wildcard: "+filesWildcard); 57 } 58 56 59 result=newNode.load(xmlString.toLatin1().constData()); // load xml to insert 57 60 … … 95 98 QStringList filesToProcess; 96 99 100 pugi::xml_node nodeToDeletion; 101 97 102 filesToProcess=UtilXmlTools::getAllXmlFilesByWildcard(filesWildcard); 98 103 99 pugi::xml_node nodeToDeletion; 100 pugi::xml_parse_result result; 104 if(filesToProcess.isEmpty()){ 105 UtilXmlTools::displayErrorMessage("@REMOVE_NODE","No XML files were found for the wildcard: "+filesWildcard); 106 } 101 107 102 108 // Process all XmlFiles … … 184 190 filesToProcess=UtilXmlTools::getAllXmlFilesByWildcard(filesWildcard); 185 191 192 if(filesToProcess.isEmpty()){ 193 UtilXmlTools::displayErrorMessage("@CUSTOM_CODE","No XML files were found for the wildcard: "+filesWildcard); 194 } 195 186 196 rexmlfile.open(QFile::ReadOnly | QFile::Text); 187 197 jsxmlfile.open(QFile::ReadOnly | QFile::Text); … … 277 287 void XmlPatch::checkAndProcessValidCommands(QTextStream &fileStream){ 278 288 279 QString line; 280 QString filesWildcard; 289 QString line, filesWildcard; 281 290 QString xmlToInsert, command, jsCode; 282 291 XmlFilter filters; … … 294 303 filters.setAttributeName(getPatchParameterValue(line,"AttributeName")); 295 304 filters.setAttributeValue(getPatchParameterValue(line,"AttributeValue")); 296 if(this->forceTargetFilesWildcard==""){ 305 306 if(this->forceTargetFilesWildcard!=""){ 307 filesWildcard=this->forceTargetFilesWildcard; 308 } 309 else{ 297 310 filesWildcard=getPatchParameterValue(line,"Files"); 298 }299 else{300 filesWildcard=this->forceTargetFilesWildcard;301 311 } 302 312 … … 327 337 filters.setAttributeName(getPatchParameterValue(line,"AttributeName")); 328 338 filters.setAttributeValue(getPatchParameterValue(line,"AttributeValue")); 329 if(this->forceTargetFilesWildcard==""){ 339 340 if(this->forceTargetFilesWildcard!=""){ 341 filesWildcard=this->forceTargetFilesWildcard; 342 } 343 else{ 330 344 filesWildcard=getPatchParameterValue(line,"Files"); 331 }332 else{333 filesWildcard=this->forceTargetFilesWildcard;334 345 } 335 346 … … 354 365 else if(line.startsWith("@CUSTOM_CODE")){ 355 366 356 if(this->forceTargetFilesWildcard==""){ 367 if(this->forceTargetFilesWildcard!=""){ 368 filesWildcard=this->forceTargetFilesWildcard; 369 } 370 else{ 357 371 filesWildcard=getPatchParameterValue(line,"Files"); 358 }359 else{360 filesWildcard=this->forceTargetFilesWildcard;361 372 } 362 373 -
XmlTools2/trunk/xmltools.cpp
r906 r910 7 7 this->backupsEnabled=!noBackups; 8 8 9 if(this->filesToProcess. size()==0){9 if(this->filesToProcess.isEmpty()){ 10 10 UtilXmlTools::displayErrorMessage("Loading xml files","No XML files were found for the wildcard: "+filesWildcard); 11 11 } … … 67 67 for(int m=0; m<valuesToRemoveList.size(); m++){ 68 68 if(currValuesList[k]==valuesToRemoveList[m]){ 69 currValuesList[k]=""; // remove it69 currValuesList[k]=""; // flag to deletion 70 70 elementChanged=true; 71 71 } … … 74 74 75 75 if(elementChanged){ // If curr element changed update the XML 76 currValuesList.removeAll(""); // remove all files flagged to deletion 76 77 elements[j].text()=currValuesList.join(' ').toLatin1().constData(); 77 78 elementChanged=false;
Note:
See TracChangeset
for help on using the changeset viewer.