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

List:       kmail-devel
Subject:    Bug#39665: marked as done (Word warp only works between 60 and 80 chars pr line) by Marc Mutz <mutz@
From:       owner () bugs ! kde ! org (Stephan Kulow)
Date:       2002-03-22 18:03:01
[Download RAW message or body]

Your message with subj: Bug#39665: Word warp only works between 60 and 80 chars pr line


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 22 March 2002 16:51, john@j-oestergaard.dk wrote:
<snip>
> When Word warp in "Configre KMail.." -> "Composer" is set lower than
> 60, it warps at 60 and when set higher than 80 it warps at 80.
<snip>

Thanks for the report.

Internet messages are not allowed to have lines longer than 80 chars. Counting 
the lineend (CRLF), this leaves 78 characters per line.

The problem was that the configure dialog used different limits from the rest 
of KMail. I fixed this now.

After applying this patch, you should be able to set the wrap column in the 
range [30,78]. 30 is an arbitraily chosen lower limit (taken from the 
configuredialog). I don't see a reason why we should support smaller line 
lengths and it might trigger some buggy behaviour when set to a too low value 
(e.g. 1).

To kmail@kde.org: Please review.

Marc

- -- 
Marc Mutz <mutz@kde.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8m29S3oWD+L2/6DgRAi34AJ973CrCjiwY/56nolSY4tm21W7H3gCfRwQ8
sY3NpQpftIrlWihtIj+v3aM=
=Zc+i
-----END PGP SIGNATURE-----

["filter.patch" (text/x-diff)]

