From kde-commits Sun Feb 07 12:02:58 2010 From: Frank Osterfeld Date: Sun, 07 Feb 2010 12:02:58 +0000 To: kde-commits Subject: KDE/kdepim/akregator/src Message-Id: <1265544178.731580.9850.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126554419412855 SVN commit 1086453 by osterfeld: forwardport SVN commit 1086320 by osterfeld: prevent line-breaks in the article list M +11 -1 articlemodel.cpp --- trunk/KDE/kdepim/akregator/src/articlemodel.cpp #1086452:1086453 @@ -58,12 +58,22 @@ }; +//like Syndication::htmlToPlainText, but without linebreaks + +static QString stripHtml( const QString& html ) { + QString str(html); + //TODO: preserve some formatting, such as line breaks + str.remove(QRegExp("<[^>]*>")); // remove tags + str = Syndication::resolveEntities(str); + return str.simplified(); +} + ArticleModel::Private::Private( const QList
& articles_, ArticleModel* qq ) : q( qq ), articles( articles_ ) { titleCache.resize( articles.count() ); for ( int i = 0; i < articles.count(); ++i ) - titleCache[i] = Syndication::htmlToPlainText( articles[i].title() ); + titleCache[i] = stripHtml( articles[i].title() ); } Akregator::ArticleModel::ArticleModel(const QList
& articles, QObject* parent) : QAbstractTableModel( parent ), d( new Private( articles, this ) )