1
0
mirror of https://github.com/etesync/android synced 2025-01-11 08:10:58 +00:00

Log group assignments more verbosely

This commit is contained in:
Ricki Hirner 2016-11-25 21:31:04 +01:00
parent d2df3c9027
commit 29068389c7
3 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,9 @@ import java.io.FileNotFoundException;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.logging.Level;
import at.bitfire.davdroid.App;
import at.bitfire.vcard4android.AndroidAddressBook; import at.bitfire.vcard4android.AndroidAddressBook;
import at.bitfire.vcard4android.AndroidContact; import at.bitfire.vcard4android.AndroidContact;
import at.bitfire.vcard4android.AndroidGroup; import at.bitfire.vcard4android.AndroidGroup;
@ -162,8 +164,10 @@ public class LocalAddressBook extends AndroidAddressBook implements LocalCollect
// find groups without members // find groups without members
/** should be done using {@link Groups.SUMMARY_COUNT}, but it's not implemented in Android yet */ /** should be done using {@link Groups.SUMMARY_COUNT}, but it's not implemented in Android yet */
for (LocalGroup group : (LocalGroup[])queryGroups(null, null)) 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(); group.delete();
}
} }
public void removeGroups() throws ContactsStorageException { public void removeGroups() throws ContactsStorageException {

View File

@ -451,10 +451,12 @@ public class ContactsSyncManager extends SyncManager {
LocalContact contact = (LocalContact)local; LocalContact contact = (LocalContact)local;
BatchOperation batch = new BatchOperation(provider); BatchOperation batch = new BatchOperation(provider);
App.log.log(Level.FINE, "Removing contact group memberships");
contact.removeGroupMemberships(batch); contact.removeGroupMemberships(batch);
for (String category : contact.getContact().categories) { for (String category : contact.getContact().categories) {
long groupID = localAddressBook().findOrCreateGroup(category); long groupID = localAddressBook().findOrCreateGroup(category);
App.log.log(Level.FINE, "Adding membership in group " + category + " (" + groupID + ")");
contact.addToGroup(batch, groupID); contact.addToGroup(batch, groupID);
} }

@ -1 +1 @@
Subproject commit eae31dac277c1b1d85f5870829fbc0ff1cb49735 Subproject commit 6eee71f9aac8573f353059879c8fe45f527cc391