/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/importcontacts/Importer.java

  • Committer: Tim Marston
  • Date: 2013-06-22 17:29:31 UTC
  • Revision ID: tim@ed.am-20130622172931-ujydoni23t3a543b
minor style tweaks

Show diffs side-by-side

added added

removed removed

1
1
/*
2
2
 * Importer.java
3
3
 *
4
 
 * Copyright (C) 2009 to 2013 Tim Marston <tim@ed.am>
 
4
 * Copyright (C) 2009 to 2012 Tim Marston <tim@ed.am>
5
5
 *
6
6
 * This file is part of the Import Contacts program (hereafter referred
7
7
 * to as "this program").  For more information, see
142
142
                protected HashMap< String, PreferredDetail > _emails = null;
143
143
                protected HashMap< String, TypeDetail > _addresses = null;
144
144
                protected HashSet< String > _notes = null;
145
 
                protected String _birthday = null;
146
145
 
147
146
                private ContactsCache.CacheIdentifier _cache_identifier = null;
148
147
 
363
362
                        return _notes;
364
363
                }
365
364
 
366
 
                public void setBirthday( String birthday )
367
 
                {
368
 
                        _birthday = birthday;
369
 
                }
370
 
 
371
 
                public boolean hasBirthday()
372
 
                {
373
 
                        return _birthday != null;
374
 
                }
375
 
 
376
 
                public String getBirthday()
377
 
                {
378
 
                        return _birthday;
379
 
                }
380
 
 
381
365
                protected void finalise()
382
366
                        throws ContactNotIdentifiableException
383
367
                {
778
762
                                importContactOrganisations( id, contact.getOrganisations() );
779
763
                        if( contact.hasNotes() )
780
764
                                importContactNotes( id, contact.getNotes() );
781
 
                        if( contact.hasBirthday() )
782
 
                                importContactBirthday( id, contact.getBirthday() );
783
765
                }
784
766
                catch( Backend.ContactCreationException e )
785
767
                {
892
874
                }
893
875
        }
894
876
 
895
 
        private void importContactNotes( Long id, HashSet< String > datas )
 
877
        private void importContactNotes( Long id,
 
878
                HashSet< String > datas )
896
879
                throws ContactCreationException
897
880
        {
898
881
                // add notes
912
895
                        // date from another file
913
896
                        _contacts_cache.addAssociatedNote( id, note );
914
897
                }
915
 
        }
916
 
 
917
 
        private void importContactBirthday( Long id, String birthday )
918
 
                throws ContactCreationException
919
 
        {
920
 
                // we don't want to import this birthday if it already exists
921
 
                if( _contacts_cache.hasAssociatedBirthday( id, birthday ) )
922
 
                        return;
923
 
 
924
 
                // add birthday
925
 
                _backend.addContactBirthday( id, birthday );
926
 
 
927
 
                // and update the cache
928
 
                _contacts_cache.addAssociatedBirthday( id, birthday );
 
898
 
929
899
        }
930
900
 
931
901
        synchronized protected void checkAbort() throws AbortImportException