Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.cpp b/libopie2/opiepim/backend/ocontactaccessbackend.cpp index b4fdd46..c09427c 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend.cpp | |||
@@ -1,27 +1,28 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) 2004 Holger Freyther <freyther@handhelds.org> | 3 | Copyright (C) Holger Freyther <freyther@handhelds.org> |
4 | Copyright (C) Stefan Eilers <stefan@eilers-online.net> | ||
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 5 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 22 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
@@ -216,49 +217,49 @@ bool OPimContactAccessBackend::hasQuerySettings (uint querySettings) const | |||
216 | 217 | ||
217 | // WildCards, RegExp and ExactMatch should never used at the same time | 218 | // WildCards, RegExp and ExactMatch should never used at the same time |
218 | switch ( querySettings & ~( OPimContactAccess::IgnoreCase | 219 | switch ( querySettings & ~( OPimContactAccess::IgnoreCase |
219 | | OPimContactAccess::DateDiff | 220 | | OPimContactAccess::DateDiff |
220 | | OPimContactAccess::DateYear | 221 | | OPimContactAccess::DateYear |
221 | | OPimContactAccess::DateMonth | 222 | | OPimContactAccess::DateMonth |
222 | | OPimContactAccess::DateDay | 223 | | OPimContactAccess::DateDay |
223 | ) | 224 | ) |
224 | ){ | 225 | ){ |
225 | case OPimContactAccess::RegExp: | 226 | case OPimContactAccess::RegExp: |
226 | return ( true ); | 227 | return ( true ); |
227 | case OPimContactAccess::WildCards: | 228 | case OPimContactAccess::WildCards: |
228 | return ( true ); | 229 | return ( true ); |
229 | case OPimContactAccess::ExactMatch: | 230 | case OPimContactAccess::ExactMatch: |
230 | return ( true ); | 231 | return ( true ); |
231 | case 0: // one of the upper removed bits were set.. | 232 | case 0: // one of the upper removed bits were set.. |
232 | return ( true ); | 233 | return ( true ); |
233 | default: | 234 | default: |
234 | return ( false ); | 235 | return ( false ); |
235 | } | 236 | } |
236 | } | 237 | } |
237 | 238 | ||
238 | 239 | ||
239 | UIDArray OPimContactAccessBackend::sorted( const UIDArray& ar, bool asc, int sortOrder, | 240 | UIDArray OPimContactAccessBackend::sorted( const UIDArray& ar, bool asc, int sortOrder, |
240 | int filter, const QArray<int>& categories)const { | 241 | int filter, const QArray<int>& categories )const { |
241 | odebug << "Using Unaccelerated OPimContactAccessBackend sorted Implementation" << oendl; | 242 | odebug << "Using Unaccelerated OPimContactAccessBackend sorted Implementation" << oendl; |
242 | 243 | ||
243 | Internal::OPimContactSortVector vector(ar.count(), asc, sortOrder ); | 244 | Internal::OPimContactSortVector vector(ar.count(), asc, sortOrder ); |
244 | 245 | ||
245 | int item = 0; | 246 | int item = 0; |
246 | uint cat_count = categories.count(); | 247 | uint cat_count = categories.count(); |
247 | uint eve_count = ar.count(); | 248 | uint eve_count = ar.count(); |
248 | bool bCat = filter & OPimContactAccess::FilterCategory ? true : false; | 249 | bool bCat = filter & OPimContactAccess::FilterCategory ? true : false; |
249 | bool catPassed = false; | 250 | bool catPassed = false; |
250 | int cat; | 251 | int cat; |
251 | 252 | ||
252 | for ( uint i = 0; i < eve_count; ++i ) { | 253 | for ( uint i = 0; i < eve_count; ++i ) { |
253 | OPimContact contact = find( ar[i], ar, i, Frontend::Forward ); | 254 | OPimContact contact = find( ar[i], ar, i, Frontend::Forward ); |
254 | if ( contact.isEmpty() ) | 255 | if ( contact.isEmpty() ) |
255 | continue; | 256 | continue; |
256 | 257 | ||
257 | /* show category */ | 258 | /* show category */ |
258 | /* -1 == unfiled */ | 259 | /* -1 == unfiled */ |
259 | catPassed = false; | 260 | catPassed = false; |
260 | for ( uint cat_nu = 0; cat_nu < cat_count; ++cat_nu ) { | 261 | for ( uint cat_nu = 0; cat_nu < cat_count; ++cat_nu ) { |
261 | cat = categories[cat_nu]; | 262 | cat = categories[cat_nu]; |
262 | if ( bCat && cat == -1 ) { | 263 | if ( bCat && cat == -1 ) { |
263 | if(!contact.categories().isEmpty() ) | 264 | if(!contact.categories().isEmpty() ) |
264 | continue; | 265 | continue; |