/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/org/waxworlds/edam/importcontacts/Doit.java

  • Committer: edam
  • Date: 2011-05-30 15:33:01 UTC
  • Revision ID: edam@waxworlds.org-20110530153301-oor6ci9b3hf9clul
- refactored some code to do with how contacts are imported
- Vcards (and ContactData) instances now generate a CacheIdentifier when they are finalised so that ContactData instances that do not have enough information to identify them can be discovered then
- importContact() now calls the private method checkForDuplicate(), renamed from isImportRequired(), and return if it is not
- importContact() and checkForDuplicate() now use the ContactData's generated CacheIdentifier

Show diffs side-by-side

added added

removed removed

220
220
                                                public void onClick( DialogInterface dialog,
221
221
                                                        int whichButton )
222
222
                                                {
223
 
                                                        if( Doit.this != null )
224
 
                                                                Doit.this._importer.wake();
 
223
                                                        Doit.this._importer.wake();
225
224
                                                }
226
225
                                        } )
227
226
                                .setOnCancelListener( _dialog_on_cancel_listener )
236
235
                                                public void onClick( DialogInterface dialog,
237
236
                                                        int which_button )
238
237
                                                {
239
 
                                                        if( Doit.this != null )
240
 
                                                                Doit.this._importer.wake(
241
 
                                                                        Importer.RESPONSE_POSITIVE );
 
238
                                                        Doit.this._importer.wake(
 
239
                                                                Importer.RESPONSE_POSITIVE );
242
240
                                                }
243
241
                                        } )
244
242
                                .setNegativeButton( R.string.error_abort,
246
244
                                                public void onClick( DialogInterface dialog,
247
245
                                                        int which_button )
248
246
                                                {
249
 
                                                        if( Doit.this != null )
250
 
                                                                Doit.this._importer.wake(
251
 
                                                                        Importer.RESPONSE_NEGATIVE );
 
247
                                                        Doit.this._importer.wake(
 
248
                                                                Importer.RESPONSE_NEGATIVE );
252
249
                                                }
253
250
                                        } )
254
251
                                .setOnCancelListener( _dialog_on_cancel_listener )
264
261
                                                public void onCheckedChanged(
265
262
                                                        CompoundButton button_view, boolean is_checked )
266
263
                                                {
267
 
                                                        if( Doit.this != null )
268
 
                                                                Doit.this._merge_prompt_always_selected =
269
 
                                                                        is_checked;
 
264
                                                        Doit.this._merge_prompt_always_selected =
 
265
                                                                is_checked;
270
266
                                                }
271
267
                                        } );
272
268
                        ( (Button)dialog_view.findViewById( R.id.merge_keep ) ).
293
289
        {
294
290
                public void onClick( View view )
295
291
                {
296
 
                        if( Doit.this == null ) return;
297
 
 
298
292
                        // handle abort
299
293
                        if( view.getId() == R.id.abort )
300
294
                                manualAbort();