Not Logged In
|
Login
|
Register
Home
|
News
|
Projects
|
Releases
Bugs
|
RFE
|
Repositories
|
Help
projects
/
xestiaab
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1679607
)
Added source code, header and unit tests for the FN vCard property member and value...
author
Steve Brokenshire
<sbrokenshire@xestia.co.uk>
Thu, 10 Dec 2015 21:52:17 +0000
(21:52 +0000)
committer
Steve Brokenshire
<sbrokenshire@xestia.co.uk>
Thu, 10 Dec 2015 21:52:17 +0000
(21:52 +0000)
source/contacteditor/ContactDataObject.cpp
patch
|
blob
|
history
source/contacteditor/ContactDataObject.h
patch
|
blob
|
history
source/tests/LoadCheck-Load4.vcf
patch
|
blob
|
history
source/tests/xestiaab_contactload.h
patch
|
blob
|
history
diff --git
a/source/contacteditor/ContactDataObject.cpp
b/source/contacteditor/ContactDataObject.cpp
index
9ced5ea
..
28c29e7
100644
(file)
--- a/
source/contacteditor/ContactDataObject.cpp
+++ b/
source/contacteditor/ContactDataObject.cpp
@@
-77,6
+77,7
@@
ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){
int ContactLineLen = 0;
int QuoteBreakPoint = 0;
int GroupCount = 0;
int ContactLineLen = 0;
int QuoteBreakPoint = 0;
int GroupCount = 0;
+ int FNCount = 0;
wxString ContactLine;
wxString PropertyLine;
wxString PropertySeg1;
wxString ContactLine;
wxString PropertyLine;
wxString PropertySeg1;
@@
-188,6
+189,11
@@
ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){
ProcessMember(PropertySeg1, PropertySeg2, &GroupCount);
GroupCount++;
ProcessMember(PropertySeg1, PropertySeg2, &GroupCount);
GroupCount++;
+ } else if (Property == wxT("FN")){
+
+ ProcessFN(PropertySeg1, PropertySeg2, &FNCount);
+ FNCount++;
+
}
}
}
}
@@
-312,8
+318,6
@@
void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe
}
}
- //SplitValues(&PropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
-
GroupsList.insert(std::make_pair(*GroupCount, PropertySeg2));
if (!PropertyTokens.IsEmpty()){
GroupsList.insert(std::make_pair(*GroupCount, PropertySeg2));
if (!PropertyTokens.IsEmpty()){
@@
-325,6
+329,12
@@
void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe
}
}
+void ContactDataObject::ProcessFN(wxString PropertySeg1, wxString PropertySeg2, int *FNCount){
+
+ FullNamesList.insert(std::make_pair(*FNCount, PropertySeg2));
+
+}
+
void SplitValues(wxString *PropertyLine,
std::map<int,int> *SplitPoints,
std::map<int,int> *SplitLength,
void SplitValues(wxString *PropertyLine,
std::map<int,int> *SplitPoints,
std::map<int,int> *SplitLength,
diff --git
a/source/contacteditor/ContactDataObject.h
b/source/contacteditor/ContactDataObject.h
index
cd53dc9
..
b62c6a8
100644
(file)
--- a/
source/contacteditor/ContactDataObject.h
+++ b/
source/contacteditor/ContactDataObject.h
@@
-560,6
+560,7
@@
class ContactDataObject{
ContactLoadStatus LoadFile(wxString Filename);
void ProcessKind(wxString KindData);
void ProcessMember(wxString PropertySeg1, wxString PropertySeg2, int *GroupCount);
ContactLoadStatus LoadFile(wxString Filename);
void ProcessKind(wxString KindData);
void ProcessMember(wxString PropertySeg1, wxString PropertySeg2, int *GroupCount);
+ void ProcessFN(wxString PropertySeg1, wxString PropertySeg2, int *FNCount);
};
};
diff --git
a/source/tests/LoadCheck-Load4.vcf
b/source/tests/LoadCheck-Load4.vcf
index
df2a91a
..
b092f51
100644
(file)
--- a/
source/tests/LoadCheck-Load4.vcf
+++ b/
source/tests/LoadCheck-Load4.vcf
@@
-3,5
+3,5
@@
VERSION:4.0
KIND:individual
MEMBER;ALTID=35;PID=40;PREF=45;MEDIATYPE=text/plain;EXAMPLE=Meep:7a2af44d-64
31-4797-a55f-d86d56304fda
KIND:individual
MEMBER;ALTID=35;PID=40;PREF=45;MEDIATYPE=text/plain;EXAMPLE=Meep:7a2af44d-64
31-4797-a55f-d86d56304fda
-FN:Test
+FN:Test
Contact
END:VCARD
END:VCARD
diff --git
a/source/tests/xestiaab_contactload.h
b/source/tests/xestiaab_contactload.h
index
d7c1210
..
c8eca05
100644
(file)
--- a/
source/tests/xestiaab_contactload.h
+++ b/
source/tests/xestiaab_contactload.h
@@
-89,6
+89,11
@@
TEST(ContactLoad, ContactLoadTests){
ASSERT_NE(TestFile.GroupsListTokens.end(), TestFileIter);
ASSERT_EQ("EXAMPLE=Meep", TestFileIter->second);
ASSERT_NE(TestFile.GroupsListTokens.end(), TestFileIter);
ASSERT_EQ("EXAMPLE=Meep", TestFileIter->second);
+ // Check that the formatted name has been read (FN).
+
+ TestFileIter = TestFile.FullNamesList.find(0);
+ ASSERT_NE(TestFile.FullNamesList.end(), TestFileIter);
+ ASSERT_EQ("Test Contact", TestFileIter->second);
}
}
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software
Xestia Address Book
Xestia Calendar
Development
Xestia Gelforn
Everything else
About
News
Privacy Policy