Index: kmfilter.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfilter.cpp,v
retrieving revision 1.43
diff -u -p -r1.43 kmfilter.cpp
--- kmfilter.cpp	2001/12/04 18:43:13	1.43
+++ kmfilter.cpp	2002/02/25 21:49:11
@@ -86,6 +86,9 @@ KMFilter::ReturnCode KMFilter::execActio
   QPtrListIterator<KMFilterAction> it( mActions );
   for ( it.toFirst() ; it.current() ; ++it ) {
 
+    if ((*it)->isEmpty())
+       continue;
+
     kdDebug(5006) << "####### KMFilter::process: going to apply action "
 	      << (*it)->label() << " \"" << (*it)->argsAsString()
 	      << "\"" << endl;
@@ -187,13 +190,8 @@ void KMFilter::readConfig(KConfig* confi
         if ( fa ) {
   	  //...load it with it's parameter...
           fa->argsFromString( config->readEntry( argsName ) );
-	  //...check if it's emoty and...
-	  if ( !fa->isEmpty() )
-	    //...append it if it's not and...
-	    mActions.append( fa );
-	  else
-	    //...delete is else.
-	    delete fa;
+          //...append it
+          mActions.append( fa );
         }
       } else
         KMessageBox::information( 0 /* app-global modal dialog box */,
@@ -239,16 +237,6 @@ void KMFilter::writeConfig(KConfig* conf
 void KMFilter::purify()
 {
   mPattern.purify();
-
-  if (!bPopFilter) { 
-    QPtrListIterator<KMFilterAction> it( mActions );
-    it.toLast();
-    while ( it.current() )
-      if ( (*it)->isEmpty() )
-        mActions.remove ( (*it) );
-      else
-        --it;
-  }
 }
 
 bool KMFilter::isEmpty() const
Index: kmfilteraction.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfilteraction.cpp,v
retrieving revision 1.74
diff -u -p -r1.74 kmfilteraction.cpp
--- kmfilteraction.cpp	2002/02/08 11:09:53	1.74
+++ kmfilteraction.cpp	2002/02/25 21:49:12
@@ -201,7 +201,7 @@ KMFilterActionWithFolder::KMFilterAction
 
 QWidget* KMFilterActionWithFolder::createParamWidget( QWidget* parent ) const
 {
-  KMFolderComboBox *cb = new KMFolderComboBox( parent );
+  KMFolderComboBox *cb = new KMFolderComboBox( true, parent );
   cb->showImapFolders( false );
   setParamWidgetValue( cb );
   return cb;
@@ -210,6 +210,14 @@ QWidget* KMFilterActionWithFolder::creat
 void KMFilterActionWithFolder::applyParamWidgetValue( QWidget* paramWidget )
 {
   mFolder = ((KMFolderComboBox *)paramWidget)->getFolder();
+  if (mFolder)
+  {
+     mFolderName = QString::null;
+  }
+  else
+  {
+     mFolderName = ((KMFolderComboBox *)paramWidget)->currentText();
+  }
 }
 
 void KMFilterActionWithFolder::setParamWidgetValue( QWidget* paramWidget ) const
@@ -217,7 +225,7 @@ void KMFilterActionWithFolder::setParamW
   if ( mFolder )
     ((KMFolderComboBox *)paramWidget)->setFolder( mFolder );
   else
-    clearParamWidget( paramWidget );
+    ((KMFolderComboBox *)paramWidget)->setFolder( mFolderName );
 }
 
 void KMFilterActionWithFolder::clearParamWidget( QWidget* paramWidget ) const
@@ -228,6 +236,10 @@ void KMFilterActionWithFolder::clearPara
 void KMFilterActionWithFolder::argsFromString( const QString argsStr )
 {
   mFolder = kernel->folderMgr()->findIdString( argsStr );
+  if (mFolder)
+     mFolderName = QString::null;
+  else
+     mFolderName = argsStr;
 }
 
 const QString KMFilterActionWithFolder::argsAsString() const
@@ -236,7 +248,7 @@ const QString KMFilterActionWithFolder::
   if ( mFolder )
     result = mFolder->idString();
   else
-    result = "";
+    result = mFolderName;
   return result;
 }
 
@@ -244,6 +256,7 @@ bool KMFilterActionWithFolder::folderRem
 {
   if ( aFolder == mFolder ) {
     mFolder = aNewFolder;
+    mFolderName = QString::null;
     return TRUE;
   } else
     return FALSE;
Index: kmfilteraction.h
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfilteraction.h,v
retrieving revision 1.27
diff -u -p -r1.27 kmfilteraction.h
--- kmfilteraction.h	2001/11/30 10:13:21	1.27
+++ kmfilteraction.h	2002/02/25 21:49:12
@@ -340,7 +340,7 @@ public:
 
 protected:
   QGuardedPtr<KMFolder> mFolder;
-  QStringList mFolderNames;
+  QString mFolderName;
 };
 
 //=========================================================
Index: kmfiltermgr.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfiltermgr.cpp,v
retrieving revision 1.40
diff -u -p -r1.40 kmfiltermgr.cpp
--- kmfiltermgr.cpp	2002/01/16 12:43:31	1.40
+++ kmfiltermgr.cpp	2002/02/25 21:49:12
@@ -58,12 +58,7 @@ void KMFilterMgr::readConfig(void)
     KConfigGroupSaver saver(config, grpName);
     filter = new KMFilter(config, bPopFilter);
     filter->purify();
-    if ( filter->isEmpty() ) {
-      kdDebug(5006) << "KMFilter::readConfig: filter\n" << filter->asString()
-		<< "is empty!" << endl;
-      delete filter;
-    } else
-      append(filter);
+    append(filter);
   }
 }
 
@@ -84,13 +79,11 @@ void KMFilterMgr::writeConfig(bool withS
   QPtrListIterator<KMFilter> it(*this);
   it.toFirst();
   while ( it.current() ) {
-    if ( !(*it)->isEmpty() ) {
-      grpName.sprintf("%s #%d", group.latin1(), i);
-      //grpName.sprintf("Filter #%d", i);
-      KConfigGroupSaver saver(config, grpName);
-      (*it)->writeConfig(config);
-      ++i;
-    }
+    grpName.sprintf("%s #%d", group.latin1(), i);
+    //grpName.sprintf("Filter #%d", i);
+    KConfigGroupSaver saver(config, grpName);
+    (*it)->writeConfig(config);
+    ++i;
     ++it;
   }
   KConfigGroupSaver saver(config, "General");
Index: kmfoldercombobox.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfoldercombobox.cpp,v
retrieving revision 1.8
diff -u -p -r1.8 kmfoldercombobox.cpp
--- kmfoldercombobox.cpp	2002/01/08 02:50:04	1.8
+++ kmfoldercombobox.cpp	2002/02/25 21:49:12
@@ -31,6 +31,7 @@ void KMFolderComboBox::init()
   mImapShown = true;
   refreshFolders();
   connect( this, SIGNAL( activated(int) ), this, SLOT( slotActivated(int) ) );
+  connect( this, SIGNAL( textChanged(const QString &)), this, SLOT( slotTextChanged() ) );
   connect( kernel->folderMgr(), SIGNAL(changed()), this, SLOT(refreshFolders()) );
   if (mImapShown) connect( kernel->imapFolderMgr(), SIGNAL(changed()), this, SLOT(refreshFolders()) );
 }
