-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 117 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 17 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimcontact.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimnotifymanager.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecordlist.h | 5 |
5 files changed, 78 insertions, 69 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 | |||
@@ -38,2 +38,12 @@ | |||
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> |
@@ -45,5 +55,3 @@ | |||
45 | 55 | ||
46 | //#include <qpe/qcopenvelope_qws.h> | 56 | /* STD */ |
47 | #include <qpe/global.h> | ||
48 | |||
49 | #include <errno.h> | 57 | #include <errno.h> |
@@ -53,5 +61,2 @@ | |||
53 | 61 | ||
54 | #include <opie2/ocontactaccessbackend_xml.h> | ||
55 | #include <opie2/opimresolver.h> | ||
56 | #include <opie2/opimglobal.h> | ||
57 | 62 | ||
@@ -60,26 +65,26 @@ namespace Opie { | |||
60 | OPimContactAccess::OPimContactAccess ( const QString appname, const QString , | 65 | OPimContactAccess::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 | ||
75 | 80 | ||
76 | /* Connect signal of external db change to function */ | 81 | /* Connect signal of external db change to function */ |
77 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); | 82 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); |
78 | connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), | 83 | connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), |
79 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); | 84 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); |
80 | if ( autosync ){ | 85 | if ( autosync ){ |
81 | QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); | 86 | QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); |
82 | connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)), | 87 | connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)), |
83 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); | 88 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); |
84 | } | 89 | } |
85 | 90 | ||
@@ -89,7 +94,7 @@ OPimContactAccess::~OPimContactAccess () | |||
89 | { | 94 | { |
90 | /* The user may forget to save the changed database, therefore try to | 95 | /* The user may forget to save the changed database, therefore try to |
91 | * do it for him.. | 96 | * do it for him.. |
92 | */ | 97 | */ |
93 | save(); | 98 | save(); |
94 | // delete m_backEnd; is done by template.. | 99 | // delete m_backEnd; is done by template.. |
95 | } | 100 | } |
@@ -99,17 +104,17 @@ bool OPimContactAccess::save () | |||
99 | { | 104 | { |
100 | /* If the database was changed externally, we could not save the | 105 | /* If the database was changed externally, we could not save the |
101 | * Data. This will remove added items which is unacceptable ! | 106 | * Data. This will remove added items which is unacceptable ! |
102 | * Therefore: Reload database and merge the data... | 107 | * Therefore: Reload database and merge the data... |
103 | */ | 108 | */ |
104 | if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() ) | 109 | if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() ) |
105 | reload(); | 110 | reload(); |
106 | 111 | ||
107 | bool status = OPimAccessTemplate<OPimContact>::save(); | 112 | bool status = OPimAccessTemplate<OPimContact>::save(); |
108 | if ( !status ) return false; | 113 | if ( !status ) return false; |
109 | 114 | ||
110 | /* Now tell everyone that new data is available. | 115 | /* Now tell everyone that new data is available. |
111 | */ | 116 | */ |
112 | QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); | 117 | QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); |
113 | 118 | ||
114 | return true; | 119 | return true; |
115 | } | 120 | } |
@@ -118,3 +123,3 @@ const uint OPimContactAccess::querySettings() | |||
118 | { | 123 | { |
119 | return ( m_backEnd->querySettings() ); | 124 | return ( m_backEnd->querySettings() ); |
120 | } | 125 | } |
@@ -123,3 +128,3 @@ bool OPimContactAccess::hasQuerySettings ( int querySettings ) const | |||
123 | { | 128 | { |
124 | return ( m_backEnd->hasQuerySettings ( querySettings ) ); | 129 | return ( m_backEnd->hasQuerySettings ( querySettings ) ); |
125 | } | 130 | } |
@@ -127,4 +132,4 @@ OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortO | |||
127 | { | 132 | { |
128 | QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); | 133 | QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); |
129 | return ( OPimRecordList<OPimContact>(matchingContacts, this) ); | 134 | return ( OPimRecordList<OPimContact>(matchingContacts, this) ); |
130 | } | 135 | } |
@@ -134,3 +139,3 @@ bool OPimContactAccess::wasChangedExternally()const | |||
134 | { | 139 | { |
135 | return ( m_backEnd->wasChangedExternally() ); | 140 | return ( m_backEnd->wasChangedExternally() ); |
136 | } | 141 | } |
@@ -140,13 +145,13 @@ void 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 | } |
@@ -155,3 +160,3 @@ int OPimContactAccess::rtti() const | |||
155 | { | 160 | { |
156 | return OPimResolver::AddressBook; | 161 | return OPimResolver::AddressBook; |
157 | } | 162 | } |
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 | |||
@@ -3,3 +3,3 @@ | |||
3 | Copyright (C) Holger Freyther <zecke@handhelds.org> | 3 | Copyright (C) Holger Freyther <zecke@handhelds.org> |
4 | Copyright (C) Stefan Eilers <eilers.stefan@epost.de> | 4 | Copyright (C) Stefan Eilers <eilers.stefan@epost.de> |
5 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 5 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
@@ -32,4 +32,3 @@ | |||
32 | 32 | ||
33 | #include <qarray.h> | 33 | /* OPIE */ |
34 | |||
35 | #include <opie2/opimrecord.h> | 34 | #include <opie2/opimrecord.h> |
@@ -40,2 +39,6 @@ | |||
40 | #include <opie2/opimtemplatebase.h> | 39 | #include <opie2/opimtemplatebase.h> |
40 | #include <opie2/odebug.h> | ||
41 | |||
42 | /* QT */ | ||
43 | #include <qarray.h> | ||
41 | 44 | ||
@@ -207,3 +210,3 @@ template <class T> | |||
207 | OPimAccessTemplate<T>::~OPimAccessTemplate() { | 210 | OPimAccessTemplate<T>::~OPimAccessTemplate() { |
208 | qWarning("~OPimAccessTemplate<T>"); | 211 | owarn << "~OPimAccessTemplate<T>" << oendl; |
209 | delete m_backEnd; | 212 | delete m_backEnd; |
@@ -217,4 +220,4 @@ template <class T> | |||
217 | bool OPimAccessTemplate<T>::reload() { | 220 | bool OPimAccessTemplate<T>::reload() { |
218 | invalidateCache(); // zecke: I think this should be added (se) | 221 | invalidateCache(); // zecke: I think this should be added (se) |
219 | return m_backEnd->reload(); | 222 | return m_backEnd->reload(); |
220 | } | 223 | } |
@@ -262,3 +265,3 @@ T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, | |||
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 ) ) { |
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 | |||
@@ -1175,3 +1175,3 @@ QDate OPimContact::birthday() const | |||
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() ) |
@@ -1190,3 +1190,3 @@ QDate OPimContact::anniversary() const | |||
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() ) |
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 | |||
@@ -229,4 +229,4 @@ void OPimNotifyManager::alarmsFromString( const QString& str ) | |||
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 ] ), |
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 | |||
@@ -35,2 +35,3 @@ | |||
35 | #include <opie2/opimrecord.h> | 35 | #include <opie2/opimrecord.h> |
36 | //#include <opie2/odebug.h> | ||
36 | 37 | ||
@@ -191,3 +192,3 @@ OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator< | |||
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; |
@@ -217,3 +218,3 @@ T 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 ) |