Bug#43277: crash in coutputwidget when doing automake/autoconf

Kuba Ober kuba at mareimbrium.org
Mon Jun 3 15:48:05 UTC 2002


> > On Friday 31 May 2002 21:53, Kuba Ober wrote:
> > > I consider the COutputWidget broken, because it passes unknown text
> > > (generated by make / autoconf / whatever) to QMultiLineEdit, and
> > > QMultiLineEdit may consider it rich text because of some funny
> >
> > characters
> >
> > > that go in there.
> >
> > oops... that's right.
> >
> > I attached a (pretty trivial) patch, if no one complains, I'll commit
> > it
> > tomorrow.
> >
> > Best regards,
> > Harry> Index: coutputwidget.cpp
> > ===================================================================
> > RCS file: /home/kde/kdevelop/kdevelop/coutputwidget.cpp,v
> > retrieving revision 1.3.2.4.2.10.2.17
> > diff -u -3 -p -r1.3.2.4.2.10.2.17 coutputwidget.cpp
> > --- coutputwidget.cpp 2002/05/19 20:34:08 1.3.2.4.2.10.2.17
> > +++ coutputwidget.cpp 2002/06/02 13:25:19
> > @@ -23,6 +23,7 @@
> >  #include <qpainter.h>
> >  #include <qpixmap.h>
> >  #include <qfont.h>
> > +#include <qstylesheet.h>
> >
> >  COutputWidget::COutputWidget(QWidget* parent, const char* name) :
> >  //  KEdit(parent,name)
> > @@ -111,6 +112,10 @@ void CMakeOutputWidget::insertAtEnd(cons
> >      int row = (numLines() < 1)? 0 : numLines()-1;
> >      int col = qstrlen(textLine(row));
> >      bool displayAdditions=atEnd();
> > +
> > +    // escapes the string
> > +    line = QStyleSheet::convertFromPlainText( line );
> > +
> >      insertAt(line, row, col);
> >      if (displayAdditions)
> >        setCursorPosition(numLines()+1,0);
> > @@ -121,6 +126,9 @@ void CMakeOutputWidget::insertAtEnd(cons
> >      getCursorPosition(&currentPara, &index);
> >      int paraCount = paragraphs()-1;
> >      bool displayAdditions = (paraCount == currentPara);
> > +
> > +    // escape rich edit tags like "&", "<", ">"
> > +    line = QStyleSheet::escape( line );
> >
> >      switch (lineType(paraCount))
> >      {

Geez, why not just set the format to Qt::PlainText in the first place? Code 
gets simpler then.

Cheers, Kuba




More information about the KDevelop-devel mailing list