From fbdbf673eed5922c61b665db10d39ac143f98713 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Sat, 19 Jul 2008 20:14:30 +0000 Subject: [PATCH] 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 --- folderstorage.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/folderstorage.cpp b/folderstorage.cpp index bdbd0e896..17dc774e8 100644 --- a/folderstorage.cpp +++ b/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