Commit 4e15f15f authored by Laurent Montel's avatar Laurent Montel 😁

Make it async

parent 67a7dd54
...@@ -47,14 +47,6 @@ void CreateEventJob::start() ...@@ -47,14 +47,6 @@ void CreateEventJob::start()
Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mItem ); Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mItem );
job->fetchScope().fetchFullPayload(); job->fetchScope().fetchFullPayload();
connect( job, SIGNAL(result(KJob*)), this, SLOT(slotFetchDone(KJob*)) ); 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 { } else {
createEvent(); createEvent();
} }
...@@ -67,6 +59,7 @@ void CreateEventJob::slotFetchDone(KJob *job) ...@@ -67,6 +59,7 @@ void CreateEventJob::slotFetchDone(KJob *job)
if ( fetchJob->items().count() == 1 ) { if ( fetchJob->items().count() == 1 ) {
mItem = fetchJob->items().first(); mItem = fetchJob->items().first();
} else { } else {
qDebug()<<" createTodo Error during fetch: "<<job->errorString();
Q_EMIT emitResult(); Q_EMIT emitResult();
return; return;
} }
......
...@@ -47,14 +47,6 @@ void CreateTodoJob::start() ...@@ -47,14 +47,6 @@ void CreateTodoJob::start()
Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mItem ); Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( mItem );
job->fetchScope().fetchFullPayload(); job->fetchScope().fetchFullPayload();
connect( job, SIGNAL(result(KJob*)), this, SLOT(slotFetchDone(KJob*)) ); 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 { } else {
createTodo(); createTodo();
} }
...@@ -67,6 +59,7 @@ void CreateTodoJob::slotFetchDone(KJob *job) ...@@ -67,6 +59,7 @@ void CreateTodoJob::slotFetchDone(KJob *job)
if ( fetchJob->items().count() == 1 ) { if ( fetchJob->items().count() == 1 ) {
mItem = fetchJob->items().first(); mItem = fetchJob->items().first();
} else { } else {
qDebug()<<" createTodo Error during fetch: "<<job->errorString();
Q_EMIT emitResult(); Q_EMIT emitResult();
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment