| Summary: | after deleting single message: undo not working | ||
|---|---|---|---|
| Product: | [Unmaintained] kmail | Reporter: | Wilbert Berendsen <wbsoft> |
| Component: | general | Assignee: | kdepim bugs <pim-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jm-kde |
| Priority: | NOR | ||
| Version First Reported In: | 1.7 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Wilbert Berendsen
2004-08-31 14:29:40 UTC
The same holds true for moving messages: When 5 are moved and then Ctrl-Z is pressed, only 4 of them are moved back. Does completeMove(OK) in slotMsgAddedToDestFolder [kmcommands.cpp] close the folder, resulting in unGetMsg( mDestFolder->count() - 1 ) failing ?
something like this would work, but there are probably better ways.
Index: kmcommands.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmcommands.cpp,v
retrieving revision 1.164
diff -u -p -b -B -r1.164 kmcommands.cpp
--- kmcommands.cpp 29 Aug 2004 11:41:39 -0000 1.164
+++ kmcommands.cpp 3 Sep 2004 05:52:32 -0000
@@ -1813,6 +1813,9 @@ KMCommand::Result KMMoveCommand::execute
if ( !mDestFolder ) {
completeMove( OK );
}
+ if ( mDestFolder && !rc && (mDestFolder->folderType() != KMFolderTypeImap) ) {
+ completeMove( OK );
+ }
}
return OK;
@@ -1851,7 +1854,7 @@ void KMMoveCommand::slotMsgAddedToDestFo
if (mDestFolder && mDestFolder->folderType() != KMFolderTypeImap) {
mDestFolder->sync();
}
- completeMove( OK );
+ //completeMove( OK );
} else {
mProgressItem->incCompletedItems();
mProgressItem->updateProgress();
CVS commit by tilladam: Folder refcounting correctness fixes. CCMAIL: 88532-done@bugs.kde.org @earl grey: thanks, that was the right idea M +5 -0 kmcommands.cpp 1.169 --- kdepim/kmail/kmcommands.cpp #1.168:1.169 @@ -1639,7 +1639,9 @@ KMCommand::Result KMCopyCommand::execute } else { int rc, index; + mDestFolder->open(); rc = mDestFolder->addMsg(newMsg, &index); if (rc == 0 && index != -1) mDestFolder->unGetMsg( mDestFolder->count() - 1 ); + mDestFolder->close(); } } @@ -1764,4 +1766,5 @@ KMCommand::Result KMMoveCommand::execute } else { // We are moving to a local folder. + mDestFolder->open(); rc = mDestFolder->moveMsg(msg, &index); if (rc == 0 && index != -1) { @@ -1773,8 +1776,10 @@ KMCommand::Result KMMoveCommand::execute kmkernel->undoStack()->addMsgToAction( undoId, mb->getMsgSerNum() ); } + mDestFolder->close(); } else if (rc != 0) { // Something went wrong. Stop processing here, it is likely that the // other moves would fail as well. completeMove( Failed ); + mDestFolder->close(); return Failed; } |