[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/akregator/src
From: Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date: 2010-02-07 12:02:58
Message-ID: 1265544178.731580.9850.nullmailer () svn ! kde ! org
[Download RAW message or body]
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<Article>& 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<Article>& articles, QObject* \
parent) : QAbstractTableModel( parent ), d( new Private( articles, this ) )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic