X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FContactDataObject.cpp;h=854cb56c159635d27244f7ef6486b5ed037b92da;hb=cbb594a87fa3bf6d8511d637f8a390f0e9edc9ea;hp=927089546446a040f0e69ab0fc28dc31ae15ee51;hpb=d2c744f3bcfe1ff78525e4311302f7ffd3a6a6c6;p=xestiaab%2F.git diff --git a/source/contacteditor/ContactDataObject.cpp b/source/contacteditor/ContactDataObject.cpp index 9270895..854cb56 100644 --- a/source/contacteditor/ContactDataObject.cpp +++ b/source/contacteditor/ContactDataObject.cpp @@ -26,6 +26,27 @@ ContactLoadStatus ContactDataObject::LoadFile(wxString Filename){ } + wxFile ContactFile; + + if (!ContactFile.Open(Filename, wxFile::read, wxS_DEFAULT)){ + + return CONTACTLOAD_FILEERROR; + + } + + // Check that the vCard is a valid vCard 4.0 file. + + + vCard vCard4FormatCheck; + + vCard4FormatCheck.LoadFile(Filename); + + if (vCard4FormatCheck.Get("VERSION") != wxT("4.0")){ + + return CONTACTLOAD_FILEINVALIDFORMAT; + + } + return CONTACTLOAD_UNITTESTFAIL; } \ No newline at end of file