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

List:       kde-commits
Subject:    kdepim/kontact/plugins/knotes
From:       Daniel Molkentin <molkentin () kde ! org>
Date:       2005-01-09 6:09:18
Message-ID: 20050109060918.D44741CEA6 () office ! kde ! org
[Download RAW message or body]

CVS commit by danimo: 

Applying fix by Ronnie Holm: Don't crash when operating on an empty set of notes in the notes part.

BUG:93355


  M +19 -0     knotes_part.cpp   1.49
  M +1 -0      knotes_part.h   1.23


--- kdepim/kontact/plugins/knotes/knotes_part.cpp  #1.48:1.49
@@ -77,4 +77,8 @@ KNotesPart::KNotesPart( QObject *parent,
     connect( mNotesView, SIGNAL( onViewport() ),
              this, SLOT( slotOnViewport() ) );
+    connect( mNotesView, SIGNAL( currentChanged( QIconViewItem * ) ),
+             this, SLOT( slotOnCurrentChanged( QIconViewItem * ) ) );
+
+    slotOnCurrentChanged(0);
 
     new KParts::SideBarExtension( mNotesView, this, "NotesSideBarExtension" );
@@ -319,4 +323,19 @@ void KNotesPart::renamedNote( QIconViewI
 }
 
+void KNotesPart::slotOnCurrentChanged( QIconViewItem* )
+{
+  KAction *renameAction = actionCollection()->action( "edit_rename" );
+  KAction *deleteAction = actionCollection()->action( "edit_delete" );
+
+  if ( !mNotesView->currentItem() ) {
+    renameAction->setEnabled( false );
+    deleteAction->setEnabled( false );
+  }
+  else {
+    renameAction->setEnabled( true );
+    deleteAction->setEnabled( true );
+  }
+}
+
 #include "knotes_part.moc"
 #include "knotes_part_p.moc"

--- kdepim/kontact/plugins/knotes/knotes_part.h  #1.22:1.23
@@ -83,4 +83,5 @@ class KNotesPart : public KParts::ReadOn
     void slotOnItem( QIconViewItem *item );
     void slotOnViewport();
+    void slotOnCurrentChanged( QIconViewItem *item );
 
     void popupRMB( QIconViewItem *item, const QPoint& pos );


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

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