Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Removed unused variable from the Import Contacts.
[xestiaab/.git] / source / import / import-vcard3.cpp
1 #include <map>
2 #include <wx/wx.h>
4 #include "../vcard/vcard.h"
5 #include "../vcard/vcard34conv.h"
6 #include "import-struct.h"
8 std::map<int,ImportDataContact> ImportVCard3(wxArrayString *FileListInc){
10         std::map<int,ImportDataContact> FinalData;
11         
12         // Go through each of the file names, load them up and collect the
13         // contact information.
14         
15         std::map<int,wxString>* CardData;
16         
17         for (int i = 0; i < FileListInc->GetCount(); i++){
18         
19                 vCard ContactData;
20                 
21                 ContactData.LoadFile(FileListInc->Item(i));
22                 
23                 CardData = ContactData.GetAllCards();
24                 int FileIndex = 0;
25                 
26                 for(std::map<int,wxString>::iterator iter = CardData->begin(); 
27                         iter != CardData->end();
28                         iter++){
29                 
30                         // Check if contact really is a vCard 4.0 contact.
31                         
32                         vCard ContactCheck;
33                         ContactCheck.LoadString(iter->second);
34                         
35                         wxString ContactVer = ContactCheck.Get(wxT("VERSION"));
36                         
37                         if (ContactVer != wxT("3.0")){
38                         
39                                 continue;
40                         
41                         }
42                 
43                         wxString ContactDatav3;
44                         vCard ContactDatav4;
45                         
46                         vCard34Conv vCardConvObj;               
47                         vCardConvObj.ConvertToV4(&ContactDatav3, &ContactDatav4);
48                 
49                         // Convert data from vCard 3.0 to vCard 4.0
50                 
51                         ImportDataContact SelectedContact;
52                         SelectedContact.Filename = FileListInc->Item(i);
53                         SelectedContact.FilenameIndex = FileIndex;
54                         SelectedContact.ContactData = ContactDatav4.WriteString();
55                         SelectedContact.UIDValue = ContactDatav4.Get(wxT("UID"));
56                 
57                         FileIndex++;
58                 
59                 }
60                 
61         }
62         
63         return FinalData;
65
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy