Bug 132947

Summary: find journals doesn't display journal title
Product: [Applications] korganizer Reporter: j joseph benavidez <hasuf>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description j joseph benavidez 2006-08-25 00:21:04 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Fedora RPMs
OS:                Linux

When I search for a journal, the first line of the search results gets 
returned as the Summary. This is kind of confusing... I would have expected 
the Title of the journal to be the Summary.
Comment 1 Will Stephenson 2006-10-30 09:27:26 UTC
Confirmed, KDE 3.5.5
Comment 2 Reinhold Kainhofer 2006-11-02 19:28:41 UTC
Reassigning all KOrganizer bug reports and wishes to the newly created 
korganizer-devel mailing list.
Comment 3 Lars Pohlmann 2007-01-29 09:18:28 UTC
Here is a patch against korganizers kolistview. 

--- kolistview.cpp~     2006-10-01 19:30:39.000000000 +0200
+++ kolistview.cpp      2007-01-29 08:19:05.000000000 +0100
@@ -183,8 +183,8 @@
 {
   static const QPixmap jrnalPxmp = KOGlobals::self()->smallIcon( "journal" );
   mItem->setPixmap(0,jrnalPxmp);
-  // Just use the first line
-  mItem->setText( 0, t->description().section( "\n", 0, 0 ) );
+  // Journal entries have a summary!
+  mItem->setText( 0, t->summary() );
   mItem->setText( 3, t->dtStartDateStr() );

   mItem->setSortKey( 3, t->dtStart().toString(Qt::ISODate) );
Comment 4 Allen Winter 2007-01-29 10:47:05 UTC
SVN commit 628136 by winterz:

Fix for "find journals doesn't display journal title".
Thanks for the patch Lars.

BUGS: 132947


 M  +8 -5      kolistview.cpp  


--- branches/KDE/3.5/kdepim/korganizer/kolistview.cpp #628135:628136
@@ -179,15 +179,18 @@
   return true;
 }
 
-bool KOListView::ListItemVisitor::visit(Journal *t)
+bool KOListView::ListItemVisitor::visit( Journal *t )
 {
   static const QPixmap jrnalPxmp = KOGlobals::self()->smallIcon( "journal" );
-  mItem->setPixmap(0,jrnalPxmp);
-  // Just use the first line
-  mItem->setText( 0, t->description().section( "\n", 0, 0 ) );
+  mItem->setPixmap( 0, jrnalPxmp );
+  if ( t->summary().isEmpty() ) {
+    mItem->setText( 0, t->description().section( "\n", 0, 0 ) );
+  } else {
+    mItem->setText( 0, t->summary() );
+  }
   mItem->setText( 3, t->dtStartDateStr() );
 
-  mItem->setSortKey( 3, t->dtStart().toString(Qt::ISODate) );
+  mItem->setSortKey( 3, t->dtStart().toString( Qt::ISODate ) );
 
   return true;
 }