Bug 117437 - line breaks not rendered properly in edit view
Summary: line breaks not rendered properly in edit view
Status: RESOLVED FIXED
Alias: None
Product: knotes
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Brade
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-01 16:56 UTC by Pascal Niklaus
Modified: 2006-06-07 23:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Niklaus 2005-12-01 16:56:47 UTC
Version:            (using KDE 3.5.0 Level "a" , SUSE 9.3 UNSUPPORTED)
Compiler:          gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
OS:                Linux (i686) release 2.6.11.4-21.9-smp

After updating from KDE3.4.1 to 3.5.0, the Notes are not rendered properly anymore in the "edit" view. All text is shown on a single line with no line breaks. The tooltip preview is still correctly formatted.
Comment 1 p92 2005-12-30 13:18:44 UTC
I can confirm this also on all my old notes !  Very annoying upgrade from 3.4.1 to 3.5.0 !
Comment 2 Michael Brade 2006-01-06 23:54:16 UTC
SVN commit 495049 by brade:

Fix #117437. Linebreaks were not shown properly because non-rich text notes
were shown in a rich text interpreter. I wonder why it worked before, the
implementation was completely missing...

BUG: 117437


 M  +5 -2      knotes_part.cpp  
 M  +7 -2      knotes_part_p.h  


--- branches/KDE/3.5/kdepim/kontact/plugins/knotes/knotes_part.cpp #495048:495049
@@ -1,7 +1,7 @@
 /*
    This file is part of the KDE project
    Copyright (C) 2002-2003 Daniel Molkentin <molkentin@kde.org>
-   Copyright (C) 2004 Michael Brade <brade@kde.org>
+   Copyright (C) 2004-2006 Michael Brade <brade@kde.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
@@ -177,7 +177,8 @@
    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 ) {
+        KStdGuiItem::del() ) == KMessageBox::Continue ) 
+   {
      mManager->deleteNote( mNoteList[id]->journal() );
      mManager->save();
    }
@@ -328,6 +329,8 @@
     mNoteEditDlg = new KNoteEditDlg( widget() );
 
   KCal::Journal *journal = static_cast<KNotesIconViewItem *>( item )->journal();
+
+  mNoteEditDlg->setRichText( journal->customProperty( "KNotes", "RichText" ) == "true" );
   mNoteEditDlg->setTitle( journal->summary() );
   mNoteEditDlg->setText( journal->description() );
 
--- branches/KDE/3.5/kdepim/kontact/plugins/knotes/knotes_part_p.h #495048:495049
@@ -1,6 +1,6 @@
 /*
    This file is part of the KDE project
-   Copyright (C) 2004 Michael Brade <brade@kde.org>
+   Copyright (C) 2004-2006 Michael Brade <brade@kde.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
@@ -147,8 +147,13 @@
       mTitleEdit->setText( text );
     }
 
+    void setRichText( bool rt )
+    {
+      mNoteEdit->setTextFormat( rt ? RichText : PlainText );
+    }
+
   private:
-    KLineEdit *mTitleEdit;
+    KLineEdit  *mTitleEdit;
     KNoteEdit  *mNoteEdit;
     KToolBar   *mTool;
     KPopupMenu *mEditMenu;
Comment 3 p92 2006-05-01 01:49:43 UTC
in kde 3.5.2, this seems not really fixed as it would be.  on a fresh user all my new notes seems double-line spaced, though I used only one ENTER to create a new line.
Comment 4 Michael Brade 2006-05-01 11:21:42 UTC
That's not a bug, that's intentional. You are using rich-text notes and ENTER 
starts a new paragraph, hence a bigger space. Switch rich-text off if you 
want "normal" line breaks.
Comment 5 p92 2006-05-01 16:51:15 UTC
Ok, so for the record, in rich-text mode, how do I create a line break ?

shift / ctrl / alt  ENTER do not work.
Comment 6 Michael Brade 2006-05-03 11:45:28 UTC
There are no manual line breaks in rich-text mode, there are only paragraphs. 
I'm not sure if it's worth adding yet another config option to control the 
space between paragraphs...
Comment 7 Fabio Rossi 2006-06-07 23:18:22 UTC
It'd be cool to control the space between paragraphs!