/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/VcardImporter.java

  • Committer: edam
  • Date: 2013-01-06 20:22:19 UTC
  • Revision ID: tim@ed.am-20130106202219-ijqj7hyllummpmgv
Tags: 1.3.1
updated manifest

Show diffs side-by-side

added added

removed removed

133
133
                        boolean in_vcard = false;
134
134
                        while( ( line = reader.readLine() ) != null )
135
135
                        {
136
 
                                if( !in_vcard )
137
 
                                {
 
136
                                if( !in_vcard ) {
138
137
                                        // look for vcard beginning
139
 
                                        if( line.matches( "(?i)BEGIN[ \t]*:[ \t]*VCARD.*" ) ) {
 
138
                                        if( line.matches( "^BEGIN[ \t]*:[ \t]*VCARD.*$" ) ) {
140
139
                                                in_vcard = true;
141
140
                                                _vcard_count++;
142
141
                                        }
143
 
                                        // check for vMsg files
144
 
                                        else if( line.matches( "(?i)BEGIN[ \t]*:[ \t]*VMSG.*" ) ) {
145
 
                                                showError( getText( R.string.error_vcf_vmsgfile )
146
 
                                                        + file.getName() );
147
 
                                        }
148
142
                                }
149
 
                                else if( line.matches( "(?i)END[ \t]*:[ \t]*VCARD.*" ) )
 
143
                                else if( line.matches( "^END[ \t]*:[ \t]*VCARD.*$" ) )
150
144
                                        in_vcard = false;
151
145
                        }
152
146
 
209
203
 
210
204
                        if( vcard == null ) {
211
205
                                // look for vcard beginning
212
 
                                if( line.matches( "(?i)BEGIN[ \t]*:[ \t]*VCARD.*" ) ) {
 
206
                                if( line.matches( "^BEGIN[ \t]*:[ \t]*VCARD.*$" ) ) {
213
207
                                        setProgress( _progress++ );
214
208
                                        vcard = new Vcard();
215
209
                                        vcard_start_line = cli.getLineNumber();
217
211
                        }
218
212
                        else {
219
213
                                // look for vcard content or ending
220
 
                                if( line.matches( "(?i)END[ \t]*:[ \t]*VCARD.*" ) )
 
214
                                if( line.matches( "^END[ \t]*:[ \t]*VCARD.*$" ) )
221
215
                                {
222
216
                                        // finalise the vcard/contact
223
217
                                        try {