fbdaemon/fbgeneratorjob.cpp jobs/probekolabserverjob.cpp

Christian Mollekopf mollekopf at kolabsys.com
Fri Jul 20 14:14:45 CEST 2012


 fbdaemon/fbgeneratorjob.cpp  |   11 ++++++-----
 jobs/probekolabserverjob.cpp |    2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 8e0def31f5c68f465c1e1473879560ba165feb0d
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Fri Jul 20 14:14:10 2012 +0200

    Fix logic which checks the timeframe.

diff --git a/fbdaemon/fbgeneratorjob.cpp b/fbdaemon/fbgeneratorjob.cpp
index ed731f0..19a14ff 100644
--- a/fbdaemon/fbgeneratorjob.cpp
+++ b/fbdaemon/fbgeneratorjob.cpp
@@ -98,10 +98,10 @@ void FBGeneratorJob::onFetchFBDone(KJob *job)
      */
     const QString localUri = Settings::instance().getServerUri().toUtf8();
     int count = 0;
-    bool upToDate;
+    bool upToDate = false;
     foreach (const KMime::Message::Ptr &msg, fetchJob->getMessages()) {
         KMime::Headers::Base *xOriginHeader = msg->getHeaderByType(X_ORIGIN_HEADER);
-        if (xOriginHeader) kDebug() << "existing fb object " << xOriginHeader->asUnicodeString() << localUri;
+        if (xOriginHeader) qDebug() << "existing fb object " << xOriginHeader->asUnicodeString() << localUri;
         if (xOriginHeader && (xOriginHeader->asUnicodeString() == localUri)) {
 
             const Kolab::Freebusy &oldFB = Kolab::KolabObjectReader(msg).getFreebusy();
@@ -109,13 +109,14 @@ void FBGeneratorJob::onFetchFBDone(KJob *job)
             const KDateTime start = Kolab::Conversion::toDate(oldFB.start());
             const KDateTime end = Kolab::Conversion::toDate(oldFB.end());
 
+            qDebug() << startOfTimeFrame << start << endOfTimeFrame << end << threshold;
             if (!(startOfTimeFrame < start || endOfTimeFrame > end.addDays(threshold))) {
-                kDebug() << "within threshold, skipping";
+                qDebug() << "within threshold, skipping";
                 upToDate = true;
                 continue;
             }
             
-            if (mOldImapUid) {
+            if (mOldImapUid < 0) {
                 mOldImapUid = fetchJob->getImapUid(msg);
                 mOldFlags = fetchJob->getFlags(msg);
             }
@@ -127,7 +128,7 @@ void FBGeneratorJob::onFetchFBDone(KJob *job)
         //TODO cleanup
     }
     if (upToDate) {
-        kDebug() << "fb objects are up-to-date, nothing to do";
+        qDebug() << "fb objects are up-to-date, nothing to do";
         emitResult();
         return;
     }
diff --git a/jobs/probekolabserverjob.cpp b/jobs/probekolabserverjob.cpp
index 5c2599d..2e43178 100644
--- a/jobs/probekolabserverjob.cpp
+++ b/jobs/probekolabserverjob.cpp
@@ -97,7 +97,7 @@ void ProbeKolabServerJob::findKolabFoldersDone(KJob *job)
         return;
     }
     FindKolabFoldersJob *findJob = static_cast<FindKolabFoldersJob*>(job);
-    kDebug() << findJob->getKolabFolders();
+    qDebug() << "Found kolab folders: " << findJob->getKolabFolders();
     mKolabFolders = findJob->getKolabFolders();
 
     //TODO and now create the missing defaults





More information about the commits mailing list