Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 791fe6d4 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to use double click to edit acl

parent 3684572e
......@@ -243,23 +243,25 @@ public:
void editAcl()
{
const QModelIndex index = mSelectionModel->selectedIndexes().first();
const QString userId = index.data( AclModel::UserIdRole ).toString();
const KIMAP::Acl::Rights permissions =
static_cast<KIMAP::Acl::Rights>( index.data( AclModel::PermissionsRole ).toInt() );
if ( mEditAction->isEnabled() ) {
const QModelIndex index = mSelectionModel->selectedIndexes().first();
const QString userId = index.data( AclModel::UserIdRole ).toString();
const KIMAP::Acl::Rights permissions =
static_cast<KIMAP::Acl::Rights>( index.data( AclModel::PermissionsRole ).toInt() );
AclEntryDialog dlg;
dlg.setCaption( i18n( "Edit ACL" ) );
dlg.setUserId( userId );
dlg.setPermissions( permissions );
AclEntryDialog dlg;
dlg.setCaption( i18n( "Edit ACL" ) );
dlg.setUserId( userId );
dlg.setPermissions( permissions );
if ( !dlg.exec() ) {
return;
}
if ( !dlg.exec() ) {
return;
}
mModel->setData( index, dlg.userId(), AclModel::UserIdRole );
mModel->setData( index, static_cast<int>( dlg.permissions() ), AclModel::PermissionsRole );
mChanged = true;
mModel->setData( index, dlg.userId(), AclModel::UserIdRole );
mModel->setData( index, static_cast<int>( dlg.permissions() ), AclModel::PermissionsRole );
mChanged = true;
}
}
void deleteAcl()
......
......@@ -128,6 +128,7 @@ void CollectionAclPage::init()
QWidget *spacer = new QWidget( buttonBox );
spacer->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding );
connect(view,SIGNAL(doubleClicked(QModelIndex)), mAclManager->editAction(), SIGNAL(triggered()));
}
bool CollectionAclPage::canHandle( const Akonadi::Collection &collection ) const
......
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