[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepimlibs/akonadi
From: Volker Krause <vkrause () kde ! org>
Date: 2008-10-05 20:52:45
Message-ID: 1223239965.766282.25936.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 868257 by vkrause:
Disable delete and paste actions if the collection is read-only.
M +4 -0 pastehelper.cpp
M +4 -2 standardactionmanager.cpp
--- trunk/KDE/kdepimlibs/akonadi/pastehelper.cpp #868256:868257
@@ -42,6 +42,10 @@
if ( !mimeData || !collection.isValid() )
return false;
+ // TODO check acls depending on mimetype
+ if ( (collection.rights() & (Collection::CanCreateItem | \
Collection::CanCreateCollection) ) == 0 ) + return false;
+
if ( KUrl::List::canDecode( mimeData ) )
return true;
--- trunk/KDE/kdepimlibs/akonadi/standardactionmanager.cpp #868256:868257
@@ -137,8 +137,9 @@
enableAction( CopyCollections, multiColSelected );
enableAction( CollectionProperties, singleColSelected );
+ Collection col;
if ( singleColSelected && selectedIndex.isValid() ) {
- const Collection col = selectedIndex.data( CollectionModel::CollectionRole \
).value<Collection>(); + col = selectedIndex.data( \
CollectionModel::CollectionRole ).value<Collection>(); enableAction( \
CreateCollection, canCreateCollection( col ) );
enableAction( DeleteCollections, col.rights() & \
Collection::CanDeleteCollection );
enableAction( SynchronizeCollections, CollectionUtils::isResource( col ) || \
CollectionUtils::isFolder( col ) ); @@ -158,7 +159,8 @@
}
enableAction( CopyItems, multiItemSelected );
- enableAction( DeleteItems, multiItemSelected );
+ const bool canDeleteItem = !col.isValid() || (col.rights() & \
Collection::CanDeleteItem); + enableAction( DeleteItems, multiItemSelected && \
canDeleteItem );
updatePluralLabel( CopyCollections, colCount );
updatePluralLabel( CopyItems, itemCount );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic