[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdesdk/kbugbuster
From: Cornelius Schumacher <schumacher () kde ! org>
Date: 2003-03-17 15:42:59
[Download RAW message or body]
CVS commit by cschumac:
Make wrap column configurable.
M +7 -5 backend/domprocessor.cpp 1.15
M +2 -1 kbbprefs.cpp 1.22
M +3 -2 kbbprefs.h 1.13
--- kdesdk/kbugbuster/kbbprefs.cpp #1.21:1.22
@@ -34,4 +34,5 @@ KBBPrefs::KBBPrefs() :
addItemBool("SendBCC",&mSendBCC,false);
addItemString("OverrideRecipient",&mOverrideRecipient,QString::null);
+ addItemInt("WrapColumn",&mWrapColumn,90);
KPrefs::setCurrentGroup("MsgInputDlg");
--- kdesdk/kbugbuster/kbbprefs.h #1.12:1.13
@@ -1,6 +1,5 @@
#ifndef KBBPREFS_H
#define KBBPREFS_H
-// $Id$
-// (C) 2001 by Cornelius Schumacher
+// (C) 2001,2003 by Cornelius Schumacher
#include <qmap.h>
@@ -44,4 +43,6 @@ class KBBPrefs : public KPrefs
bool mShowVoted;
int mMinVotes;
+
+ int mWrapColumn;
QMap<QString,QString> mMessageButtons;
--- kdesdk/kbugbuster/backend/domprocessor.cpp #1.14:1.15
@@ -32,4 +32,5 @@
#include "bugimpl.h"
#include "bugdetailsimpl.h"
+#include "kbbprefs.h"
DomProcessor::DomProcessor( BugServer *server )
@@ -242,5 +243,6 @@ void DomProcessor::setBugDetailsQuery( K
QString DomProcessor::wrapLines( const QString &text )
{
- // Bug reporters don't wrap at 80... let's do it ourselves then
+ int wrap = KBBPrefs::instance()->mWrapColumn;
+
QStringList lines = QStringList::split( '\n', text, true );
//kdDebug() << lines.count() << " lines." << endl;
@@ -260,11 +262,11 @@ QString DomProcessor::wrapLines( const Q
QString wrappedLine;
- while ( line.length() > 80 )
+ while ( line.length() > wrap )
{
- int breakPoint = line.findRev( ' ', 80 );
+ int breakPoint = line.findRev( ' ', wrap );
//kdDebug() << "Breaking at " << breakPoint << endl;
if( breakPoint == -1 ) {
- wrappedLine += line.left( 80 ) + '\n';
- line = line.mid( 80 );
+ wrappedLine += line.left( wrap ) + '\n';
+ line = line.mid( wrap );
} else {
wrappedLine += line.left( breakPoint ) + '\n';
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic