Commit 29068389 authored by Ricki Hirner's avatar Ricki Hirner 🐑

Log group assignments more verbosely

parent d2df3c90
Pipeline #5142409 passed with stage
in 18 minutes and 25 seconds
......@@ -26,7 +26,9 @@ import java.io.FileNotFoundException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import at.bitfire.davdroid.App;
import at.bitfire.vcard4android.AndroidAddressBook;
import at.bitfire.vcard4android.AndroidContact;
import at.bitfire.vcard4android.AndroidGroup;
......@@ -162,8 +164,10 @@ public class LocalAddressBook extends AndroidAddressBook implements LocalCollect
// find groups without members
/** should be done using {@link Groups.SUMMARY_COUNT}, but it's not implemented in Android yet */
for (LocalGroup group : (LocalGroup[])queryGroups(null, null))
if (group.getMembers().length == 0)
if (group.getMembers().length == 0) {
App.log.log(Level.FINE, "Deleting group", group);
group.delete();
}
}
public void removeGroups() throws ContactsStorageException {
......
......@@ -451,10 +451,12 @@ public class ContactsSyncManager extends SyncManager {
LocalContact contact = (LocalContact)local;
BatchOperation batch = new BatchOperation(provider);
App.log.log(Level.FINE, "Removing contact group memberships");
contact.removeGroupMemberships(batch);
for (String category : contact.getContact().categories) {
long groupID = localAddressBook().findOrCreateGroup(category);
App.log.log(Level.FINE, "Adding membership in group " + category + " (" + groupID + ")");
contact.addToGroup(batch, groupID);
}
......
Subproject commit eae31dac277c1b1d85f5870829fbc0ff1cb49735
Subproject commit 6eee71f9aac8573f353059879c8fe45f527cc391
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment