Branch 'kolab/integration/4.13.0' - 3 commits - korganizer/calendarview.cpp korganizer/calendarview.h korganizer/CMakeLists.txt korganizer/searchcollectionhelper.cpp korganizer/searchcollectionhelper.h korganizer/views messageviewer/job

Sandro Knauß knauss at kolabsys.com
Wed Feb 25 17:05:59 CET 2015


 korganizer/CMakeLists.txt                     |    1 
 korganizer/calendarview.cpp                   |  126 ---------------------
 korganizer/calendarview.h                     |   11 -
 korganizer/searchcollectionhelper.cpp         |  154 ++++++++++++++++++++++++++
 korganizer/searchcollectionhelper.h           |   63 ++++++++++
 korganizer/views/collectionview/quickview.cpp |    1 
 messageviewer/job/createeventjob.cpp          |   10 -
 messageviewer/job/createtodojob.cpp           |    9 -
 8 files changed, 223 insertions(+), 152 deletions(-)

New commits:
commit fdc82323a601614ad0df3e29d14ae114bd2a7d92
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Wed Feb 25 16:56:07 2015 +0100

    only show close button for quickview

diff --git a/korganizer/views/collectionview/quickview.cpp b/korganizer/views/collectionview/quickview.cpp
index bfb7ce3..3417fb1 100644
--- a/korganizer/views/collectionview/quickview.cpp
+++ b/korganizer/views/collectionview/quickview.cpp
@@ -99,6 +99,7 @@ Quickview::Quickview(const Person &person, const Akonadi::Collection &col)
     , mCollection(col)
     , mDayRange(7)
 {
+    setButtons(KDialog::Close);
     QWidget *w = new QWidget( this );
     mUi->setupUi( w );
     setMainWidget( w );


commit 494d0df1cc1f3dff3d93bdef37182cc93d897339
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Wed Feb 25 16:53:41 2015 +0100

    PERSISTANTSEARCH includes identities without emails.
    
    Make sure that identities without valid emailaddresses are stripped out
    of the search string.
    
    KOLAB: #4664

diff --git a/korganizer/CMakeLists.txt b/korganizer/CMakeLists.txt
index 5c7645e..61c29c4 100644
--- a/korganizer/CMakeLists.txt
+++ b/korganizer/CMakeLists.txt
@@ -203,6 +203,7 @@ set(korganizerprivate_LIB_SRCS
     previewdialog.cpp
     publishdialog.cpp
     searchdialog.cpp
+    searchcollectionhelper.cpp
     statusdialog.cpp
     views/agendaview/koagendaview.cpp
     views/journalview/kojournalview.cpp
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 9a2cf9b..c27d392 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -80,12 +80,6 @@
 #include <Akonadi/Control>
 #include <Akonadi/AttributeFactory>
 #include <Akonadi/Calendar/TodoPurger>
-#include <Akonadi/SearchCreateJob>
-#include <Akonadi/CollectionModifyJob>
-#include <Akonadi/CollectionFetchJob>
-#include <Akonadi/SearchQuery>
-#include <akonadi/persistentsearchattribute.h>
-#include <akonadi/entitydisplayattribute.h>
 
 #include <KCalCore/Event>
 #include <KCalCore/Todo>
@@ -99,8 +93,6 @@
 #include <KCalUtils/Stringify>
 #include <KCalUtils/DndFactory>
 
-#include <KPIMIdentities/IdentityManager>
-
 #include <klocalizedstring.h>
 #include <KFileDialog>
 #include <KNotification>
@@ -116,7 +108,7 @@
 CalendarView::CalendarView( QWidget *parent ) : CalendarViewBase( parent ),
                                                 mCheckableProxyModel( 0 ),
                                                 mETMCollectionView( 0 ),
-                                                mIdentityManager(/*ro=*/ true)
+                                                mSearchCollectionHelper(this)
 {
   Akonadi::Control::widgetNeedsAkonadi( this );
   mChanger = new Akonadi::IncidenceChanger( new IncidenceEditorNG::IndividualMailComponentFactory( this ), this );
@@ -130,7 +122,6 @@ CalendarView::CalendarView( QWidget *parent ) : CalendarViewBase( parent ),
   mCalendar = Akonadi::ETMCalendar::Ptr( new Akonadi::ETMCalendar( CalendarSupport::calendarSingleton() ) );
 
   mCalendar->setObjectName( QLatin1String("KOrg Calendar") );
-  setupSearchCollections();
   mCalendarClipboard = new Akonadi::CalendarClipboard( mCalendar, mChanger, this );
   mITIPHandler = new Akonadi::ITIPHandler( this );
   mITIPHandler->setCalendar( mCalendar );
@@ -274,10 +265,6 @@ CalendarView::CalendarView( QWidget *parent ) : CalendarViewBase( parent ),
   connect( this, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
            mEventViewer, SLOT(setIncidence(Akonadi::Item,QDate)) );
 
-   // IdentityManager
-   connect(&mIdentityManager, SIGNAL(changed()),
-            SLOT(createOrUpdateSearchCollections()));
-
   //TODO: do a pretty Summary,
   QString s;
   s = i18n( "<p><em>No Item Selected</em></p>"
@@ -338,116 +325,6 @@ Akonadi::ETMCalendar::Ptr CalendarView::calendar() const
   return mCalendar;
 }
 
-void CalendarView::setupSearchCollections()
-{
-    Akonadi::CollectionFetchJob *fetchJob = new Akonadi::CollectionFetchJob(Akonadi::Collection(1), Akonadi::CollectionFetchJob::FirstLevel);
-    fetchJob->fetchScope().setListFilter(Akonadi::CollectionFetchScope::NoFilter);
-    connect(fetchJob, SIGNAL(result(KJob*)), this, SLOT(onSearchCollectionsFetched(KJob*)));
-}
-
-void CalendarView::onSearchCollectionsFetched(KJob *job)
-{
-    if (job->error()) {
-        kWarning() << "Search failed: " << job->errorString();
-    } else {
-        Akonadi::CollectionFetchJob *fetchJob = static_cast<Akonadi::CollectionFetchJob*>(job);
-        Q_FOREACH(const Akonadi::Collection &col, fetchJob->collections()) {
-            if (col.name() == QLatin1String("OpenInvitations")) {
-                mOpenInvitationCollection = col;
-            } else if (col.name() == QLatin1String("DeclinedInvitations")) {
-                mDeclineCollection = col;
-            }
-        }
-    }
-    createOrUpdateSearchCollections();
-}
-
-void CalendarView::createOrUpdateSearchCollections()
-{
-    Akonadi::SearchQuery query(Akonadi::SearchTerm::RelOr);
-    foreach (const QString email, mIdentityManager.allEmails()) {
-        query.addTerm(Akonadi::IncidenceSearchTerm(Akonadi::IncidenceSearchTerm::PartStatus, QString(email+ QString::number(KCalCore::Attendee::NeedsAction))));
-    }
-    if (!mOpenInvitationCollection.isValid()) {
-        const QString name = QLatin1String("OpenInvitations");
-        Akonadi::SearchCreateJob *job = new Akonadi::SearchCreateJob(name, query);
-        job->setRemoteSearchEnabled(false);
-        job->setSearchMimeTypes(QStringList() << KCalCore::Event::eventMimeType()
-            << KCalCore::Todo::todoMimeType()
-            << KCalCore::Journal::journalMimeType());
-        connect(job, SIGNAL(result(KJob*)), SLOT(createSearchJobFinished(KJob*)));
-
-        kDebug() <<  "We have to create a OpenIncidence virtual Collection";
-    } else {
-        Akonadi::PersistentSearchAttribute *attribute = mOpenInvitationCollection.attribute<Akonadi::PersistentSearchAttribute>( Akonadi::Entity::AddIfMissing );
-        Akonadi::EntityDisplayAttribute *displayname  = mOpenInvitationCollection.attribute<Akonadi::EntityDisplayAttribute >( Akonadi::Entity::AddIfMissing );
-        attribute->setQueryString( QString::fromLatin1(query.toJSON()) );
-        attribute->setRemoteSearchEnabled(false);
-        displayname->setDisplayName(i18nc("A collection of all open invidations.", "Open Invitations"));
-        mOpenInvitationCollection.setEnabled(true);
-        Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( mOpenInvitationCollection, this );
-        connect( job, SIGNAL(result(KJob*)), this, SLOT(modifyResult(KJob*)) );
-        kDebug() <<  "updating OpenIncidence (" << mOpenInvitationCollection.id() << ") virtual Collection";
-        kDebug() <<  query.toJSON();
-    }
-
-    query = Akonadi::SearchQuery(Akonadi::SearchTerm::RelOr);
-    foreach (const QString email, mIdentityManager.allEmails()) {
-        query.addTerm(Akonadi::IncidenceSearchTerm(Akonadi::IncidenceSearchTerm::PartStatus, QString(email+ QString::number(KCalCore::Attendee::Declined))));
-    }
-    if (!mDeclineCollection.isValid()) {
-        const QString name = QLatin1String("DeclinedInvitations");
-        Akonadi::SearchCreateJob *job = new Akonadi::SearchCreateJob(name, query);
-        job->setRemoteSearchEnabled(false);
-        job->setSearchMimeTypes(QStringList() << KCalCore::Event::eventMimeType()
-            << KCalCore::Todo::todoMimeType()
-            << KCalCore::Journal::journalMimeType());
-        connect(job, SIGNAL(result(KJob*)), SLOT(createSearchJobFinished(KJob*)));
-
-        kDebug() <<  "We have to create a DeclinedIncidence virtual Collection";
-    } else {
-        Akonadi::PersistentSearchAttribute *persistentsearch = mDeclineCollection.attribute<Akonadi::PersistentSearchAttribute >( Akonadi::Entity::AddIfMissing );
-        Akonadi::EntityDisplayAttribute *displayname  = mDeclineCollection.attribute<Akonadi::EntityDisplayAttribute >( Akonadi::Entity::AddIfMissing );
-
-        persistentsearch->setQueryString( QString::fromLatin1(query.toJSON()) );
-        persistentsearch->setRemoteSearchEnabled(false);
-        displayname->setDisplayName(i18nc("A collection of all declined invidations.", "Declined Invitations"));
-        mDeclineCollection.setEnabled(true);
-        Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( mDeclineCollection, this );
-        connect( job, SIGNAL(result(KJob*)), this, SLOT(modifyResult(KJob*)) );
-        kDebug() <<  "updating DeclinedIncidence(" << mDeclineCollection.id() << ") virtual Collection";
-        kDebug() <<  query.toJSON();
-    }
-}
-
-
-void CalendarView::modifyResult(KJob* job)
-{
-    if (job->error()) {
-        kWarning() << "Error occurred " <<  job->errorString();
-    } else {
-        kDebug() << "modify was successfull";
-    }
-}
-
-
-void CalendarView::createSearchJobFinished( KJob *job )
-{
-    Akonadi::SearchCreateJob *createJob = qobject_cast<Akonadi::SearchCreateJob *>(job);
-    const Akonadi::Collection searchCollection = createJob->createdCollection();
-    if (job->error()) {
-        kWarning() << "Error occurred " <<  searchCollection.name() << job->errorString();
-        return;
-    }
-    qDebug() << "Created search folder successfully " <<  searchCollection.name();
-
-    if (searchCollection.name() ==  QLatin1String("OpenInvitations")) {
-        mOpenInvitationCollection = searchCollection;
-    } else if (searchCollection.name() ==  QLatin1String("DeclinedInvitations")) {
-        mDeclineCollection = searchCollection;
-    }
-}
-
 QDate CalendarView::activeDate( bool fallbackToToday )
 {
   KOrg::BaseView *curView = mViewManager->currentView();
@@ -2961,4 +2838,3 @@ void CalendarView::handleIncidenceCreated(const Akonadi::Item &item)
         mMessageWidget->show();
     }
 }
-
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 14b554e..1a54482 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -28,6 +28,8 @@
 #define KORG_CALENDARVIEW_H
 
 #include "korganizer_export.h"
+#include "searchcollectionhelper.h"
+
 #include "interfaces/korganizer/calendarviewbase.h"
 
 #include <KCalCore/Incidence>
@@ -658,13 +660,8 @@ class KORGANIZERPRIVATE_EXPORT CalendarView : public KOrg::CalendarViewBase,
     void onCheckableProxyToggled( bool newState );
     void onTodosPurged(bool success, int numDeleted, int numIgnored);
 
-    void onSearchCollectionsFetched(KJob *job);
-    void createSearchJobFinished(KJob *job);
-    void modifyResult(KJob* job);
-    void createOrUpdateSearchCollections();
   private:
     void init();
-    void setupSearchCollections();
     Akonadi::Collection selectedCollection() const;
     Akonadi::Collection::List checkedCollections() const;
 
@@ -736,9 +733,7 @@ class KORGANIZERPRIVATE_EXPORT CalendarView : public KOrg::CalendarViewBase,
     KOCheckableProxyModel *mCheckableProxyModel;
     AkonadiCollectionView *mETMCollectionView;
 
-    KPIMIdentities::IdentityManager mIdentityManager;
-    Akonadi::Collection mOpenInvitationCollection;
-    Akonadi::Collection mDeclineCollection;
+    SearchCollectionHelper mSearchCollectionHelper;
 };
 
 #endif
diff --git a/korganizer/searchcollectionhelper.cpp b/korganizer/searchcollectionhelper.cpp
new file mode 100644
index 0000000..3ddf1b4
--- /dev/null
+++ b/korganizer/searchcollectionhelper.cpp
@@ -0,0 +1,154 @@
+/*
+  This file is part of KOrganizer.
+
+  Copyright (c) 2015 Sandro Knauß <knauss at kolabsys.com>
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License along
+  with this program; if not, write to the Free Software Foundation, Inc.,
+  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+  As a special exception, permission is given to link this program
+  with any edition of Qt, and distribute the resulting executable,
+  without including the source code for Qt in the source distribution.
+*/
+
+#include "searchcollectionhelper.h"
+
+#include <Akonadi/SearchCreateJob>
+#include <Akonadi/CollectionModifyJob>
+#include <Akonadi/CollectionFetchJob>
+#include <Akonadi/SearchQuery>
+#include <akonadi/persistentsearchattribute.h>
+#include <akonadi/entitydisplayattribute.h>
+#include <akonadi/collectionfetchscope.h>
+
+#include <KCalCore/Todo>
+#include <KCalCore/Event>
+#include <KCalCore/Journal>
+
+#include <klocalizedstring.h>
+
+using namespace KOrg;
+
+SearchCollectionHelper::SearchCollectionHelper(QObject *parent)
+    : QObject(parent)
+    , mIdentityManager(/*ro=*/ true)
+{
+   setupSearchCollections();
+   connect(&mIdentityManager, SIGNAL(changed()),
+            SLOT(updateOpenInvitation()));
+   connect(&mIdentityManager, SIGNAL(changed()),
+            SLOT(updateDeclinedInvitation()));
+}
+
+
+void SearchCollectionHelper::setupSearchCollections()
+{
+    //Collection "Search", has always ID 1
+    Akonadi::CollectionFetchJob *fetchJob = new Akonadi::CollectionFetchJob(Akonadi::Collection(1), Akonadi::CollectionFetchJob::FirstLevel);
+    fetchJob->fetchScope().setListFilter(Akonadi::CollectionFetchScope::NoFilter);
+    connect(fetchJob, SIGNAL(result(KJob*)), this, SLOT(onSearchCollectionsFetched(KJob*)));
+}
+
+void SearchCollectionHelper::onSearchCollectionsFetched(KJob *job)
+{
+    if (job->error()) {
+        kWarning() << "Search failed: " << job->errorString();
+    } else {
+        Akonadi::CollectionFetchJob *fetchJob = static_cast<Akonadi::CollectionFetchJob*>(job);
+        Q_FOREACH(const Akonadi::Collection &col, fetchJob->collections()) {
+            if (col.name() == QLatin1String("OpenInvitations")) {
+                mOpenInvitationCollection = col;
+            } else if (col.name() == QLatin1String("DeclinedInvitations")) {
+                mDeclineCollection = col;
+            }
+        }
+    }
+    updateOpenInvitation();
+    updateDeclinedInvitation();
+}
+
+void SearchCollectionHelper::updateSearchCollection(Akonadi::Collection col, KCalCore::Attendee::PartStat status, const QString name, const QString &displayName)
+{
+    // Update or create search collections
+
+    Akonadi::SearchQuery query(Akonadi::SearchTerm::RelOr);
+    foreach (const QString email, mIdentityManager.allEmails()) {
+        if (!email.isEmpty()) {
+            query.addTerm(Akonadi::IncidenceSearchTerm(Akonadi::IncidenceSearchTerm::PartStatus, QString(email+ QString::number(status))));
+        }
+    }
+
+    if (!col.isValid()) {
+        Akonadi::SearchCreateJob *job = new Akonadi::SearchCreateJob(name, query);
+        job->setRemoteSearchEnabled(false);
+        job->setSearchMimeTypes(QStringList() << KCalCore::Event::eventMimeType()
+            << KCalCore::Todo::todoMimeType()
+            << KCalCore::Journal::journalMimeType());
+        connect(job, SIGNAL(result(KJob*)), SLOT(createSearchJobFinished(KJob*)));
+        kDebug() <<  "We have to create a " << name << " virtual Collection";
+    } else {
+        Akonadi::PersistentSearchAttribute *attribute = col.attribute<Akonadi::PersistentSearchAttribute>( Akonadi::Entity::AddIfMissing );
+        Akonadi::EntityDisplayAttribute *displayname  = col.attribute<Akonadi::EntityDisplayAttribute >( Akonadi::Entity::AddIfMissing );
+        attribute->setQueryString( QString::fromLatin1(query.toJSON()) );
+        attribute->setRemoteSearchEnabled(false);
+        displayname->setDisplayName(displayName);
+        col.setEnabled(true);
+        Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( col, this );
+        connect( job, SIGNAL(result(KJob*)), this, SLOT(modifyResult(KJob*)) );
+        kDebug() <<  "updating "<< name << " (" << col.id() << ") virtual Collection";
+        kDebug() <<  query.toJSON();
+    }
+}
+
+void SearchCollectionHelper::updateDeclinedInvitation()
+{
+    updateSearchCollection(mDeclineCollection, KCalCore::Attendee::Declined,
+                            QLatin1String("DeclinedInvitations"),
+                            i18nc("A collection of all declined invidations.", "Declined Invitations"));
+}
+
+void SearchCollectionHelper::updateOpenInvitation()
+{
+    updateSearchCollection(mOpenInvitationCollection, KCalCore::Attendee::NeedsAction,
+                            QLatin1String("OpenInvitations"),
+                            i18nc("A collection of all open invidations.", "Open Invitations"));
+}
+
+void SearchCollectionHelper::createSearchJobFinished( KJob *job )
+{
+    Akonadi::SearchCreateJob *createJob = qobject_cast<Akonadi::SearchCreateJob *>(job);
+    const Akonadi::Collection searchCollection = createJob->createdCollection();
+    if (job->error()) {
+        kWarning() << "Error occurred " <<  searchCollection.name() << job->errorString();
+        return;
+    }
+    kDebug() << "Created search folder successfully " <<  searchCollection.name();
+
+    if (searchCollection.name() ==  QLatin1String("OpenInvitations")) {
+        mOpenInvitationCollection = searchCollection;
+        updateOpenInvitation();
+    } else if (searchCollection.name() ==  QLatin1String("DeclinedInvitations")) {
+        mDeclineCollection = searchCollection;
+        updateDeclinedInvitation();
+    }
+}
+
+void SearchCollectionHelper::modifyResult(KJob* job)
+{
+    if (job->error()) {
+        kWarning() << "Error occurred " <<  job->errorString();
+    } else {
+        kDebug() << "modify was successfull";
+    }
+}
\ No newline at end of file
diff --git a/korganizer/searchcollectionhelper.h b/korganizer/searchcollectionhelper.h
new file mode 100644
index 0000000..861b993
--- /dev/null
+++ b/korganizer/searchcollectionhelper.h
@@ -0,0 +1,63 @@
+/*
+  This file is part of KOrganizer.
+
+  Copyright (c) 2015 Sandro Knauß <knauss at kolabsys.com>
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License along
+  with this program; if not, write to the Free Software Foundation, Inc.,
+  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+  As a special exception, permission is given to link this program
+  with any edition of Qt, and distribute the resulting executable,
+  without including the source code for Qt in the source distribution.
+*/
+
+#ifndef KORG_SEARCHCOLLECTIONHELPER_H
+#define KORG_SEARCHCOLLECTIONHELPER_H
+
+#include <QObject>
+#include <QString>
+
+#include <Akonadi/Collection>
+#include <KCalCore/Attendee>
+#include <KPIMIdentities/IdentityManager>
+
+class KJob;
+
+namespace KOrg {
+
+class SearchCollectionHelper: public QObject
+{
+    Q_OBJECT
+public:
+    SearchCollectionHelper(QObject *parent=0);
+
+private Q_SLOTS:
+    void onSearchCollectionsFetched(KJob *job);
+    void updateOpenInvitation();
+    void updateDeclinedInvitation();
+
+    void createSearchJobFinished(KJob *job);
+    void modifyResult(KJob* job);
+
+private:
+    void setupSearchCollections();
+    void updateSearchCollection(Akonadi::Collection col, KCalCore::Attendee::PartStat status, const QString name, const QString &displayName);
+
+private:
+    KPIMIdentities::IdentityManager mIdentityManager;
+    Akonadi::Collection mOpenInvitationCollection;
+    Akonadi::Collection mDeclineCollection;
+};
+}
+#endif
\ No newline at end of file


commit 7b3f60ba7bf44482677ac6a621b76d737e787d5a
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Fri Feb 20 19:12:11 2015 +0100

    cleanup createeventjob and createtodojob

diff --git a/messageviewer/job/createeventjob.cpp b/messageviewer/job/createeventjob.cpp
index 8e99ad4..b6260df 100644
--- a/messageviewer/job/createeventjob.cpp
+++ b/messageviewer/job/createeventjob.cpp
@@ -38,7 +38,6 @@ CreateEventJob::CreateEventJob(const KCalCore::Event::Ptr &eventPtr, const Akona
 
 CreateEventJob::~CreateEventJob()
 {
-    qDebug()<<" CreateEventJob::~CreateEventJob()";
 }
 
 void CreateEventJob::start()
@@ -48,14 +47,6 @@ void CreateEventJob::start()
         Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mItem );
         job->fetchScope().fetchFullPayload();
         connect( job, SIGNAL(result(KJob*)), this, SLOT(slotFetchDone(KJob*)) );
-
-        if ( job->exec() ) {
-            if ( job->items().count() == 1 ) {
-                mItem = job->items().first();
-            }
-        } else {
-            qDebug()<<" createEvent: Error during fetch: "<<job->errorString();
-        }
     } else {
         createEvent();
     }
