summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend_vcard.cpp13
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp13
2 files changed, 22 insertions, 4 deletions
diff --git a/libopie/pim/ocontactaccessbackend_vcard.cpp b/libopie/pim/ocontactaccessbackend_vcard.cpp
index ca9e410..1dc6b48 100644
--- a/libopie/pim/ocontactaccessbackend_vcard.cpp
+++ b/libopie/pim/ocontactaccessbackend_vcard.cpp
@@ -14,12 +14,15 @@
*
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.6 2003/01/13 15:49:31 eilers
+ * Fixing crash when businesscard.vcf is missing..
+ *
* Revision 1.5 2002/12/07 13:26:22 eilers
* Fixing bug in storing anniversary..
*
* Revision 1.4 2002/11/13 14:14:51 eilers
* Added sorted for Contacts..
*
@@ -52,15 +55,21 @@ OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString fil
bool OContactAccessBackend_VCard::load ()
{
m_map.clear();
m_dirty = false;
VObject* obj = 0l;
- obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() );
- if ( !obj )
+
+ if ( QFile( m_file ).exists() ){
+ obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() );
+ if ( !obj )
+ return false;
+ }else{
+ qWarning("File \"%s\" not found !", m_file.latin1() );
return false;
+ }
while ( obj ) {
OContact con = parseVObject( obj );
/*
* if uid is 0 assign a new one
* this at least happens on
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
index ca9e410..1dc6b48 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
@@ -14,12 +14,15 @@
*
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.6 2003/01/13 15:49:31 eilers
+ * Fixing crash when businesscard.vcf is missing..
+ *
* Revision 1.5 2002/12/07 13:26:22 eilers
* Fixing bug in storing anniversary..
*
* Revision 1.4 2002/11/13 14:14:51 eilers
* Added sorted for Contacts..
*
@@ -52,15 +55,21 @@ OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString fil
bool OContactAccessBackend_VCard::load ()
{
m_map.clear();
m_dirty = false;
VObject* obj = 0l;
- obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() );
- if ( !obj )
+
+ if ( QFile( m_file ).exists() ){
+ obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() );
+ if ( !obj )
+ return false;
+ }else{
+ qWarning("File \"%s\" not found !", m_file.latin1() );
return false;
+ }
while ( obj ) {
OContact con = parseVObject( obj );
/*
* if uid is 0 assign a new one
* this at least happens on