Commit d02923a2 authored by Tobias Koenig's avatar Tobias Koenig
Browse files

Set the current selected address book as default address book

in the contact editor.

BUG: 205744

svn path=/trunk/KDE/kdepim/kaddressbook/; revision=1019853
parent cf3d6661
......@@ -360,6 +360,15 @@ void MainWidget::print()
void MainWidget::newContact()
{
Akonadi::ContactEditorDialog dlg( Akonadi::ContactEditorDialog::CreateMode, this );
if ( mCollectionView->selectionModel() && mCollectionView->selectionModel()->hasSelection() ) {
const QModelIndex index = mCollectionView->selectionModel()->selectedIndexes().first();
const Akonadi::Collection collection = index.data( Akonadi::EntityTreeModel::CollectionRole )
.value<Akonadi::Collection>();
dlg.setDefaultAddressBook( collection );
}
dlg.exec();
}
......
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