One last patch for KPilot for 3.0.1

groot at kde.org groot at kde.org
Wed May 8 11:15:22 BST 2002


The attached patch prevents deleted empty records from the Pilot from
showing up in KAddressBook, and cleans up the Pilot's database afterwards.
OK to commit, even this late? (Otherwise it'll just go into 3.0.2).

[ade]

--
+------------------------------+-------------------------------------+
+ Adriaan de Groot             + KPilot 4.x Maintainer               +
+ groot at kde.org                + Palm OS (tm) device HotSync for KDE +
-------------- next part --------------
Index: abbrowser-conduit.cc
===================================================================
RCS file: /home/kde/kdepim/kpilot/conduits/abbrowserconduit/abbrowser-conduit.cc,v
retrieving revision 1.29
diff -u -r1.29 abbrowser-conduit.cc
--- abbrowser-conduit.cc	2002/01/31 13:20:07	1.29
+++ abbrowser-conduit.cc	2002/05/08 09:51:41
@@ -420,6 +424,15 @@
 {
 	ContactEntry entry;
 
+// If a record has been deleted on pda without archiving option,
+// flags modify and deleted will be set but the contents are empty.
+// We shouldn't add such zombies to database:
+	if (   (address.isModified() && address.isDeleted())
+	    && (address.getField(entryLastname) == 0)
+	    && (address.getField(entryFirstname) == 0)
+           )
+	 return;
+
 	_copy(entry, address);
 	_saveAbEntry(entry, QString::null);
 }
@@ -1431,6 +1445,16 @@
 		PilotAddress pilotAddress(fAddressAppInfo, record);
 		QString abKey = QString::null;
 
+#ifdef DEBUG
+		DEBUGCONDUIT << "ID: " << pilotAddress.id()
+			     << " Nachname: " << pilotAddress.getField(entryLastname)
+			     << " Vorname: " << pilotAddress.getField(entryFirstname)
+			     << " delFlag: " << pilotAddress.isDeleted()
+			     << " modFlag: " << pilotAddress.isModified()
+			     << " arcFlag: " << record->isArchived()
+			     << endl;
+#endif
+
 		//   if record not in abbrowser
 		if (!idContactMap.contains(pilotAddress.id()))
 		{
@@ -1549,6 +1573,9 @@
 	_stopAbbrowser(abAlreadyRunning);
 
 	fDatabase->resetSyncFlags();
+
+	fDatabase->cleanUpDatabase();
+
 	KPILOT_DELETE(fDatabase);
 	emit syncDone(this);
 }


More information about the kde-core-devel mailing list