[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kjots
From:       Laurent Montel <montel () kde ! org>
Date:       2010-08-03 9:28:37
Message-ID: 20100803092837.B0C6EAC7E9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1158630 by mlaurent:

Fix enable/disable "del folder" when we select rootcollection


 M  +8 -2      kjotswidget.cpp  


--- trunk/KDE/kdepim/kjots/kjotswidget.cpp #1158629:1158630
@@ -627,13 +627,19 @@
     QModelIndex idx = selection.at( 0 );
 
     Collection col = idx.data( KJotsModel::CollectionRole ).value<Collection>();
-
     if ( col.isValid() ) {
       foreach ( QAction* action, pageActions )
         action->setEnabled(false);
-      foreach ( QAction* action, bookActions )
+      const bool colIsRootCollection = ( col.parentCollection() == Collection::root() );
+      foreach ( QAction* action, bookActions ) {
+        if (action->objectName() == "del_folder" && colIsRootCollection ) {
+          action->setEnabled( false );
+        } else {
         action->setEnabled(true);
+        }
 
+      }
+
       editor->setActionsEnabled( false );
     } else {
       foreach ( QAction* action, pageActions ) {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic