| Summary: | akregator ignores alternate link in atom feeds | ||
|---|---|---|---|
| Product: | [Applications] akregator | Reporter: | Roman Cheplyaka <roman.cheplyaka> |
| Component: | general | Assignee: | kdepim bugs <pim-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.2.1 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Roman Cheplyaka
2006-03-05 22:54:28 UTC
Confirmed. SVN commit 516877 by osterfeld:
read summary, link for Atom feeds
BUG: 123140
M +4 -0 ChangeLog
M +1 -1 src/librss/article.cpp
M +23 -3 src/librss/document.cpp
--- branches/KDE/3.5/kdepim/akregator/ChangeLog #516876:516877
@@ -7,6 +7,10 @@
Bug fixes:
+ 2006/03/09 Read more feed metadata for Atom feeds (title, link) (#123140) -fo
+ 2006/03/09 Use "refresh" cache mode as default, ignoring konq settings.
+ ("refresh" == Use cache after verifying with server)
+ This should make disabling the "Use browser cache" option unnecessary. -fo
2006/02/21 Set "rel" attribute default to "alternate", as requested by Atom specification (#122409) -ew
2006/02/21 Disable category support in the metakit backend, so it should support about 500
instead of 340 feeds now with the default 1024 open files limit on most systems. -fo
--- branches/KDE/3.5/kdepim/akregator/src/librss/article.cpp #516876:516877
@@ -77,7 +77,7 @@
for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
const QDomElement e = n.toElement();
if ( (e.tagName()==QString::fromLatin1("link")) &&
- (e.attribute(QString::fromLatin1("rel"), QString::fromLatin1("alternate"))==QString::fromLatin1("alternate")))
+ (e.attribute(QString::fromLatin1("rel"), QString::fromLatin1("alternate")) == QString::fromLatin1("alternate")))
{
d->link=n.toElement().attribute(QString::fromLatin1("href"));
break;
--- branches/KDE/3.5/kdepim/akregator/src/librss/document.cpp #516876:516877
@@ -72,6 +72,25 @@
*this = other;
}
+static QString extractLink(const QDomNode& node, Format format)
+{
+ if (format == AtomFeed)
+ {
+ QDomNode n;
+ for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ const QDomElement e = n.toElement();
+ if ( (e.tagName() == QString::fromLatin1("link"))
+ && (e.attribute(QString::fromLatin1("rel"), QString::fromLatin1("alternate")) == QString::fromLatin1("alternate")))
+ {
+ return n.toElement().attribute(QString::fromLatin1("href"));
+ }
+ }
+ }
+
+ return extractNode(node, QString::fromLatin1("link"));
+
+}
+
Document::Document(const QDomDocument &doc) : d(new Private)
{
QString elemText;
@@ -148,10 +167,11 @@
if (!(elemText = extractTitle(channelNode)).isNull())
d->title = elemText;
- if (!(elemText = extractNode(channelNode, QString::fromLatin1("description"))).isNull())
+ if (!(elemText = extractNode(channelNode, QString::fromLatin1((d->format==AtomFeed)? "summary" : "description"),
+false)).isNull())
d->description = elemText;
- if (!(elemText = extractNode(channelNode, QString::fromLatin1("link"))).isNull())
- d->link = elemText;
+
+ d->link = extractLink(channelNode, d->format);
/* This is ugly but necessary since RSS 0.90 and 1.0 have a different parent
SVN commit 516912 by osterfeld:
eh, it's "subtitle"/"tagline", not "summary" for feeds (as opposed to articles)
CCBUG: 123140
M +11 -2 document.cpp
--- branches/KDE/3.5/kdepim/akregator/src/librss/document.cpp #516911:516912
@@ -167,8 +167,17 @@
if (!(elemText = extractTitle(channelNode)).isNull())
d->title = elemText;
- if (!(elemText = extractNode(channelNode, QString::fromLatin1((d->format==AtomFeed)? "summary" : "description"),
-false)).isNull())
+ QString descriptionTagName = "description";
+
+ if (d->format == AtomFeed)
+ {
+ if (d->version == vAtom_1_0)
+ descriptionTagName = "subtitle";
+ else
+ descriptionTagName = "tagline";
+ }
+
+ if (!(elemText = extractNode(channelNode, descriptionTagName)).isNull())
d->description = elemText;
d->link = extractLink(channelNode, d->format);
|