Make sure to reset the db id (in the sqlite index) otherwise

it will be reused in the target folder, on move, and overwrite the entry
for any existing entry at that row, thereby bringing the index out of sync
with reality.

svn path=/trunk/KDE/kdepim/; revision=812625
wilder-work
Till Adam 18 years ago
parent 4d65e340e9
commit 7c56fe6b9e
  1. 6
      kmfoldermaildir.cpp

@ -403,11 +403,10 @@ if( fileD0.open( QIODevice::WriteOnly ) ) {
fileD0.close(); // If data is 0 we just create a zero length file.
}
*/
KMFolder* msgParent;
int idx(-1);
// take message out of the folder it is currently in, if any
msgParent = aMsg->parent();
KMFolder* msgParent = aMsg->parent();
if (msgParent)
{
if (msgParent==folder() && !kmkernel->folderIsDraftOrOutbox(folder()))
@ -514,6 +513,9 @@ if( fileD0.open( QIODevice::WriteOnly ) ) {
if (mAutoCreateIndex)
{
#ifdef KMAIL_SQLITE_INDEX
// reset the db id, in case we have one, we are about to change folders
// and can't reuse it there
aMsg->setDbId( 0 );
#else
assert(mIndexStream != 0);
clearerr(mIndexStream);

Loading…
Cancel
Save