summaryrefslogtreecommitdiff
authoreilers <eilers>2003-03-21 12:26:28 (UTC)
committer eilers <eilers>2003-03-21 12:26:28 (UTC)
commit6d066b0ed3fd7fbedce84616a8fa279eec480f13 (patch) (unidiff)
treee4da9ca6c25236a72bd88f58876c1814bfbd174d
parent8136284c38384b169cd2843ee61480d45b6c1cba (diff)
downloadopie-6d066b0ed3fd7fbedce84616a8fa279eec480f13.zip
opie-6d066b0ed3fd7fbedce84616a8fa279eec480f13.tar.gz
opie-6d066b0ed3fd7fbedce84616a8fa279eec480f13.tar.bz2
Fixing small bug: If we search a birthday from today to today, it returned
every contact ..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend_xml.cpp6
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/libopie/pim/ocontactaccessbackend_xml.cpp b/libopie/pim/ocontactaccessbackend_xml.cpp
index 4abf4d9..9fe3d1e 100644
--- a/libopie/pim/ocontactaccessbackend_xml.cpp
+++ b/libopie/pim/ocontactaccessbackend_xml.cpp
@@ -12,16 +12,20 @@
12 * ToDo: XML-Backend: Automatic reload if something was changed... 12 * ToDo: XML-Backend: Automatic reload if something was changed...
13 * 13 *
14 * 14 *
15 * ===================================================================== 15 * =====================================================================
16 * Version: $Id$ 16 * Version: $Id$
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.3 2003/03/21 12:26:28 eilers
21 * Fixing small bug: If we search a birthday from today to today, it returned
22 * every contact ..
23 *
20 * Revision 1.2 2003/03/21 10:33:09 eilers 24 * Revision 1.2 2003/03/21 10:33:09 eilers
21 * Merged speed optimized xml backend for contacts to main. 25 * Merged speed optimized xml backend for contacts to main.
22 * Added QDateTime to querybyexample. For instance, it is now possible to get 26 * Added QDateTime to querybyexample. For instance, it is now possible to get
23 * all Birthdays/Anniversaries between two dates. This should be used 27 * all Birthdays/Anniversaries between two dates. This should be used
24 * to show all birthdays in the datebook.. 28 * to show all birthdays in the datebook..
25 * This change is sourcecode backward compatible but you have to upgrade 29 * This change is sourcecode backward compatible but you have to upgrade
26 * the binaries for today-addressbook. 30 * the binaries for today-addressbook.
27 * 31 *
@@ -320,17 +324,17 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i
320 324
321 // Check whether the birthday/anniversary date is between 325 // Check whether the birthday/anniversary date is between
322 // the current/given date and the maximum date 326 // the current/given date and the maximum date
323 // ( maximum time range ) ! 327 // ( maximum time range ) !
324 qWarning("Checking if %s is between %s and %s ! ", 328 qWarning("Checking if %s is between %s and %s ! ",
325 checkDate->toString().latin1(), 329 checkDate->toString().latin1(),
326 current.toString().latin1(), 330 current.toString().latin1(),
327 queryDate->toString().latin1() ); 331 queryDate->toString().latin1() );
328 if ( current.daysTo( *queryDate ) > 0 ){ 332 if ( current.daysTo( *queryDate ) >= 0 ){
329 if ( !( ( *checkDate >= current ) && 333 if ( !( ( *checkDate >= current ) &&
330 ( *checkDate <= *queryDate ) ) ){ 334 ( *checkDate <= *queryDate ) ) ){
331 allcorrect = false; 335 allcorrect = false;
332 qWarning (" Nope!.."); 336 qWarning (" Nope!..");
333 } 337 }
334 } 338 }
335 } 339 }
336 } else{ 340 } else{
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
index 4abf4d9..9fe3d1e 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
@@ -12,16 +12,20 @@
12 * ToDo: XML-Backend: Automatic reload if something was changed... 12 * ToDo: XML-Backend: Automatic reload if something was changed...
13 * 13 *
14 * 14 *
15 * ===================================================================== 15 * =====================================================================
16 * Version: $Id$ 16 * Version: $Id$
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.3 2003/03/21 12:26:28 eilers
21 * Fixing small bug: If we search a birthday from today to today, it returned
22 * every contact ..
23 *
20 * Revision 1.2 2003/03/21 10:33:09 eilers 24 * Revision 1.2 2003/03/21 10:33:09 eilers
21 * Merged speed optimized xml backend for contacts to main. 25 * Merged speed optimized xml backend for contacts to main.
22 * Added QDateTime to querybyexample. For instance, it is now possible to get 26 * Added QDateTime to querybyexample. For instance, it is now possible to get
23 * all Birthdays/Anniversaries between two dates. This should be used 27 * all Birthdays/Anniversaries between two dates. This should be used
24 * to show all birthdays in the datebook.. 28 * to show all birthdays in the datebook..
25 * This change is sourcecode backward compatible but you have to upgrade 29 * This change is sourcecode backward compatible but you have to upgrade
26 * the binaries for today-addressbook. 30 * the binaries for today-addressbook.
27 * 31 *
@@ -320,17 +324,17 @@ QArray<int> OContactAccessBackend_XML::queryByExample ( const OContact &query, i
320 324
321 // Check whether the birthday/anniversary date is between 325 // Check whether the birthday/anniversary date is between
322 // the current/given date and the maximum date 326 // the current/given date and the maximum date
323 // ( maximum time range ) ! 327 // ( maximum time range ) !
324 qWarning("Checking if %s is between %s and %s ! ", 328 qWarning("Checking if %s is between %s and %s ! ",
325 checkDate->toString().latin1(), 329 checkDate->toString().latin1(),
326 current.toString().latin1(), 330 current.toString().latin1(),
327 queryDate->toString().latin1() ); 331 queryDate->toString().latin1() );
328 if ( current.daysTo( *queryDate ) > 0 ){ 332 if ( current.daysTo( *queryDate ) >= 0 ){
329 if ( !( ( *checkDate >= current ) && 333 if ( !( ( *checkDate >= current ) &&
330 ( *checkDate <= *queryDate ) ) ){ 334 ( *checkDate <= *queryDate ) ) ){
331 allcorrect = false; 335 allcorrect = false;
332 qWarning (" Nope!.."); 336 qWarning (" Nope!..");
333 } 337 }
334 } 338 }
335 } 339 }
336 } else{ 340 } else{