summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontactaccessbackend_vcard.cpp
Unidiff
Diffstat (limited to 'libopie/pim/ocontactaccessbackend_vcard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend_vcard.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libopie/pim/ocontactaccessbackend_vcard.cpp b/libopie/pim/ocontactaccessbackend_vcard.cpp
index f24523f..270bef3 100644
--- a/libopie/pim/ocontactaccessbackend_vcard.cpp
+++ b/libopie/pim/ocontactaccessbackend_vcard.cpp
@@ -1,43 +1,48 @@
1/* 1/*
2 * VCard Backend for the OPIE-Contact Database. 2 * VCard Backend for the OPIE-Contact Database.
3 * 3 *
4 * Copyright (C) 2000 Trolltech AS. All rights reserved. 4 * Copyright (C) 2000 Trolltech AS. All rights reserved.
5 * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) 5 * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de)
6 * 6 *
7 * ===================================================================== 7 * =====================================================================
8 *This program is free software; you can redistribute it and/or 8 *This program is free software; you can redistribute it and/or
9 *modify it under the terms of the GNU Library General Public 9 *modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * ===================================================================== 12 * =====================================================================
13 * ToDo: 13 * ToDo:
14 * 14 *
15 * ===================================================================== 15 * =====================================================================
16 * Version: $Id$ 16 * Version: $Id$
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.10 2003/04/13 18:07:10 zecke
21 * More API doc
22 * QString -> const QString&
23 * QString = 0l -> QString::null
24 *
20 * Revision 1.9 2003/03/21 10:33:09 eilers 25 * Revision 1.9 2003/03/21 10:33:09 eilers
21 * Merged speed optimized xml backend for contacts to main. 26 * Merged speed optimized xml backend for contacts to main.
22 * Added QDateTime to querybyexample. For instance, it is now possible to get 27 * Added QDateTime to querybyexample. For instance, it is now possible to get
23 * all Birthdays/Anniversaries between two dates. This should be used 28 * all Birthdays/Anniversaries between two dates. This should be used
24 * to show all birthdays in the datebook.. 29 * to show all birthdays in the datebook..
25 * This change is sourcecode backward compatible but you have to upgrade 30 * This change is sourcecode backward compatible but you have to upgrade
26 * the binaries for today-addressbook. 31 * the binaries for today-addressbook.
27 * 32 *
28 * Revision 1.8 2003/02/21 16:52:49 zecke 33 * Revision 1.8 2003/02/21 16:52:49 zecke
29 * -Remove old Todo classes they're deprecated and today I already using the 34 * -Remove old Todo classes they're deprecated and today I already using the
30 * new API 35 * new API
31 * -Guard against self assignment in OTodo 36 * -Guard against self assignment in OTodo
32 * -Add test apps for OPIM 37 * -Add test apps for OPIM
33 * -Opiefied Event classes 38 * -Opiefied Event classes
34 * -Added TimeZone handling and pinning of TimeZones to OEvent 39 * -Added TimeZone handling and pinning of TimeZones to OEvent
35 * -Adjust ORecur and the widget to better timezone behaviour 40 * -Adjust ORecur and the widget to better timezone behaviour
36 * 41 *
37 * Revision 1.7 2003/02/16 22:25:46 zecke 42 * Revision 1.7 2003/02/16 22:25:46 zecke
38 * 0000276 Fix for that bug.. or better temp workaround 43 * 0000276 Fix for that bug.. or better temp workaround
39 * A Preferred Number is HOME|VOICE 44 * A Preferred Number is HOME|VOICE
40 * A CellPhone is HOME|VOICE|CELL the type & HOME|VOICE test 45 * A CellPhone is HOME|VOICE|CELL the type & HOME|VOICE test
41 * triggers both 46 * triggers both
42 * and the cell phone number overrides the other entries.. 47 * and the cell phone number overrides the other entries..
43 * 48 *
@@ -55,49 +60,49 @@
55 * Revision 1.5 2002/12/07 13:26:22 eilers 60 * Revision 1.5 2002/12/07 13:26:22 eilers
56 * Fixing bug in storing anniversary.. 61 * Fixing bug in storing anniversary..
57 * 62 *
58 * Revision 1.4 2002/11/13 14:14:51 eilers 63 * Revision 1.4 2002/11/13 14:14:51 eilers
59 * Added sorted for Contacts.. 64 * Added sorted for Contacts..
60 * 65 *
61 * Revision 1.3 2002/11/11 16:41:09 kergoth 66 * Revision 1.3 2002/11/11 16:41:09 kergoth
62 * no default arguments in implementation 67 * no default arguments in implementation
63 * 68 *
64 * Revision 1.2 2002/11/10 15:41:53 eilers 69 * Revision 1.2 2002/11/10 15:41:53 eilers
65 * Bugfixes.. 70 * Bugfixes..
66 * 71 *
67 * Revision 1.1 2002/11/09 14:34:52 eilers 72 * Revision 1.1 2002/11/09 14:34:52 eilers
68 * Added VCard Backend. 73 * Added VCard Backend.
69 * 74 *
70 */ 75 */
71#include "ocontactaccessbackend_vcard.h" 76#include "ocontactaccessbackend_vcard.h"
72#include "../../library/backend/vobject_p.h" 77#include "../../library/backend/vobject_p.h"
73#include "../../library/backend/qfiledirect_p.h" 78#include "../../library/backend/qfiledirect_p.h"
74 79
75#include <qpe/timeconversion.h> 80#include <qpe/timeconversion.h>
76 81
77#include <qfile.h> 82#include <qfile.h>
78 83
79OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString filename ): 84OContactAccessBackend_VCard::OContactAccessBackend_VCard ( const QString& , const QString& filename ):
80 m_dirty( false ), 85 m_dirty( false ),
81 m_file( filename ) 86 m_file( filename )
82{ 87{
83 load(); 88 load();
84} 89}
85 90
86 91
87bool OContactAccessBackend_VCard::load () 92bool OContactAccessBackend_VCard::load ()
88{ 93{
89 m_map.clear(); 94 m_map.clear();
90 m_dirty = false; 95 m_dirty = false;
91 96
92 VObject* obj = 0l; 97 VObject* obj = 0l;
93 98
94 if ( QFile::exists(m_file) ){ 99 if ( QFile::exists(m_file) ){
95 obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() ); 100 obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() );
96 if ( !obj ) 101 if ( !obj )
97 return false; 102 return false;
98 }else{ 103 }else{
99 qWarning("File \"%s\" not found !", m_file.latin1() ); 104 qWarning("File \"%s\" not found !", m_file.latin1() );
100 return false; 105 return false;
101 } 106 }
102 107
103 while ( obj ) { 108 while ( obj ) {