Bug 127063 - knotes: dcop killNote force argument does not work
Summary: knotes: dcop killNote force argument does not work
Status: RESOLVED FIXED
Alias: None
Product: knotes
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Brade
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-10 08:14 UTC by Pierre Habouzit
Modified: 2006-05-10 12:31 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Habouzit 2006-05-10 08:14:03 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    Debian testing/unstable Packages

this is debian bug: http://bugs.debian.org/366631:
--------------------------------------------------

When using the following command:

dcop kontact KNotesIface killNote libkcal-42915484.547 1

to try to delete a Note, the operation has no effect.

If the 'force' parameter is left off or is specified as 0, knotes correctly
prompts for confirmation before deleting the Note.  However, specifying the
'force' parameter as 1 causes the command to be ignored completely: no prompt
and no deletion of the Note.

This prevents unattended scripts from synchronising Notes with other data.
Comment 1 Michael Brade 2006-05-10 12:31:17 UTC
SVN commit 539305 by brade:

Fix the implementation of killNote(), it did nothing when force == true.
Thanks for the report!
BUG:127063

This also fixes the embarrasingly wrong implementation of KNotesPart::notes(),
it returned the body of the notes, not the title. This is a behavior change
for the DCOP interface but the previous implementation was just plain wrong
and contradictory to the documentation and to the implementation of the
KNotes app itself.



 M  +12 -9     knotes_part.cpp  


--- branches/KDE/3.5/kdepim/kontact/plugins/knotes/knotes_part.cpp #539304:539305
@@ -176,14 +176,17 @@
 {
   KNotesIconViewItem *note = mNoteList[ id ];
 
-   if ( note && !force && KMessageBox::warningContinueCancelList( mNotesView,
-        i18n( "Do you really want to delete this note?" ),
-        mNoteList[ id ]->text(), i18n( "Confirm Delete" ),
-        KStdGuiItem::del() ) == KMessageBox::Continue ) 
-   {
-     mManager->deleteNote( mNoteList[id]->journal() );
-     mManager->save();
-   }
+  if ( note &&
+       ( (!force && KMessageBox::warningContinueCancelList( mNotesView,
+                    i18n( "Do you really want to delete this note?" ),
+                    mNoteList[ id ]->text(), i18n( "Confirm Delete" ),
+                    KStdGuiItem::del() ) == KMessageBox::Continue)
+         || force )
+     )
+  {
+    mManager->deleteNote( mNoteList[id]->journal() );
+    mManager->save();
+  }
 }
 
 QString KNotesPart::name( const QString& id ) const
@@ -228,7 +231,7 @@
   QDictIterator<KNotesIconViewItem> it( mNoteList );
 
   for ( ; it.current(); ++it )
-    notes.insert( (*it)->journal()->uid(), (*it)->journal()->description() );
+    notes.insert( (*it)->journal()->uid(), (*it)->journal()->summary() );
 
   return notes;
 }