-rw-r--r-- | noncore/todayplugins/fortune/fortunepluginwidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/todayplugins/fortune/fortunepluginwidget.cpp b/noncore/todayplugins/fortune/fortunepluginwidget.cpp index 583bf0b..b210fa9 100644 --- a/noncore/todayplugins/fortune/fortunepluginwidget.cpp +++ b/noncore/todayplugins/fortune/fortunepluginwidget.cpp @@ -57,27 +57,28 @@ void FortunePluginWidget::getFortune() { fortune = new OTicker( this ); // fortune->setReadOnly( TRUE ); // fortune->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); fortune->setText( QString("Obtaining fortune...") ); layoutFortune->addWidget( fortune ); fortuneProcess = new OProcess(); *fortuneProcess << "fortune"; connect(fortuneProcess, SIGNAL(receivedStdout(OProcess*, char*, int ) ), this, SLOT(slotStdOut(OProcess*, char*, int) ) ); if(!fortuneProcess->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { qWarning("could not start :("); fortune->setText( QString("Failed to obtain fortune.") ); delete fortuneProcess; fortuneProcess = 0; } } void FortunePluginWidget::slotStdOut( OProcess* proc, char* buf, int len ) { - QCString cstring( buf, len ); - fortune->setText( cstring ); + QCString s( buf, len ); + s.replace( QRegExp("\n"), "" ); + fortune->setText( s ); } |