File 0001-Synchronizer-removeProfile-remove-profiles-even-if-p.patch of Package buteo-syncfw
From e0bb7f1fdae8413c020a0ef2bc45e51dbad71665 Mon Sep 17 00:00:00 2001
From: Patrick Ohly <patrick.ohly@intel.com>
Date: Wed, 9 Feb 2011 13:18:25 +0100
Subject: [PATCH] Synchronizer::removeProfile: remove profiles even if plugin cleanup failed
Removing a profile currently fails:
1. if a plugin doesn't implement cleanUp().
2. in the SyncML plugin if there were only failed syncs.
This patch allows the profile to be removed despite such false return
code from the plugin. Depending on the intended semantic of the return
code (which is not documented), this might not be the right solution, but
it solves the immediate problem.
A better, more intrusive solution might be:
- let plugins indicate permanent and temporary errors in their return code
- fix the default implementation of cleanUp()
- refuse to remove the profile only for temporary errors
---
msyncd/synchronizer.cpp | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/msyncd/synchronizer.cpp b/msyncd/synchronizer.cpp
index 917e721..c4a20a0 100644
--- a/msyncd/synchronizer.cpp
+++ b/msyncd/synchronizer.cpp
@@ -670,12 +670,11 @@ bool Synchronizer::removeProfile(QString aProfileId)
const SyncResults * syncResults = profile->lastResults();
if (!pluginRunner->cleanUp() && syncResults){
- LOG_CRITICAL ("Error in removing anchors, sync session ");
- } else {
- LOG_DEBUG("Removing the profile");
- iProfileManager.removeProfile(aProfileId);
- status = true;
+ LOG_WARNING ("error inside plugin while cleaning up");
}
+ LOG_DEBUG("Removing the profile");
+ iProfileManager.removeProfile(aProfileId);
+ status = true;
delete profile;
delete pluginRunner;
}
--
1.7.2.3