Remove straycats collected in the reconcile phase from journal.

This commit is contained in:
Klaas Freitag 2013-11-05 17:53:01 +01:00
parent 5cd2be058d
commit ee4cbf52dc

View File

@ -22,6 +22,7 @@
#include "syncjournaldb.h"
#include "syncjournalfilerecord.h"
#include "creds/abstractcredentials.h"
#include "csync_rename.h"
#ifdef Q_OS_WIN
#include <windows.h>
@ -429,6 +430,8 @@ void CSyncThread::startSync()
ne_session_s *session = 0;
// that call to set property actually is a get which will return the session
// FIXME add a csync_get_module_property to csync
csync_set_module_property(_csync_ctx, "get_dav_session", &session);
Q_ASSERT(session);
@ -455,6 +458,13 @@ void CSyncThread::startSync()
}
_propagator->_uploadLimit = uploadLimit;
// remove the straycats (superflous database entries)
int cnt = csync_straycat_count(_csync_ctx);
for( int i = 0; i < cnt; i++ ) {
_propagator->_journal->deleteFileRecord( QString::fromUtf8( csync_straycat_at(_csync_ctx, i) ) );
}
slotProgress(Progress::StartSync, QString(), 0, 0);
_propagator->start(_syncedItems);
}