Make the feed uri the baseUrl for previews
ClosedPublic

Authored by pinaraf on Mar 13 2019, 9:43 PM.

Details

Summary

For some feeds (linuxfr.org for instance), the links in the feed are
relative to the feed URI (for instance, //linuxfr.org/some/content).
These links were broken by the forced baseUri of file://. It is better to
instead use the feed uri as the base.

Diff Detail

Repository
R201 Akregator
Branch
fixBaseUrl
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9551
Build 9569: arc lint + arc unit
pinaraf created this revision.Mar 13 2019, 9:43 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMar 13 2019, 9:43 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
pinaraf requested review of this revision.Mar 13 2019, 9:43 PM
mlaurent requested changes to this revision.Mar 14 2019, 8:12 AM
mlaurent added a subscriber: mlaurent.
mlaurent added inline comments.
src/articleviewerwidget.cpp
196

Are you sure that article.feed()->xmlUrl() is never null ?

This revision now requires changes to proceed.Mar 14 2019, 8:12 AM
pinaraf marked an inline comment as done.Mar 14 2019, 8:33 PM
pinaraf added inline comments.
src/articleviewerwidget.cpp
196

100% sure. See feed.cpp line 146 where Feeds are instanciated from OPML. Otherwise, they are instanciated when added by URL. Having it null would be terrible about everywhere in the codebase I think.

pinaraf requested review of this revision.Mar 14 2019, 8:54 PM
pinaraf marked 2 inline comments as done.
mlaurent requested changes to this revision.Mar 18 2019, 6:03 AM
mlaurent added inline comments.
src/articleviewerwidget.cpp
196

Ok add a

const QUrl xmlUrl = QUrl(article.feed()->xmlUrl());
qCDebug(...) << " xmlUrl : "<< xmlUrl;
m_articleHtmlWriter->setBaseUrl(xmlUrl);

so we can debug it if there is a wierd url.

Thanks

This revision now requires changes to proceed.Mar 18 2019, 6:03 AM
pinaraf updated this revision to Diff 54359.Mar 19 2019, 8:14 PM
  • Drop reference to .css files that do not exist
  • Output the xmlUri to help debug, as asked by mlaurent
pinaraf marked an inline comment as done.Mar 19 2019, 8:19 PM

I fixed for mlaurent.
I also fixed a new warning about the .css files that do not exist. Previously, they generated silent errors, but now that the baseUrl does not allow by default file:// urls, it appears in the program output.

mlaurent accepted this revision.Mar 20 2019, 6:53 AM
This revision is now accepted and ready to land.Mar 20 2019, 6:53 AM
pinaraf closed this revision.Mar 20 2019, 10:33 AM

Merged in master.