Index: xmlgui/kxmlguiclient.cpp =================================================================== --- xmlgui/kxmlguiclient.cpp (revision 709581) +++ xmlgui/kxmlguiclient.cpp (working copy) @@ -785,11 +785,11 @@ allDocuments.append( d ); } - QList::Iterator best = allDocuments.end(); + QList::const_iterator best = allDocuments.end(); uint bestVersion = 0; - QList::Iterator docIt = allDocuments.begin(); - QList::Iterator docEnd = allDocuments.end(); + QList::const_iterator docIt = allDocuments.begin(); + const QList::const_iterator docEnd = allDocuments.end(); for (; docIt != docEnd; ++docIt ) { QString versionStr = findVersionNumber( (*docIt).data ); @@ -814,19 +814,19 @@ { if ( best != allDocuments.begin() ) { - QList::Iterator local = allDocuments.begin(); + QList::iterator local = allDocuments.begin(); + if ( (*local).file.startsWith(KGlobal::dirs()->localkdedir()) ) { - // load the local document and extract the action properties - QDomDocument document; - document.setContent( (*local).data ); + // load the local document and extract the action properties + QDomDocument document; + document.setContent( (*local).data ); - ActionPropertiesMap properties = extractActionProperties( document ); + ActionPropertiesMap properties = extractActionProperties( document ); - // in case the document has a ActionProperties section - // we must not delete it but copy over the global doc - // to the local and insert the ActionProperties section - if ( !properties.isEmpty() ) - { + // in case the document has a ActionProperties section + // we must not delete it but copy over the global doc + // to the local and insert the ActionProperties section + if ( !properties.isEmpty() ) { // now load the global one with the higher version number // into memory document.setContent( (*best).data ); @@ -845,14 +845,14 @@ f.write( utf8data.constData(), utf8data.length() ); f.close(); } + } + else + { + QString f = (*local).file; + QString backup = f + QLatin1String( ".backup" ); + QFile::rename( f, backup ); + } } - else - { - QString f = (*local).file; - QString backup = f + QLatin1String( ".backup" ); - QDir dir; - dir.rename( f, backup ); - } } doc = (*best).data; return (*best).file;