@@ -63,7 +54,6 @@ void CreateEventJob::start()
 
 void CreateEventJob::slotFetchDone(KJob *job)
 {
-    qDebug()<<" void CreateEventJob::slotFetchDone(KJob *job)";
     Akonadi::ItemFetchJob *fetchJob = qobject_cast<Akonadi::ItemFetchJob *>(job);
     if ( fetchJob->items().count() == 1 ) {
         mItem = fetchJob->items().first();
diff --git a/messageviewer/job/createtodojob.cpp b/messageviewer/job/createtodojob.cpp
index e9ffa62..342b707 100644
--- a/messageviewer/job/createtodojob.cpp
+++ b/messageviewer/job/createtodojob.cpp
@@ -48,14 +48,6 @@ void CreateTodoJob::start()
         Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mItem );
         job->fetchScope().fetchFullPayload();
         connect( job, SIGNAL(result(KJob*)), this, SLOT(slotFetchDone(KJob*)) );
-
-        if ( job->exec() ) {
-            if ( job->items().count() == 1 ) {
-                mItem = job->items().first();
-            }
-        } else {
-            qDebug()<<" createTodo Error during fetch: "<<job->errorString();
-        }
     } else {
         createTodo();
     }
@@ -63,7 +55,6 @@ void CreateTodoJob::start()
 
 void CreateTodoJob::slotFetchDone(KJob *job)
 {
-    qDebug()<<" void CreateTodoJob::slotFetchDone(KJob *job)";
     Akonadi::ItemFetchJob *fetchJob = qobject_cast<Akonadi::ItemFetchJob *>(job);
     if ( fetchJob->items().count() == 1 ) {
         mItem = fetchJob->items().first();




More information about the commits mailing list