From 81d785fa7534c55fcf552c44d56c139cbebd38a7 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Tue, 2 Dec 2014 13:33:31 +0100 Subject: [PATCH 1/2] Clean up code as discussed with David --- manageshowcollectionproperties.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/manageshowcollectionproperties.cpp b/manageshowcollectionproperties.cpp index 1df080055..1c9d83d67 100644 --- a/manageshowcollectionproperties.cpp +++ b/manageshowcollectionproperties.cpp @@ -80,14 +80,12 @@ void ManageShowCollectionProperties::showCollectionProperties( const QString &pa { if ( !mMainWidget->currentFolder() ) return; - Akonadi::Collection::Id id = mMainWidget->currentFolder()->collection().id(); - if (mHashDialogBox.contains(id)) { - QPointer dlg = mHashDialogBox.value(id); - if (dlg) { - dlg->activateWindow(); - dlg->raise(); - return; - } + const Akonadi::Collection::Id id = mMainWidget->currentFolder()->collection().id(); + QPointer dlg = mHashDialogBox.value(id); + if (dlg) { + dlg->activateWindow(); + dlg->raise(); + return; } if ( Solid::Networking::status() == Solid::Networking::Unconnected ) { KMessageBox::information( From 503e76cf2e2e8447d91918e2bd622c2a8e90eded Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Tue, 2 Dec 2014 13:35:45 +0100 Subject: [PATCH 2/2] Allow to select specific page when dialog is already opened --- manageshowcollectionproperties.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manageshowcollectionproperties.cpp b/manageshowcollectionproperties.cpp index 1c9d83d67..231a69864 100644 --- a/manageshowcollectionproperties.cpp +++ b/manageshowcollectionproperties.cpp @@ -83,6 +83,9 @@ void ManageShowCollectionProperties::showCollectionProperties( const QString &pa const Akonadi::Collection::Id id = mMainWidget->currentFolder()->collection().id(); QPointer dlg = mHashDialogBox.value(id); if (dlg) { + if ( !pageToShow.isEmpty() ) { + dlg->setCurrentPage( pageToShow ); + } dlg->activateWindow(); dlg->raise(); return;