|
|
|
|
@ -405,17 +405,26 @@ void KMReaderMainWin::slotMoveItem(QAction *action) |
|
|
|
|
{ |
|
|
|
|
const QModelIndex index = action->data().value<QModelIndex>(); |
|
|
|
|
const Akonadi::Collection collection = index.data( Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>(); |
|
|
|
|
copyOrMoveItem(collection, true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( mMsg.isValid() ) { |
|
|
|
|
void KMReaderMainWin::copyOrMoveItem(const Akonadi::Collection &collection, bool move) |
|
|
|
|
{ |
|
|
|
|
if ( mMsg.isValid() ) { |
|
|
|
|
if (move) { |
|
|
|
|
Akonadi::ItemMoveJob *job = new Akonadi::ItemMoveJob( mMsg, collection,this ); |
|
|
|
|
connect( job, SIGNAL(result(KJob*)), this, SLOT(slotCopyMoveResult(KJob*)) ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob( mMsg, collection, this ); |
|
|
|
|
} else { |
|
|
|
|
Akonadi::ItemCopyJob *job = new Akonadi::ItemCopyJob( mMsg, collection,this ); |
|
|
|
|
connect( job, SIGNAL(result(KJob*)), this, SLOT(slotCopyMoveResult(KJob*)) ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob( mMsg, collection, this ); |
|
|
|
|
connect( job, SIGNAL(result(KJob*)), this, SLOT(slotCopyMoveResult(KJob*)) ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void KMReaderMainWin::slotCopyItem(QAction*action) |
|
|
|
|
@ -424,16 +433,7 @@ void KMReaderMainWin::slotCopyItem(QAction*action) |
|
|
|
|
{ |
|
|
|
|
const QModelIndex index = action->data().value<QModelIndex>(); |
|
|
|
|
const Akonadi::Collection collection = index.data( Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>(); |
|
|
|
|
|
|
|
|
|
if ( mMsg.isValid() ) { |
|
|
|
|
Akonadi::ItemCopyJob *job = new Akonadi::ItemCopyJob( mMsg, collection,this ); |
|
|
|
|
connect( job, SIGNAL(result(KJob*)), this, SLOT(slotCopyMoveResult(KJob*)) ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob( mMsg, collection, this ); |
|
|
|
|
connect( job, SIGNAL(result(KJob*)), this, SLOT(slotCopyMoveResult(KJob*)) ); |
|
|
|
|
} |
|
|
|
|
copyOrMoveItem(collection, false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|