summaryrefslogtreecommitdiff
path: root/libopie/pim/odatebookaccessbackend.cpp
Unidiff
Diffstat (limited to 'libopie/pim/odatebookaccessbackend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/odatebookaccessbackend.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/libopie/pim/odatebookaccessbackend.cpp b/libopie/pim/odatebookaccessbackend.cpp
index 8fa1a68..f0c5d65 100644
--- a/libopie/pim/odatebookaccessbackend.cpp
+++ b/libopie/pim/odatebookaccessbackend.cpp
@@ -124,27 +124,53 @@ ODateBookAccessBackend::ODateBookAccessBackend()
124{ 124{
125 125
126} 126}
127ODateBookAccessBackend::~ODateBookAccessBackend() { 127ODateBookAccessBackend::~ODateBookAccessBackend() {
128 128
129} 129}
130OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDate& from, 130OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveEvents( const QDate& from,
131 const QDate& to ) { 131 const QDate& to ) {
132 OEffectiveEvent::ValueList tmpList; 132 OEffectiveEvent::ValueList tmpList;
133 OEvent::ValueList list = directNonRepeats(); 133 OEvent::ValueList list = directNonRepeats();
134 134
135 events( tmpList, list, from, to ); 135 events( tmpList, list, from, to );
136 repeat( tmpList, directRawRepeats(),from,to ); 136 repeat( tmpList, directRawRepeats(),from,to );
137 137
138 list = directRawRepeats(); 138 list = directRawRepeats(); // Useless, isn't it ? (eilers)
139 139
140 qHeapSort( tmpList ); 140 qHeapSort( tmpList );
141 return tmpList; 141 return tmpList;
142} 142}
143OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDateTime& dt ) { 143OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveEvents( const QDateTime& dt ) {
144 OEffectiveEvent::ValueList day = effecticeEvents( dt.date(), dt.date() ); 144 OEffectiveEvent::ValueList day = effectiveEvents( dt.date(), dt.date() );
145 OEffectiveEvent::ValueList::Iterator it;
146
147 OEffectiveEvent::ValueList tmpList;
148 QDateTime dtTmp;
149 for ( it = day.begin(); it != day.end(); ++it ) {
150 dtTmp = QDateTime( (*it).date(), (*it).startTime() );
151 if ( QABS(dt.secsTo(dtTmp) ) < 60 )
152 tmpList.append( (*it) );
153 }
154
155 return tmpList;
156}
157
158OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveNonRepeatingEvents( const QDate& from,
159 const QDate& to ) {
160 OEffectiveEvent::ValueList tmpList;
161 OEvent::ValueList list = directNonRepeats();
162
163 events( tmpList, list, from, to );
164
165 qHeapSort( tmpList );
166 return tmpList;
167}
168
169OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveNonRepeatingEvents( const QDateTime& dt ) {
170 OEffectiveEvent::ValueList day = effectiveNonRepeatingEvents( dt.date(), dt.date() );
145 OEffectiveEvent::ValueList::Iterator it; 171 OEffectiveEvent::ValueList::Iterator it;
146 172
147 OEffectiveEvent::ValueList tmpList; 173 OEffectiveEvent::ValueList tmpList;
148 QDateTime dtTmp; 174 QDateTime dtTmp;
149 for ( it = day.begin(); it != day.end(); ++it ) { 175 for ( it = day.begin(); it != day.end(); ++it ) {
150 dtTmp = QDateTime( (*it).date(), (*it).startTime() ); 176 dtTmp = QDateTime( (*it).date(), (*it).startTime() );