summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp
index e79696c..2ee76cc 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp
@@ -43,7 +43,7 @@
43#include <opie2/osqlmanager.h> 43#include <opie2/osqlmanager.h>
44#include <opie2/osqlquery.h> 44#include <opie2/osqlquery.h>
45 45
46#include <opie2/orecur.h> 46#include <opie2/opimrecurrence.h>
47#include <opie2/odatebookaccessbackend_sql.h> 47#include <opie2/odatebookaccessbackend_sql.h>
48 48
49namespace Opie { 49namespace Opie {
@@ -75,27 +75,27 @@ void ODateBookAccessBackend_SQL::initFields()
75 75
76 // This map contains the translation of the fieldtype id's to 76 // This map contains the translation of the fieldtype id's to
77 // the names of the table columns 77 // the names of the table columns
78 m_fieldMap.insert( OEvent::FUid, "uid" ); 78 m_fieldMap.insert( OPimEvent::FUid, "uid" );
79 m_fieldMap.insert( OEvent::FCategories, "Categories" ); 79 m_fieldMap.insert( OPimEvent::FCategories, "Categories" );
80 m_fieldMap.insert( OEvent::FDescription, "Description" ); 80 m_fieldMap.insert( OPimEvent::FDescription, "Description" );
81 m_fieldMap.insert( OEvent::FLocation, "Location" ); 81 m_fieldMap.insert( OPimEvent::FLocation, "Location" );
82 m_fieldMap.insert( OEvent::FType, "Type" ); 82 m_fieldMap.insert( OPimEvent::FType, "Type" );
83 m_fieldMap.insert( OEvent::FAlarm, "Alarm" ); 83 m_fieldMap.insert( OPimEvent::FAlarm, "Alarm" );
84 m_fieldMap.insert( OEvent::FSound, "Sound" ); 84 m_fieldMap.insert( OPimEvent::FSound, "Sound" );
85 m_fieldMap.insert( OEvent::FRType, "RType" ); 85 m_fieldMap.insert( OPimEvent::FRType, "RType" );
86 m_fieldMap.insert( OEvent::FRWeekdays, "RWeekdays" ); 86 m_fieldMap.insert( OPimEvent::FRWeekdays, "RWeekdays" );
87 m_fieldMap.insert( OEvent::FRPosition, "RPosition" ); 87 m_fieldMap.insert( OPimEvent::FRPosition, "RPosition" );
88 m_fieldMap.insert( OEvent::FRFreq, "RFreq" ); 88 m_fieldMap.insert( OPimEvent::FRFreq, "RFreq" );
89 m_fieldMap.insert( OEvent::FRHasEndDate, "RHasEndDate" ); 89 m_fieldMap.insert( OPimEvent::FRHasEndDate, "RHasEndDate" );
90 m_fieldMap.insert( OEvent::FREndDate, "REndDate" ); 90 m_fieldMap.insert( OPimEvent::FREndDate, "REndDate" );
91 m_fieldMap.insert( OEvent::FRCreated, "RCreated" ); 91 m_fieldMap.insert( OPimEvent::FRCreated, "RCreated" );
92 m_fieldMap.insert( OEvent::FRExceptions, "RExceptions" ); 92 m_fieldMap.insert( OPimEvent::FRExceptions, "RExceptions" );
93 m_fieldMap.insert( OEvent::FStart, "Start" ); 93 m_fieldMap.insert( OPimEvent::FStart, "Start" );
94 m_fieldMap.insert( OEvent::FEnd, "End" ); 94 m_fieldMap.insert( OPimEvent::FEnd, "End" );
95 m_fieldMap.insert( OEvent::FNote, "Note" ); 95 m_fieldMap.insert( OPimEvent::FNote, "Note" );
96 m_fieldMap.insert( OEvent::FTimeZone, "TimeZone" ); 96 m_fieldMap.insert( OPimEvent::FTimeZone, "TimeZone" );
97 m_fieldMap.insert( OEvent::FRecParent, "RecParent" ); 97 m_fieldMap.insert( OPimEvent::FRecParent, "RecParent" );
98 m_fieldMap.insert( OEvent::FRecChildren, "Recchildren" ); 98 m_fieldMap.insert( OPimEvent::FRecChildren, "Recchildren" );
99 99
100 // Create a map that maps the column name to the id 100 // Create a map that maps the column name to the id
101 QMapConstIterator<int, QString> it; 101 QMapConstIterator<int, QString> it;
@@ -165,7 +165,7 @@ QArray<int> ODateBookAccessBackend_SQL::allRecords()const
165 return m_uids; 165 return m_uids;
166} 166}
167 167
168QArray<int> ODateBookAccessBackend_SQL::queryByExample(const OEvent&, int, const QDateTime& ) { 168QArray<int> ODateBookAccessBackend_SQL::queryByExample(const OPimEvent&, int, const QDateTime& ) {
169 return QArray<int>(); 169 return QArray<int>();
170} 170}
171 171
@@ -181,7 +181,7 @@ void ODateBookAccessBackend_SQL::clear()
181} 181}
182 182
183 183
184OEvent ODateBookAccessBackend_SQL::find( int uid ) const{ 184OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{
185 QString qu = "select *"; 185 QString qu = "select *";
186 qu += "from datebook where uid = " + QString::number(uid); 186 qu += "from datebook where uid = " + QString::number(uid);
187 187
@@ -192,7 +192,7 @@ OEvent ODateBookAccessBackend_SQL::find( int uid ) const{
192 192
193 // Create Map for date event and insert UID 193 // Create Map for date event and insert UID
194 QMap<int,QString> dateEventMap; 194 QMap<int,QString> dateEventMap;
195 dateEventMap.insert( OEvent::FUid, QString::number( uid ) ); 195 dateEventMap.insert( OPimEvent::FUid, QString::number( uid ) );
196 196
197 // Now insert the data out of the columns into the map. 197 // Now insert the data out of the columns into the map.
198 QMapConstIterator<int, QString> it; 198 QMapConstIterator<int, QString> it;
@@ -201,13 +201,13 @@ OEvent ODateBookAccessBackend_SQL::find( int uid ) const{
201 } 201 }
202 202
203 // Last step: Put map into date event and return it 203 // Last step: Put map into date event and return it
204 OEvent retDate( dateEventMap ); 204 OPimEvent retDate( dateEventMap );
205 205
206 return retDate; 206 return retDate;
207} 207}
208 208
209// FIXME: Speed up update of uid's.. 209// FIXME: Speed up update of uid's..
210bool ODateBookAccessBackend_SQL::add( const OEvent& ev ) 210bool ODateBookAccessBackend_SQL::add( const OPimEvent& ev )
211{ 211{
212 QMap<int,QString> eventMap = ev.toMap(); 212 QMap<int,QString> eventMap = ev.toMap();
213 213
@@ -272,7 +272,7 @@ bool ODateBookAccessBackend_SQL::remove( int uid )
272 return true; 272 return true;
273} 273}
274 274
275bool ODateBookAccessBackend_SQL::replace( const OEvent& ev ) 275bool ODateBookAccessBackend_SQL::replace( const OPimEvent& ev )
276{ 276{
277 remove( ev.uid() ); 277 remove( ev.uid() );
278 return add( ev ); 278 return add( ev );
@@ -309,10 +309,10 @@ QArray<int> ODateBookAccessBackend_SQL::nonRepeats()const
309 return extractUids( res ); 309 return extractUids( res );
310} 310}
311 311
312OEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats() 312OPimEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats()
313{ 313{
314 QArray<int> nonRepUids = nonRepeats(); 314 QArray<int> nonRepUids = nonRepeats();
315 OEvent::ValueList list; 315 OPimEvent::ValueList list;
316 316
317 for (uint i = 0; i < nonRepUids.count(); ++i ){ 317 for (uint i = 0; i < nonRepUids.count(); ++i ){
318 list.append( find( nonRepUids[i] ) ); 318 list.append( find( nonRepUids[i] ) );
@@ -321,10 +321,10 @@ OEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats()
321 return list; 321 return list;
322 322
323} 323}
324OEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats() 324OPimEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats()
325{ 325{
326 QArray<int> rawRepUids = rawRepeats(); 326 QArray<int> rawRepUids = rawRepeats();
327 OEvent::ValueList list; 327 OPimEvent::ValueList list;
328 328
329 for (uint i = 0; i < rawRepUids.count(); ++i ){ 329 for (uint i = 0; i < rawRepUids.count(); ++i ){
330 list.append( find( rawRepUids[i] ) ); 330 list.append( find( rawRepUids[i] ) );