@@ -94,10 +95,17 @@ void KMFolderComboBox::refreshFolders()
   QValueList<QGuardedPtr<KMFolder> > folders;
   createFolderList( &names, &folders );
   
+  QString current;
   KMFolder *folder = getFolder();
+  if (!folder)
+     current = currentText();
   this->clear();
   insertStringList( names );
-  setFolder( folder );
+  if (folder)
+     setFolder( folder );
+  else
+     setCurrentText(current);
+  
 }
 
 //-----------------------------------------------------------------------------
@@ -110,7 +118,9 @@ void KMFolderComboBox::setFolder( KMFold
   
   int idx = folders.findIndex( aFolder );
   if (idx == -1)
+  {
     idx = folders.findIndex( kernel->draftsFolder() );
+  }
   setCurrentItem( idx >= 0 ? idx : 0 );
   
   mFolder = aFolder;
@@ -120,7 +130,15 @@ void KMFolderComboBox::setFolder( const 
 {
   KMFolder *folder = kernel->folderMgr()->findIdString( idString );
   if (!folder) folder = kernel->imapFolderMgr()->findIdString( idString );
-  setFolder( folder );
+  if (!folder && editable())
+  {
+     mFolder = 0;
+     setCurrentText(idString);
+  }
+  else
+  {
+     setFolder( folder );
+  }
 }
 
 //-----------------------------------------------------------------------------
@@ -141,7 +159,9 @@ KMFolder *KMFolderComboBox::getFolder()
       return *folders.at( idx );
     idx++;
   }
-  
+  if (editable())
+    return 0;
+
   return kernel->draftsFolder();
 }
 
@@ -152,10 +172,16 @@ void KMFolderComboBox::slotActivated(int
   QStringList names;
   QValueList<QGuardedPtr<KMFolder> > folders;
   createFolderList( &names, &folders );
-  
-  mFolder = *folders.at( index );
-  KMFolder *folder = mFolder;
-  QString name = folder->name();
+
+  if (index < folders.count())
+     mFolder = *folders.at( index );
+  else 
+     mFolder = 0;
+}
+
+void KMFolderComboBox::slotTextChanged()
+{
+  mFolder = 0;
 }
 
 //-----------------------------------------------------------------------------
Index: kmfoldercombobox.h
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfoldercombobox.h,v
retrieving revision 1.5
diff -u -p -r1.5 kmfoldercombobox.h
--- kmfoldercombobox.h	2002/01/08 02:50:04	1.5
+++ kmfoldercombobox.h	2002/02/25 21:49:12
@@ -33,6 +33,7 @@ public slots:
   
 private slots:
   void slotActivated(int index);
+  void slotTextChanged();
   
 private:
   /** Create folder list using the folder manager. */

has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Stephan Kulow
(administrator, KDE bugs database)

Received: (at submit) by bugs.kde.org; 22 Mar 2002 15:51:07 +0000
Received: (qmail 20553 invoked by uid 33); 22 Mar 2002 15:51:05 -0000
Date: 22 Mar 2002 15:51:05 -0000
Message-ID: <20020322155105.20552.qmail@mail.kde.org>
To: submit@bugs.kde.org
Subject: Word warp only works between 60 and 80 chars pr line
From: john@j-oestergaard.dk
X-KDE-Received: -80.196.2.57

Package:           kmail
Version:           1.4 (using KDE 2.9.0 9 (3.0 rc3))
Severity:          normal
Installed from:    SuSE
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:                Linux (i686) release 2.4.16-4GB
OS/Compiler notes: 

When Word warp in "Configre KMail.." -> "Composer" is set lower than 60, it warps at \
60 and when set higher than 80 it warps at 80.

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)

_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail



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

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