summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
authorar <ar>2004-06-01 22:21:23 (UTC)
committer ar <ar>2004-06-01 22:21:23 (UTC)
commitd4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce (patch) (unidiff)
tree4bab082304716df1ec924ef040161e3cf9c10366 /libopie2/opiepim/core
parentbaed1d5ab8589aef14440009bc4e7380bcc5a741 (diff)
downloadopie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.zip
opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.gz
opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.bz2
- convert to odebug framework
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp25
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h11
-rw-r--r--libopie2/opiepim/core/opimcontact.cpp4
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp4
-rw-r--r--libopie2/opiepim/core/opimrecordlist.h5
5 files changed, 29 insertions, 20 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index a372267..7a3d7cb 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -33,42 +33,47 @@
33 * 33 *
34 */ 34 */
35 35
36#include "ocontactaccess.h" 36#include "ocontactaccess.h"
37#include "obackendfactory.h" 37#include "obackendfactory.h"
38 38
39/* OPIE */
40#include <opie2/ocontactaccessbackend_xml.h>
41#include <opie2/opimresolver.h>
42#include <opie2/opimglobal.h>
43#include <opie2/odebug.h>
44
45//#include <qpe/qcopenvelope_qws.h>
46#include <qpe/global.h>
47
48/* QT */
39#include <qasciidict.h> 49#include <qasciidict.h>
40#include <qdatetime.h> 50#include <qdatetime.h>
41#include <qfile.h> 51#include <qfile.h>
42#include <qregexp.h> 52#include <qregexp.h>
43#include <qlist.h> 53#include <qlist.h>
44#include <qcopchannel_qws.h> 54#include <qcopchannel_qws.h>
45 55
46//#include <qpe/qcopenvelope_qws.h> 56/* STD */
47#include <qpe/global.h>
48
49#include <errno.h> 57#include <errno.h>
50#include <fcntl.h> 58#include <fcntl.h>
51#include <unistd.h> 59#include <unistd.h>
52#include <stdlib.h> 60#include <stdlib.h>
53 61
54#include <opie2/ocontactaccessbackend_xml.h>
55#include <opie2/opimresolver.h>
56#include <opie2/opimglobal.h>
57 62
58namespace Opie { 63namespace Opie {
59 64
60OPimContactAccess::OPimContactAccess ( const QString appname, const QString , 65OPimContactAccess::OPimContactAccess ( const QString appname, const QString ,
61 OPimContactAccessBackend* end, bool autosync ): 66 OPimContactAccessBackend* end, bool autosync ):
62 OPimAccessTemplate<OPimContact>( end ) 67 OPimAccessTemplate<OPimContact>( end )
63{ 68{
64 /* take care of the backend. If there is no one defined, we 69 /* take care of the backend. If there is no one defined, we
65 * will use the XML-Backend as default (until we have a cute SQL-Backend..). 70 * will use the XML-Backend as default (until we have a cute SQL-Backend..).
66 */ 71 */
67 if( end == 0 ) { 72 if( end == 0 ) {
68 qWarning ("Using BackendFactory !"); 73 owarn << "Using BackendFactory !" << oendl;
69 end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname ); 74 end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname );
70 } 75 }
71 // Set backend locally and in template 76 // Set backend locally and in template
72 m_backEnd = end; 77 m_backEnd = end;
73 OPimAccessTemplate<OPimContact>::setBackEnd (end); 78 OPimAccessTemplate<OPimContact>::setBackEnd (end);
74 79
@@ -136,19 +141,19 @@ bool OPimContactAccess::wasChangedExternally()const
136} 141}
137 142
138 143
139void OPimContactAccess::copMessage( const QCString &msg, const QByteArray & ) 144void OPimContactAccess::copMessage( const QCString &msg, const QByteArray & )
140{ 145{
141 if ( msg == "addressbookUpdated()" ){ 146 if ( msg == "addressbookUpdated()" ){
142 qWarning ("OPimContactAccess: Received addressbokUpdated()"); 147 owarn << "OPimContactAccess: Received addressbokUpdated()" << oendl;
143 emit signalChanged ( this ); 148 emit signalChanged ( this );
144 } else if ( msg == "flush()" ) { 149 } else if ( msg == "flush()" ) {
145 qWarning ("OPimContactAccess: Received flush()"); 150 owarn << "OPimContactAccess: Received flush()" << oendl;
146 save (); 151 save ();
147 } else if ( msg == "reload()" ) { 152 } else if ( msg == "reload()" ) {
148 qWarning ("OPimContactAccess: Received reload()"); 153 owarn << "OPimContactAccess: Received reload()" << oendl;
149 reload (); 154 reload ();
150 emit signalChanged ( this ); 155 emit signalChanged ( this );
151 } 156 }
152} 157}
153 158
154int OPimContactAccess::rtti() const 159int OPimContactAccess::rtti() const
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h
index e438980..55d600a 100644
--- a/libopie2/opiepim/core/opimaccesstemplate.h
+++ b/libopie2/opiepim/core/opimaccesstemplate.h
@@ -27,20 +27,23 @@
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30#ifndef OPIE_PIM_ACCESS_TEMPLATE_H 30#ifndef OPIE_PIM_ACCESS_TEMPLATE_H
31#define OPIE_PIM_ACCESS_TEMPLATE_H 31#define OPIE_PIM_ACCESS_TEMPLATE_H
32 32
33#include <qarray.h> 33/* OPIE */
34
35#include <opie2/opimrecord.h> 34#include <opie2/opimrecord.h>
36#include <opie2/opimaccessbackend.h> 35#include <opie2/opimaccessbackend.h>
37#include <opie2/opimrecordlist.h> 36#include <opie2/opimrecordlist.h>
38 37
39#include <opie2/opimcache.h> 38#include <opie2/opimcache.h>
40#include <opie2/opimtemplatebase.h> 39#include <opie2/opimtemplatebase.h>
40#include <opie2/odebug.h>
41
42/* QT */
43#include <qarray.h>
41 44
42namespace Opie { 45namespace Opie {
43 46
44class OPimAccessTemplatePrivate; 47class OPimAccessTemplatePrivate;
45/** 48/**
46 * Thats the frontend to our OPIE PIM 49 * Thats the frontend to our OPIE PIM
@@ -202,13 +205,13 @@ OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end )
202{ 205{
203 if (end ) 206 if (end )
204 end->setFrontend( this ); 207 end->setFrontend( this );
205} 208}
206template <class T> 209template <class T>
207OPimAccessTemplate<T>::~OPimAccessTemplate() { 210OPimAccessTemplate<T>::~OPimAccessTemplate() {
208 qWarning("~OPimAccessTemplate<T>"); 211 owarn << "~OPimAccessTemplate<T>" << oendl;
209 delete m_backEnd; 212 delete m_backEnd;
210} 213}
211template <class T> 214template <class T>
212bool OPimAccessTemplate<T>::load() { 215bool OPimAccessTemplate<T>::load() {
213 invalidateCache(); 216 invalidateCache();
214 return m_backEnd->load(); 217 return m_backEnd->load();
@@ -257,13 +260,13 @@ T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar,
257 uint current, typename OTemplateBase<T>::CacheDirection dir )const { 260 uint current, typename OTemplateBase<T>::CacheDirection dir )const {
258 /* 261 /*
259 * better do T.isEmpty() 262 * better do T.isEmpty()
260 * after a find this way we would 263 * after a find this way we would
261 * avoid two finds in QCache... 264 * avoid two finds in QCache...
262 */ 265 */
263 // qWarning("find it now %d", uid ); 266 // owarn << "find it now " << uid << oendl;
264 if (m_cache.contains( uid ) ) { 267 if (m_cache.contains( uid ) ) {
265 return m_cache.find( uid ); 268 return m_cache.find( uid );
266 } 269 }
267 270
268 T t = m_backEnd->find( uid, ar, current, dir ); 271 T t = m_backEnd->find( uid, ar, current, dir );
269 cache( t ); 272 cache( t );
diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp
index 48a74d0..36e9a93 100644
--- a/libopie2/opiepim/core/opimcontact.cpp
+++ b/libopie2/opiepim/core/opimcontact.cpp
@@ -1170,13 +1170,13 @@ void OPimContact::setAnniversary( const QDate &v )
1170/*! \fn QDate OPimContact::birthday() const 1170/*! \fn QDate OPimContact::birthday() const
1171 Returns the birthday of the contact. 1171 Returns the birthday of the contact.
1172*/ 1172*/
1173QDate OPimContact::birthday() const 1173QDate OPimContact::birthday() const
1174{ 1174{
1175 QString str = find( Qtopia::Birthday ); 1175 QString str = find( Qtopia::Birthday );
1176 // qWarning ("Birthday %s", str.latin1() ); 1176 // owarn << "Birthday " << str << oendl;
1177 if ( !str.isEmpty() ) 1177 if ( !str.isEmpty() )
1178 return OPimDateConversion::dateFromString ( str ); 1178 return OPimDateConversion::dateFromString ( str );
1179 else 1179 else
1180 return QDate(); 1180 return QDate();
1181} 1181}
1182 1182
@@ -1185,13 +1185,13 @@ QDate OPimContact::birthday() const
1185 Returns the anniversary of the contact. 1185 Returns the anniversary of the contact.
1186*/ 1186*/
1187QDate OPimContact::anniversary() const 1187QDate OPimContact::anniversary() const
1188{ 1188{
1189 QDate empty; 1189 QDate empty;
1190 QString str = find( Qtopia::Anniversary ); 1190 QString str = find( Qtopia::Anniversary );
1191 // qWarning ("Anniversary %s", str.latin1() ); 1191 // owarn << "Anniversary " << str << oendl;
1192 if ( !str.isEmpty() ) 1192 if ( !str.isEmpty() )
1193 return OPimDateConversion::dateFromString ( str ); 1193 return OPimDateConversion::dateFromString ( str );
1194 else 1194 else
1195 return empty; 1195 return empty;
1196} 1196}
1197 1197
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index 0f863aa..516dc79 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -224,14 +224,14 @@ void OPimNotifyManager::alarmsFromString( const QString& str )
224{ 224{
225 QStringList als = QStringList::split( ";", str ); 225 QStringList als = QStringList::split( ";", str );
226 for ( QStringList::Iterator it = als.begin(); it != als.end(); ++it ) 226 for ( QStringList::Iterator it = als.begin(); it != als.end(); ++it )
227 { 227 {
228 QStringList alarm = QStringList::split( ":", ( *it ), TRUE ); // allow empty 228 QStringList alarm = QStringList::split( ":", ( *it ), TRUE ); // allow empty
229 owarn << "alarm: " << alarm.join( "___" ) << "" << oendl; 229 owarn << "alarm: " << alarm.join( "___" ) << "" << oendl;
230 qWarning( "alarm[0]: %s %s", alarm[ 0 ].latin1(), 230 owarn << "alarm[0]: " << alarm[ 0 ] << " "
231 OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString().latin1() ); 231 << OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString() << oendl;
232 OPimAlarm al( alarm[ 2 ].toInt(), OPimDateConversion::dateTimeFromString( alarm[ 0 ] ), 232 OPimAlarm al( alarm[ 2 ].toInt(), OPimDateConversion::dateTimeFromString( alarm[ 0 ] ),
233 alarm[ 1 ].toInt() ); 233 alarm[ 1 ].toInt() );
234 add( al ); 234 add( al );
235 } 235 }
236} 236}
237 237
diff --git a/libopie2/opiepim/core/opimrecordlist.h b/libopie2/opiepim/core/opimrecordlist.h
index b23138d..1d5027f 100644
--- a/libopie2/opiepim/core/opimrecordlist.h
+++ b/libopie2/opiepim/core/opimrecordlist.h
@@ -30,12 +30,13 @@
30#ifndef ORECORDLIST_H 30#ifndef ORECORDLIST_H
31#define ORECORDLIST_H 31#define ORECORDLIST_H
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/opimtemplatebase.h> 34#include <opie2/opimtemplatebase.h>
35#include <opie2/opimrecord.h> 35#include <opie2/opimrecord.h>
36//#include <opie2/odebug.h>
36 37
37/* QT */ 38/* QT */
38#include <qarray.h> 39#include <qarray.h>
39 40
40namespace Opie 41namespace Opie
41{ 42{
@@ -186,13 +187,13 @@ OPimRecordListIterator<T>::~OPimRecordListIterator()
186} 187}
187 188
188 189
189template <class T> 190template <class T>
190OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator<T>& it ) 191OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator<T>& it )
191{ 192{
192 // qWarning("OPimRecordListIterator copy c'tor"); 193 //owarn << "OPimRecordListIterator copy c'tor" << oendl;
193 m_uids = it.m_uids; 194 m_uids = it.m_uids;
194 m_current = it.m_current; 195 m_current = it.m_current;
195 m_temp = it.m_temp; 196 m_temp = it.m_temp;
196 m_end = it.m_end; 197 m_end = it.m_end;
197 m_record = it.m_record; 198 m_record = it.m_record;
198 m_direction = it.m_direction; 199 m_direction = it.m_direction;
@@ -212,13 +213,13 @@ OPimRecordListIterator<T> &OPimRecordListIterator<T>::operator=( const OPimRecor
212} 213}
213 214
214 215
215template <class T> 216template <class T>
216T OPimRecordListIterator<T>::operator*() 217T OPimRecordListIterator<T>::operator*()
217{ 218{
218 //qWarning("operator* %d %d", m_current, m_uids[m_current] ); 219 //owarn << "operator* " << m_current << " " << m_uids[m_current] << oendl;
219 if ( !m_end ) 220 if ( !m_end )
220 m_record = m_temp->find( m_uids[ m_current ], m_uids, m_current, 221 m_record = m_temp->find( m_uids[ m_current ], m_uids, m_current,
221 m_direction ? Base::Forward : 222 m_direction ? Base::Forward :
222 Base::Reverse ); 223 Base::Reverse );
223 else 224 else
224 m_record = T(); 225 m_record = T();