Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend.cpp b/libopie2/opiepim/backend/odatebookaccessbackend.cpp index 8fa1a68..f0c5d65 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend.cpp | |||
@@ -127,7 +127,7 @@ ODateBookAccessBackend::ODateBookAccessBackend() | |||
127 | ODateBookAccessBackend::~ODateBookAccessBackend() { | 127 | ODateBookAccessBackend::~ODateBookAccessBackend() { |
128 | 128 | ||
129 | } | 129 | } |
130 | OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDate& from, | 130 | OEffectiveEvent::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(); |
@@ -135,13 +135,39 @@ OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDate& | |||
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 | } |
143 | OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDateTime& dt ) { | 143 | OEffectiveEvent::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 | |||
158 | OEffectiveEvent::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 | |||
169 | OEffectiveEvent::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; |