Merged revisions 829986 via svnmerge from

svn+ssh://tmcguire@svn.kde.org/home/kde/trunk/KDE/kdepim

........
  r829986 | tmcguire | 2008-07-09 15:34:41 +0200 (Wed, 09 Jul 2008) | 3 lines
  
  Don't fail when renaming the sorted file fails (and add some kWarnings in case of error).
  BUG: 166023
........

svn path=/branches/kdepim/enterprise4/kdepim/; revision=835007
wilder-work
Thomas McGuire 18 years ago
parent ddf7b2097e
commit fbdbf673ee
  1. 17
      folderstorage.cpp

@ -688,16 +688,29 @@ int FolderStorage::rename( const QString &newName, KMFolderDir *newParent )
if ( !oldIndexLoc.isEmpty() ) {
if ( KDE_rename( QFile::encodeName( oldIndexLoc ),
QFile::encodeName( newIndexLoc ) ) != 0 )
{
kWarning() << "Failed to rename the index file from" << oldIndexLoc
<< "to" << newIndexLoc;
return 1;
}
if ( KDE_rename( QFile::encodeName( oldSortedLoc ),
QFile::encodeName( newSortedLoc ) ) != 0 )
return 1;
{
kWarning() << "Failed to rename the sorted file from" << oldSortedLoc
<< "to" << newSortedLoc;
// Don't return here, the sorted file is not that critically, and apparently
// sometimes doesn't exist (in case of empty folder, for example).
//return 1;
}
}
// rename/move serial number file
if ( !oldIdsLoc.isEmpty() ) {
if ( KDE_rename( QFile::encodeName( oldIdsLoc ), QFile::encodeName( newIdsLoc ) ) != 0 )
if ( KDE_rename( QFile::encodeName( oldIdsLoc ), QFile::encodeName( newIdsLoc ) ) != 0 ) {
kWarning() << "Failed to rename the serial number file from" << oldIdsLoc
<< "to" << newIdsLoc;
return 1;
}
}
// rename/move the subfolder directory

Loading…
Cancel
Save