Hello community, here is the log from the commit of package syndication for openSUSE:Factory checked in at 2018-08-22 14:15:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/syndication (Old) and /work/SRC/openSUSE:Factory/.syndication.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "syndication" Wed Aug 22 14:15:53 2018 rev:36 rq:630176 version:18.08.0 Changes: -------- --- /work/SRC/openSUSE:Factory/syndication/syndication.changes 2018-07-18 22:46:28.172447001 +0200 +++ /work/SRC/openSUSE:Factory/.syndication.new/syndication.changes 2018-08-22 14:15:53.709718020 +0200 @@ -1,0 +2,23 @@ +Thu Aug 16 22:08:37 UTC 2018 - [email protected] + +- Update to 18.08.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-18.08.0.php +- Changes since 18.07.80: + * None + +------------------------------------------------------------------- +Thu Jul 26 13:01:08 UTC 2018 - [email protected] + +- Update to 18.07.80 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-18.07.80.php +- Changes since 18.04.3: + * Use Q_REQUIRED_RESULT + * Remove the unused OutputRetriever + * Replace KRandom with QUuid to ensure uniqueness + * Remove Syndication::FileRetriever + +------------------------------------------------------------------- Old: ---- syndication-18.04.3.tar.xz New: ---- syndication-18.08.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ syndication.spec ++++++ --- /var/tmp/diff_new_pack.OYlqzT/_old 2018-08-22 14:15:54.309719442 +0200 +++ /var/tmp/diff_new_pack.OYlqzT/_new 2018-08-22 14:15:54.313719451 +0200 @@ -16,13 +16,12 @@ # -%define kf5_version 5.36.0 +%define kf5_version 5.47.0 Name: syndication -Version: 18.04.3 +Version: 18.08.0 Release: 0 -%define kf5_version 5.26.0 # Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA) -%{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} +%{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} Summary: KDE PIM Libraries: Syndication License: LGPL-2.1-or-later Group: System/GUI/KDE @@ -31,9 +30,11 @@ BuildRequires: extra-cmake-modules >= 1.0.0 BuildRequires: kcodecs-devel >= %{kf5_version} BuildRequires: kf5-filesystem -BuildRequires: kio-devel >= %{kf5_version} BuildRequires: pkgconfig -BuildRequires: pkgconfig(Qt5Test) >= 5.2.0 +BuildRequires: pkgconfig(Qt5Network) +BuildRequires: pkgconfig(Qt5Test) >= 5.8.0 +BuildRequires: pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(Qt5Xml) BuildRoot: %{_tmppath}/%{name}-%{version}-build %description ++++++ syndication-18.04.3.tar.xz -> syndication-18.08.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/CMakeLists.txt new/syndication-18.08.0/CMakeLists.txt --- old/syndication-18.04.3/CMakeLists.txt 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/CMakeLists.txt 2018-08-03 18:40:38.000000000 +0200 @@ -1,11 +1,12 @@ cmake_minimum_required(VERSION 3.0) -set(PIM_VERSION "5.8.3") +set(PIM_VERSION "5.9.0") set(SYNDICATION_LIB_VERSION ${PIM_VERSION}) project(Syndication VERSION ${SYNDICATION_LIB_VERSION}) # ECM setup -set(KF5_VERSION "5.44.0") +set(KF5_VERSION "5.47.0") +set(QT5_VERSION "5.9.0") find_package(ECM ${KF5_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) @@ -31,7 +32,10 @@ ) ########### Find packages ########### -find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED) +find_package(Qt5Widgets ${QT5_VERSION} CONFIG REQUIRED) +find_package(Qt5Xml ${QT5_VERSION} CONFIG REQUIRED) +find_package(Qt5Network ${QT5_VERSION} CONFIG REQUIRED) # for testloader + find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED) add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT) add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/CMakeLists.txt new/syndication-18.08.0/src/syndication/CMakeLists.txt --- old/syndication-18.04.3/src/syndication/CMakeLists.txt 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/CMakeLists.txt 2018-08-03 18:40:38.000000000 +0200 @@ -124,7 +124,6 @@ PRIVATE Qt5::Xml KF5::Codecs - KF5::KIOCore ) set_target_properties(KF5Syndication PROPERTIES diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/category.h new/syndication-18.08.0/src/syndication/atom/category.h --- old/syndication-18.04.3/src/syndication/atom/category.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/category.h 2018-08-03 18:40:38.000000000 +0200 @@ -67,7 +67,7 @@ * @return the category term as plain text (no HTML, "&", "<" etc. are * unescaped!) */ - QString term() const; + Q_REQUIRED_RESULT QString term() const; /** * naming scheme the category term is part of. (optional) @@ -77,7 +77,7 @@ * @return a URI representing the scheme, or a null string * if not specified */ - QString scheme() const; + Q_REQUIRED_RESULT QString scheme() const; /** * Label of the category (optional). @@ -88,14 +88,14 @@ * @return the label as plain text (no HTML, "&", "<" etc. are * unescaped!), or a null string if not specified */ - QString label() const; + Q_REQUIRED_RESULT QString label() const; /** * description of this category object for debugging purposes * * @return debug string */ - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; }; } // namespace Atom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/content.h new/syndication-18.08.0/src/syndication/atom/content.h --- old/syndication-18.04.3/src/syndication/atom/content.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/content.h 2018-08-03 18:40:38.000000000 +0200 @@ -110,7 +110,7 @@ * @return the content type. If no type is specified, "text" (the * default) is returned. */ - QString type() const; + Q_REQUIRED_RESULT QString type() const; /** * If src() is set, the content of this entry is not contained in the @@ -123,7 +123,7 @@ * @return a null string if the content is contained in the feed * source, or a URL linking to the remote content */ - QString src() const; + Q_REQUIRED_RESULT QString src() const; /** * returns the content as string. If the content format is Text, the @@ -135,7 +135,7 @@ * (see isContained()) */ - QString asString() const; + Q_REQUIRED_RESULT QString asString() const; /** * returns binary content as byte array. @@ -143,44 +143,44 @@ * @return byte array containing the embedded binary data, or * an empty array if the content is not in binary format */ - QByteArray asByteArray() const; + Q_REQUIRED_RESULT QByteArray asByteArray() const; /** * returns the content format */ - Format format() const; + Q_REQUIRED_RESULT Format format() const; /** * returns whether the content is contained in the feed source, * or not. If it is not contained, src() provides a URL to the * content. */ - bool isContained() const; + Q_REQUIRED_RESULT bool isContained() const; /** * returns whether the content is embedded XML. * Use element() to access the DOM tree, or asString() to get the XML * as string. */ - bool isXML() const; + Q_REQUIRED_RESULT bool isXML() const; /** * returns whether the content is binary content or not. * Use asByteArray() to access it. */ - bool isBinary() const; + Q_REQUIRED_RESULT bool isBinary() const; /** * returns whether the content is plain text or not. * Use asString() to access it. */ - bool isPlainText() const; + Q_REQUIRED_RESULT bool isPlainText() const; /** * returns whether the content is escaped HTML or not * Use asString() to access it */ - bool isEscapedHTML() const; + Q_REQUIRED_RESULT bool isEscapedHTML() const; /** * returns a description of the content object @@ -188,7 +188,7 @@ * * @return debug string */ - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; private: class ContentPrivate; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/document.h new/syndication-18.08.0/src/syndication/atom/document.h --- old/syndication-18.04.3/src/syndication/atom/document.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/document.h 2018-08-03 18:40:38.000000000 +0200 @@ -87,31 +87,31 @@ * According to the Atom 1.0 spec, a feed must have an * author unless all entries in it have one. */ - QList<Person> authors() const; + Q_REQUIRED_RESULT QList<Person> authors() const; /** * a list of persons who contribute to this feed. (optional) */ - QList<Person> contributors() const; + Q_REQUIRED_RESULT QList<Person> contributors() const; /** * a list of categories this feed is assigned to (optional) */ - QList<Category> categories() const; + Q_REQUIRED_RESULT QList<Category> categories() const; /** * URL of an image serving as a feed icon (optional) * * @return icon URL, or a null string if not specified in the feed. */ - QString icon() const; + Q_REQUIRED_RESULT QString icon() const; /** * URL of an image serving as a feed logo (optional) * * @return image URL, or a null string if not specified in the feed. */ - QString logo() const; + Q_REQUIRED_RESULT QString logo() const; /** * a string that unambigously identifies the feed (required) @@ -120,7 +120,7 @@ * a valid URI (which is neither checked nor enforced by this parser) * */ - QString id() const; + Q_REQUIRED_RESULT QString id() const; /** * copyright information (optional) @@ -128,14 +128,14 @@ * @return copyright information for the feed (intended for human * readers), or a null string if not specified */ - QString rights() const; + Q_REQUIRED_RESULT QString rights() const; /** * feed title (required). * * @return title string as HTML. */ - QString title() const; + Q_REQUIRED_RESULT QString title() const; /** * description or subtitle of the feed (optional). @@ -143,7 +143,7 @@ * @return subtitle string as HTML, or a null string * if not specified in the feed. */ - QString subtitle() const; + Q_REQUIRED_RESULT QString subtitle() const; /** * description of the agent used to generate the feed. See @@ -152,31 +152,31 @@ * @return description of the generator, or a null Generator object * if not specified in the feed. */ - Generator generator() const; + Q_REQUIRED_RESULT Generator generator() const; /** * The datetime of the last modification of the feed content. * * @return the modification date in seconds since epoch */ - time_t updated() const; + Q_REQUIRED_RESULT time_t updated() const; /** * a list of links. See Link for more information on * link types. */ - QList<Link> links() const; + Q_REQUIRED_RESULT QList<Link> links() const; /** * a list of the entries (items) in this feed. */ - QList<Entry> entries() const; + Q_REQUIRED_RESULT QList<Entry> entries() const; /** * returns all child elements of this feed not covered by this class. * This can be used to access additional metadata from Atom extensions. */ - QList<QDomElement> unhandledElements() const; + Q_REQUIRED_RESULT QList<QDomElement> unhandledElements() const; /** * returns a description of this feed document for debugging @@ -184,14 +184,14 @@ * * @return debug string */ - QString debugInfo() const override; + Q_REQUIRED_RESULT QString debugInfo() const override; /** * returns whether this document is valid or not. * Invalid documents do not contain any useful * information. */ - bool isValid() const override; + Q_REQUIRED_RESULT bool isValid() const override; }; /** @@ -230,7 +230,7 @@ * * @return the entry */ - Entry entry() const; + Q_REQUIRED_RESULT Entry entry() const; /** * returns a description of this entry document for debugging @@ -238,14 +238,14 @@ * * @return debug string */ - QString debugInfo() const override; + Q_REQUIRED_RESULT QString debugInfo() const override; /** * returns whether this document is valid or not. * Invalid documents do not contain any useful * information. */ - bool isValid() const override; + Q_REQUIRED_RESULT bool isValid() const override; }; } // namespace Atom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/entry.h new/syndication-18.08.0/src/syndication/atom/entry.h --- old/syndication-18.04.3/src/syndication/atom/entry.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/entry.h 2018-08-03 18:40:38.000000000 +0200 @@ -85,24 +85,24 @@ * the list of authors of the containing feed is used. That list * is set by setFeedAuthors(). */ - QList<Person> authors() const; + Q_REQUIRED_RESULT QList<Person> authors() const; /** * a list of categories this entry is filed to (optional) */ - QList<Category> categories() const; + Q_REQUIRED_RESULT QList<Category> categories() const; /** * list of persons contributing to this entry (optional) */ - QList<Person> contributors() const; + Q_REQUIRED_RESULT QList<Person> contributors() const; /** * ID of the article. (required) * The ID must be unique inside this feed. The atom spec defines it as a * URI (which is not enforced by this parser) */ - QString id() const; + Q_REQUIRED_RESULT QString id() const; /** * links pointing to associated web sites and other resources. @@ -111,7 +111,7 @@ * Otherwise, it must contain at least one link with * a @c rel value of @c "alternate". (see Link). */ - QList<Link> links() const; + Q_REQUIRED_RESULT QList<Link> links() const; /** * copyright information (optional) @@ -119,7 +119,7 @@ * @return copyright information for the entry (intended for human * readers), or a null string if not specified */ - QString rights() const; + Q_REQUIRED_RESULT QString rights() const; /** * source description of the content (optional) @@ -130,21 +130,21 @@ * @return source description, or a null object if not * specified */ - Source source() const; + Q_REQUIRED_RESULT Source source() const; /** * The datetime of the publication of this entry (optional). * * @return the publication date in seconds since epoch */ - time_t published() const; + Q_REQUIRED_RESULT time_t published() const; /** * The datetime of the last modification of this entry (required). * * @return the modification date in seconds since epoch */ - time_t updated() const; + Q_REQUIRED_RESULT time_t updated() const; /** * a short summary, abstract or excerpt of an entry. (optional) @@ -153,14 +153,14 @@ * * @return the summary as HTML, or a null string if not specified */ - QString summary() const; + Q_REQUIRED_RESULT QString summary() const; /** * title of the entry (required). * * @return the title as HTML */ - QString title() const; + Q_REQUIRED_RESULT QString title() const; /** * content of the entry (optional) @@ -168,13 +168,13 @@ * * @return entry content, or a null content object if not specified */ - Content content() const; + Q_REQUIRED_RESULT Content content() const; /** * returns all child elements of this entry not covered by this class. * This can be used to access additional metadata from Atom extensions. */ - QList<QDomElement> unhandledElements() const; + Q_REQUIRED_RESULT QList<QDomElement> unhandledElements() const; /** * Sets the list of the containing feed's authors, which will be used @@ -189,7 +189,7 @@ * * @return debug string */ - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/generator.h new/syndication-18.08.0/src/syndication/atom/generator.h --- old/syndication-18.04.3/src/syndication/atom/generator.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/generator.h 2018-08-03 18:40:38.000000000 +0200 @@ -58,26 +58,26 @@ /** * A URI for the generator (e.g. its homepage) (optional) */ - QString uri() const; + Q_REQUIRED_RESULT QString uri() const; /** * version of the agent (optional) */ - QString version() const; + Q_REQUIRED_RESULT QString version() const; /** * human-readable name of the generator. (optional) * * @return generator name as plain text */ - QString name() const; + Q_REQUIRED_RESULT QString name() const; /** * a description of this generator for debugging purposes. * * @return debug info */ - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/link.h new/syndication-18.08.0/src/syndication/atom/link.h --- old/syndication-18.04.3/src/syndication/atom/link.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/link.h 2018-08-03 18:40:38.000000000 +0200 @@ -58,7 +58,7 @@ /** * URL of the referenced resource (required) */ - QString href() const; + Q_REQUIRED_RESULT QString href() const; /** * the relation between the feed/entry and the linked resource. @@ -84,7 +84,7 @@ * @return the rel value specified in the feed. Default value is * @c "alternate" */ - QString rel() const; + Q_REQUIRED_RESULT QString rel() const; /** * MIME type of the linked resource. (optional) @@ -92,7 +92,7 @@ * @return MIME type following (e.g., "text/html", "audio/mpeg"), * or a null string if not set */ - QString type() const; + Q_REQUIRED_RESULT QString type() const; /** * the language of the linked resource. (optional) @@ -102,7 +102,7 @@ * @return a language tag as defined in RFC 3066, * or a null string if not specified */ - QString hrefLanguage() const; + Q_REQUIRED_RESULT QString hrefLanguage() const; /** * human-readable information about the link. (optional) @@ -110,21 +110,21 @@ * @return the link title as plain text ("<", "&" are text, not * markup!), or a null string if not specified */ - QString title() const; + Q_REQUIRED_RESULT QString title() const; /** * size of the linked resource in bytes. (optional) * * @return file size in bytes, or 0 if not specified */ - uint length() const; + Q_REQUIRED_RESULT uint length() const; /** * description of the link object for debugging purposes * * @return debug string */ - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; }; } // namespace Atom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/parser.h new/syndication-18.08.0/src/syndication/atom/parser.h --- old/syndication-18.04.3/src/syndication/atom/parser.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/parser.h 2018-08-03 18:40:38.000000000 +0200 @@ -66,7 +66,7 @@ * @see SpecificDocument::isValid() * @param source the document source to parse */ - Syndication::SpecificDocumentPtr parse( + Q_REQUIRED_RESULT Syndication::SpecificDocumentPtr parse( const Syndication::DocumentSource &source) const override; /** @@ -74,7 +74,7 @@ * @c "atom" * @return @c "atom" */ - QString format() const override; + Q_REQUIRED_RESULT QString format() const override; private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/person.h new/syndication-18.08.0/src/syndication/atom/person.h --- old/syndication-18.04.3/src/syndication/atom/person.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/person.h 2018-08-03 18:40:38.000000000 +0200 @@ -63,28 +63,28 @@ * * @return a human-readable name of the person */ - QString name() const; + Q_REQUIRED_RESULT QString name() const; /** * A URI associated with the person (optional). Usually the homepage. * * @return the URI of the person, or a null string if not specified */ - QString uri() const; + Q_REQUIRED_RESULT QString uri() const; /** * returns an e-mail address associated with the person. (optional) * * @return an e-mail address, or a null string if not specified */ - QString email() const; + Q_REQUIRED_RESULT QString email() const; /** * description for debugging purposes * * @return debug string */ - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; }; } // namespace Atom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/atom/source.h new/syndication-18.08.0/src/syndication/atom/source.h --- old/syndication-18.04.3/src/syndication/atom/source.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/atom/source.h 2018-08-03 18:40:38.000000000 +0200 @@ -69,30 +69,30 @@ /** * authors of the original content (optional) */ - QList<Person> authors() const; + Q_REQUIRED_RESULT QList<Person> authors() const; /** * contributors to the original content (optional) */ - QList<Person> contributors() const; + Q_REQUIRED_RESULT QList<Person> contributors() const; /** * categories the source feed is assigned to (optional) */ - QList<Category> categories() const; + Q_REQUIRED_RESULT QList<Category> categories() const; /** * description of the software which generated the source feed * (optional) */ - Generator generator() const; + Q_REQUIRED_RESULT Generator generator() const; /** * URL of an image serving as a feed icon (optional) * * @return icon URL, or a null string if not specified */ - QString icon() const; + Q_REQUIRED_RESULT QString icon() const; /** * a string that unambigously identifies the source feed (optional) @@ -100,20 +100,20 @@ * @return the ID of the source feed, or a null string if not * specified. */ - QString id() const; + Q_REQUIRED_RESULT QString id() const; /** * a list of links. See Link for more information on * link types. */ - QList<Link> links() const; + Q_REQUIRED_RESULT QList<Link> links() const; /** * URL of an image, the logo of the source feed (optional) * * @return image URL, or a null string if not specified in the feed. */ - QString logo() const; + Q_REQUIRED_RESULT QString logo() const; /** * copyright information (optional) @@ -121,7 +121,7 @@ * @return copyright information for the source, * or a null string if not specified */ - QString rights() const; + Q_REQUIRED_RESULT QString rights() const; /** * description or subtitle of the source feed (optional). @@ -129,14 +129,14 @@ * @return subtitle string as HTML, or a null string * if not specified. */ - QString subtitle() const; + Q_REQUIRED_RESULT QString subtitle() const; /** * source feed title (optional). * * @return title string as HTML, or a null string if not specified */ - QString title() const; + Q_REQUIRED_RESULT QString title() const; /** * The datetime of the last modification of the source feed @@ -144,14 +144,14 @@ * * @return the modification date in seconds since epoch */ - time_t updated() const; + Q_REQUIRED_RESULT time_t updated() const; /** * description of this source object for debugging purposes * * @return debug string */ - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; }; } // namespace Atom diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/dataretriever.cpp new/syndication-18.08.0/src/syndication/dataretriever.cpp --- old/syndication-18.04.3/src/syndication/dataretriever.cpp 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/dataretriever.cpp 2018-08-03 18:40:38.000000000 +0200 @@ -10,16 +10,6 @@ */ #include "dataretriever.h" -#include "global.h" -#include "syndication_version.h" - -#include <kio/job.h> - -#include <kprocess.h> -#include <QUrl> - -#include <QBuffer> -#include <QTimer> namespace Syndication { @@ -32,186 +22,5 @@ { } -struct FileRetriever::FileRetrieverPrivate { - FileRetrieverPrivate() - : buffer(nullptr), - lastError(0), job(nullptr) - { - } - - ~FileRetrieverPrivate() - { - delete buffer; - } - - QBuffer *buffer; - int lastError; - KIO::TransferJob *job; -}; - -FileRetriever::FileRetriever() - : d(new FileRetrieverPrivate) -{ -} - -FileRetriever::~FileRetriever() -{ - delete d; -} - -bool FileRetriever::m_useCache = true; -QString FileRetriever::m_userAgent = QStringLiteral("Syndication %1").arg(QStringLiteral(SYNDICATION_VERSION_STRING)); - -void FileRetriever::setUserAgent(const QString &userAgent) -{ - m_userAgent = userAgent; -} - -void FileRetriever::setUseCache(bool enabled) -{ - m_useCache = enabled; -} - -void FileRetriever::retrieveData(const QUrl &url) -{ - if (d->buffer) { - return; - } - - d->buffer = new QBuffer; - d->buffer->open(QIODevice::WriteOnly); - - QUrl u = url; - - if (u.scheme() == QLatin1String("feed")) { - u.setScheme(QStringLiteral("http")); - } - - d->job = KIO::get(u, KIO::NoReload, KIO::HideProgressInfo); - - d->job->addMetaData(QStringLiteral("UserAgent"), m_userAgent); - d->job->addMetaData(QStringLiteral("cache"), m_useCache ? QStringLiteral("refresh") : QStringLiteral("reload")); - - QTimer::singleShot(1000 * 90, this, &FileRetriever::slotTimeout); - - connect(d->job, &KIO::TransferJob::data, this, &FileRetriever::slotData); - connect(d->job, &KIO::TransferJob::result, this, &FileRetriever::slotResult); - connect(d->job, &KIO::TransferJob::permanentRedirection, this, &FileRetriever::slotPermanentRedirection); -} - -void FileRetriever::slotTimeout() -{ - abort(); - - delete d->buffer; - d->buffer = nullptr; - - d->lastError = KIO::ERR_SERVER_TIMEOUT; - - emit dataRetrieved(QByteArray(), false); -} - -int FileRetriever::errorCode() const -{ - return d->lastError; -} - -void FileRetriever::slotData(KIO::Job *, const QByteArray &data) -{ - d->buffer->write(data.data(), data.size()); -} - -void FileRetriever::slotResult(KJob *job) -{ - QByteArray data = d->buffer->buffer(); - data.detach(); - - delete d->buffer; - d->buffer = nullptr; - - d->lastError = job->error(); - emit dataRetrieved(data, d->lastError == 0); -} - -void FileRetriever::slotPermanentRedirection(KIO::Job *, const QUrl &, - const QUrl &newUrl) -{ - emit permanentRedirection(newUrl); -} - -void FileRetriever::abort() -{ - if (d->job) { - d->job->kill(); - d->job = nullptr; - } -} - -struct OutputRetriever::OutputRetrieverPrivate { - OutputRetrieverPrivate() : process(nullptr), buffer(nullptr), lastError(0) - { - } - - ~OutputRetrieverPrivate() - { - delete process; - delete buffer; - } - - KProcess *process; - QBuffer *buffer; - int lastError; -}; - -OutputRetriever::OutputRetriever() : d(new OutputRetrieverPrivate) -{ -} - -OutputRetriever::~OutputRetriever() -{ - delete d; -} - -void OutputRetriever::retrieveData(const QUrl &url) -{ - // Ignore subsequent calls if we didn't finish the previous job yet. - if (d->buffer || d->process) { - return; - } - - d->buffer = new QBuffer; - d->buffer->open(QIODevice::WriteOnly); - - d->process = new KProcess(); - connect(d->process, QOverload<int,QProcess::ExitStatus>::of(&KProcess::finished), this, &OutputRetriever::slotFinished); - d->process->setShellCommand(url.path()); - d->process->start(); -} - -int OutputRetriever::errorCode() const -{ - return d->lastError; -} - -void OutputRetriever::slotFinished(int exitCode, QProcess::ExitStatus exitStatus) -{ - Q_UNUSED(exitCode); - if (!d->process->exitCode()) { - d->lastError = d->process->exitCode(); - } - - QByteArray data = d->process->readAllStandardOutput(); - - delete d->buffer; - d->buffer = nullptr; - - int code = d->process->exitCode(); - - delete d->process; - d->process = nullptr; - - emit dataRetrieved(data, exitStatus == QProcess::NormalExit && code == 0); -} - } // namespace Syndication diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/dataretriever.h new/syndication-18.08.0/src/syndication/dataretriever.h --- old/syndication-18.04.3/src/syndication/dataretriever.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/dataretriever.h 2018-08-03 18:40:38.000000000 +0200 @@ -14,13 +14,7 @@ #include <QObject> #include <QString> -#include <QProcess> -namespace KIO -{ -class Job; -} -class KJob; class QUrl; class QByteArray; @@ -91,151 +85,6 @@ DataRetriever &operator=(const DataRetriever &other); }; -/** - * Implements a data retriever which executes a program and stores returned - * by the program on stdout. To be used with Loader::loadFrom(). - * @see DataRetriever, Loader::loadFrom() - */ -class SYNDICATION_EXPORT OutputRetriever : public DataRetriever -{ - Q_OBJECT - -public: - - /** - * Default constructor. - */ - OutputRetriever(); - - /** - * Destructor. - */ - ~OutputRetriever() override; - - /** - * Executes the program referenced by the given URL and retrieves - * the data which the program prints to stdout. - * @param url An URL which is supposed to reference an executable - * file. - * @see Loader::loadFrom() - */ - void retrieveData(const QUrl &url) override; - - /** - * @return The error code for the last process of retrieving data. - * 0 is returned in case there was no error, otherwise an error - * code which depends on the particular program which was run is - * returned. - */ - int errorCode() const override; - - void abort() override {} - -private Q_SLOTS: - void slotFinished(int exitCode, QProcess::ExitStatus exitStatus) ; - -private: - OutputRetriever(const OutputRetriever &other); - OutputRetriever &operator=(const OutputRetriever &other); - - struct OutputRetrieverPrivate; - OutputRetrieverPrivate *const d; -}; - -/** - * Implements a file retriever, to be used with Loader::loadFrom(). - * @see DataRetriever, Loader::loadFrom() - */ -class SYNDICATION_EXPORT FileRetriever : public DataRetriever -{ - Q_OBJECT - -public: - - /** - * Default constructor. - */ - FileRetriever(); - - /** - * Destructor. - */ - ~FileRetriever() override; - - /** - * Downloads the file referenced by the given URL and passes it's - * contents on to the Loader. - * @param url An URL referencing a file which is assumed to - * reference valid XML. - * @see Loader::loadFrom() - */ - void retrieveData(const QUrl &url) override; - - /** - * @return The error code for the last process of retrieving data. - * The returned numbers correspond directly to the error codes - * <a href="http://developer.kde.org/documentation/library/cvs-api/classref/kio/KIO.html#Error">as - * defined by KIO</a>. - */ - int errorCode() const override; - - /** - * aborts the retrieval process. - */ - void abort() override; - - /** - * sets whether the retriever should use the KHTML cache or - * always refetch the file. By default, the cache is used. - * - * @param enabled whether to use the HTML cache or not - */ - static void setUseCache(bool enabled); - - /** - * sets the user agent string sent to the remote server - * - * @param userAgent user agent string - */ - static void setUserAgent(const QString &userAgent); - -Q_SIGNALS: - - /** - * Signals a permanent redirection. The redirection itself is - * handled internally, so you don't need to call Loader::loadFrom() - * with the new URL. This signal is useful in case you want to - * notify the user, or adjust a database entry. - * - * @param url the new URL after the redirection - * - * @see Loader::loadFrom() - */ - void permanentRedirection(const QUrl &url); - -protected Q_SLOTS: - - void slotTimeout(); - -private Q_SLOTS: - - void slotData(KIO::Job *job, const QByteArray &data); - void slotResult(KJob *job); - void slotPermanentRedirection(KIO::Job *job, const QUrl &fromUrl, - const QUrl &toUrl); - -private: - - static bool m_useCache; - static QString m_userAgent; - - FileRetriever(const FileRetriever &other); - FileRetriever &operator=(const FileRetriever &other); - - struct FileRetrieverPrivate; - FileRetrieverPrivate *const d; -}; - } // namespace Syndication #endif // SYNDICATION_DATARETRIEVER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/documentsource.h new/syndication-18.08.0/src/syndication/documentsource.h --- old/syndication-18.04.3/src/syndication/documentsource.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/documentsource.h 2018-08-03 18:40:38.000000000 +0200 @@ -93,7 +93,7 @@ * * @return the feed source as raw byte array. */ - QByteArray asByteArray() const; + Q_REQUIRED_RESULT QByteArray asByteArray() const; /** * returns the size the source array in bytes. @@ -101,7 +101,7 @@ * @return the size of the byte array in bytes. * See also QByteArray::size() */ - unsigned int size() const; + Q_REQUIRED_RESULT unsigned int size() const; /** * calculates a hash value for the source array. @@ -112,7 +112,7 @@ * @return the hash calculated from the source, 0 if the * source is empty */ - unsigned int hash() const; + Q_REQUIRED_RESULT unsigned int hash() const; /** * Returns the feed source as DOM document. @@ -125,12 +125,12 @@ * * @return XML representation parsed from the raw source */ - QDomDocument asDomDocument() const; + Q_REQUIRED_RESULT QDomDocument asDomDocument() const; /** * returns the URL the document source was loaded from */ - QString url() const; + Q_REQUIRED_RESULT QString url() const; private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/elementwrapper.h new/syndication-18.08.0/src/syndication/elementwrapper.h --- old/syndication-18.04.3/src/syndication/elementwrapper.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/elementwrapper.h 2018-08-03 18:40:38.000000000 +0200 @@ -93,7 +93,7 @@ * @return @c true if isNull() is true for the wrapped element, * @c false otherwise */ - bool isNull() const; + Q_REQUIRED_RESULT bool isNull() const; /** * returns the xml:base value to be used for the wrapped element. @@ -103,7 +103,7 @@ * * @return the xml:base value, or a null string if not set */ - QString xmlBase() const; + Q_REQUIRED_RESULT QString xmlBase() const; /** * returns the xml:lang value to be used for the wrapped element. @@ -112,7 +112,7 @@ * * @return the xml:lang value, or a null string if not set */ - QString xmlLang() const; + Q_REQUIRED_RESULT QString xmlLang() const; /** * completes relative URIs with a prefix specified via xml:base. @@ -132,7 +132,7 @@ * xml:base is set in the scope of this element, @c uri is returned * unmodified. */ - QString completeURI(const QString &uri) const; + Q_REQUIRED_RESULT QString completeURI(const QString &uri) const; /** * extracts the text from a child element, respecting namespaces. If @@ -157,7 +157,7 @@ * if there is no such tag */ - QString extractElementTextNS(const QString &namespaceURI, + Q_REQUIRED_RESULT QString extractElementTextNS(const QString &namespaceURI, const QString &localName) const; /** @@ -175,7 +175,7 @@ * @return the (trimmed) text content of @c tagName, or a null string if * there is no such tag */ - QString extractElementText(const QString &tagName) const; + Q_REQUIRED_RESULT QString extractElementText(const QString &tagName) const; /** * returns all child elements with tag name @c tagName @@ -185,7 +185,7 @@ * @param tagName the tag name of the elements to extract * @return a list of child elements with the given tag name */ - QList<QDomElement> elementsByTagName(const QString &tagName) const; + Q_REQUIRED_RESULT QList<QDomElement> elementsByTagName(const QString &tagName) const; /** * returns the child nodes of the wrapped element as XML. @@ -193,7 +193,7 @@ * See childNodesAsXML(const QDomElement& parent) for details * @return XML serialization of the wrapped element's children */ - QString childNodesAsXML() const; + Q_REQUIRED_RESULT QString childNodesAsXML() const; /** * concatenates the XML representations of all children. Example: If @@ -212,7 +212,7 @@ * XML * @return XML serialization of parent's children */ - static QString childNodesAsXML(const QDomElement &parent); + Q_REQUIRED_RESULT static QString childNodesAsXML(const QDomElement &parent); /** * returns all child elements with tag name @c tagname @@ -226,7 +226,7 @@ * @return a list of child elements with the given namespace URI * and tag name */ - QList<QDomElement> elementsByTagNameNS(const QString &nsURI, + Q_REQUIRED_RESULT QList<QDomElement> elementsByTagNameNS(const QString &nsURI, const QString &tagName) const; /** @@ -239,14 +239,14 @@ * @return the first child element with the given namespace URI and tag * name, or a null element if no such element was found. */ - QDomElement firstElementByTagNameNS(const QString &nsURI, + Q_REQUIRED_RESULT QDomElement firstElementByTagNameNS(const QString &nsURI, const QString &tagName) const; /** * Returns the wrapped element's text or an empty string. * For more information, see QDomElement::text(); */ - QString text() const; + Q_REQUIRED_RESULT QString text() const; /** * Returns the attribute called name. If the attribute does not exist @@ -256,7 +256,7 @@ * @param name tag name * @param defValue the default value */ - QString attribute(const QString &name, + Q_REQUIRED_RESULT QString attribute(const QString &name, const QString &defValue = QString()) const; /** @@ -269,7 +269,7 @@ * @param localName local tag name * @param defValue the default value */ - QString attributeNS(const QString &nsURI, const QString &localName, + Q_REQUIRED_RESULT QString attributeNS(const QString &nsURI, const QString &localName, const QString &defValue = QString()) const; /** @@ -278,7 +278,7 @@ * * @param name the attribute name (without namespace) */ - bool hasAttribute(const QString &name) const; + Q_REQUIRED_RESULT bool hasAttribute(const QString &name) const; /** * Returns true if this element has an attribute with the local name @@ -287,7 +287,7 @@ * @param nsURI namespace URI * @param localName local attribute name */ - bool hasAttributeNS(const QString &nsURI, const QString &localName) const; + Q_REQUIRED_RESULT bool hasAttributeNS(const QString &nsURI, const QString &localName) const; private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/loader.cpp new/syndication-18.08.0/src/syndication/loader.cpp --- old/syndication-18.04.3/src/syndication/loader.cpp 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/loader.cpp 2018-08-03 18:40:38.000000000 +0200 @@ -67,11 +67,6 @@ delete d; } -void Loader::loadFrom(const QUrl &url) -{ - loadFrom(url, new FileRetriever); -} - void Loader::loadFrom(const QUrl &url, DataRetriever *retriever) { if (d->retriever != nullptr) { @@ -119,7 +114,6 @@ d->retrieverError = d->retriever->errorCode(); ErrorCode status = Success; FeedPtr feed; - bool isFileRetriever = dynamic_cast<FileRetriever *>(d->retriever) != nullptr; delete d->retriever; d->retriever = nullptr; @@ -132,15 +126,9 @@ discoverFeeds(data); } } else { - if (isFileRetriever) { - // retriever is a FileRetriever, so we interpret the - // error code and set lastError accordingly - status = FileNotFound; // TODO - qCDebug(SYNDICATION_LOG) << "file retriever error:" << d->retrieverError; - } else { - // retriever is a custom impl, so we set OtherRetrieverError - status = OtherRetrieverError; - } + qCDebug(SYNDICATION_LOG) << "Retriever error:" << d->retrieverError; + // retriever is a custom impl, so we set OtherRetrieverError + status = OtherRetrieverError; } emit loadingComplete(this, feed, status); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/loader.h new/syndication-18.08.0/src/syndication/loader.h --- old/syndication-18.04.3/src/syndication/loader.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/loader.h 2018-08-03 18:40:38.000000000 +0200 @@ -115,29 +115,21 @@ void loadFrom(const QUrl &url, DataRetriever *retriever); /** - * Convenience method. Does the same as the above method, where - * FileRetriever is used as retriever implementation. - * - * @param url A URL referencing the input file. - */ - void loadFrom(const QUrl &url); - - /** * Retrieves the error code of the last loading process (if any). */ - ErrorCode errorCode() const; + Q_REQUIRED_RESULT ErrorCode errorCode() const; /** * the error code returned from the retriever. * Use this if you use your custom retriever implementation and * need the specific error, not covered by errorCode(). */ - int retrieverError() const; + Q_REQUIRED_RESULT int retrieverError() const; /** * returns the URL of a feed discovered in the feed source */ - QUrl discoveredFeedURL() const; + Q_REQUIRED_RESULT QUrl discoveredFeedURL() const; /** * aborts the loading process diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/mapper/categoryatomimpl.h new/syndication-18.08.0/src/syndication/mapper/categoryatomimpl.h --- old/syndication-18.04.3/src/syndication/mapper/categoryatomimpl.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/mapper/categoryatomimpl.h 2018-08-03 18:40:38.000000000 +0200 @@ -43,13 +43,13 @@ explicit CategoryAtomImpl(const Syndication::Atom::Category &category); - bool isNull() const override; + Q_REQUIRED_RESULT bool isNull() const override; - QString term() const override; + Q_REQUIRED_RESULT QString term() const override; - QString scheme() const override; + Q_REQUIRED_RESULT QString scheme() const override; - QString label() const override; + Q_REQUIRED_RESULT QString label() const override; private: Syndication::Atom::Category m_category; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/mapper/categoryrss2impl.h new/syndication-18.08.0/src/syndication/mapper/categoryrss2impl.h --- old/syndication-18.04.3/src/syndication/mapper/categoryrss2impl.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/mapper/categoryrss2impl.h 2018-08-03 18:40:38.000000000 +0200 @@ -43,13 +43,13 @@ explicit CategoryRSS2Impl(const Syndication::RSS2::Category &category); - bool isNull() const override; + Q_REQUIRED_RESULT bool isNull() const override; - QString term() const override; + Q_REQUIRED_RESULT QString term() const override; - QString label() const override; + Q_REQUIRED_RESULT QString label() const override; - QString scheme() const override; + Q_REQUIRED_RESULT QString scheme() const override; private: Syndication::RSS2::Category m_category; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/mapper/enclosureatomimpl.h new/syndication-18.08.0/src/syndication/mapper/enclosureatomimpl.h --- old/syndication-18.04.3/src/syndication/mapper/enclosureatomimpl.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/mapper/enclosureatomimpl.h 2018-08-03 18:40:38.000000000 +0200 @@ -43,17 +43,17 @@ explicit EnclosureAtomImpl(const Syndication::Atom::Link &link); - bool isNull() const override; + Q_REQUIRED_RESULT bool isNull() const override; - QString url() const override; + Q_REQUIRED_RESULT QString url() const override; - QString title() const override; + Q_REQUIRED_RESULT QString title() const override; - QString type() const override; + Q_REQUIRED_RESULT QString type() const override; - uint length() const override; + Q_REQUIRED_RESULT uint length() const override; - uint duration() const override; + Q_REQUIRED_RESULT uint duration() const override; private: Syndication::Atom::Link m_link; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/mapper/enclosurerss2impl.h new/syndication-18.08.0/src/syndication/mapper/enclosurerss2impl.h --- old/syndication-18.04.3/src/syndication/mapper/enclosurerss2impl.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/mapper/enclosurerss2impl.h 2018-08-03 18:40:38.000000000 +0200 @@ -45,17 +45,17 @@ explicit EnclosureRSS2Impl(const Syndication::RSS2::Item &item, const Syndication::RSS2::Enclosure &enc); - bool isNull() const override; + Q_REQUIRED_RESULT bool isNull() const override; - QString url() const override; + Q_REQUIRED_RESULT QString url() const override; - QString title() const override; + Q_REQUIRED_RESULT QString title() const override; - QString type() const override; + Q_REQUIRED_RESULT QString type() const override; - uint length() const override; + Q_REQUIRED_RESULT uint length() const override; - uint duration() const override; + Q_REQUIRED_RESULT uint duration() const override; private: Syndication::RSS2::Item m_item; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/personimpl.h new/syndication-18.08.0/src/syndication/personimpl.h --- old/syndication-18.04.3/src/syndication/personimpl.h 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/personimpl.h 2018-08-03 18:40:38.000000000 +0200 @@ -46,19 +46,19 @@ PersonImpl(); PersonImpl(const QString &name, const QString &uri, const QString &email); - bool isNull() const override + Q_REQUIRED_RESULT bool isNull() const override { return m_null; } - QString name() const override + Q_REQUIRED_RESULT QString name() const override { return m_name; } - QString uri() const override + Q_REQUIRED_RESULT QString uri() const override { return m_uri; } - QString email() const override + Q_REQUIRED_RESULT QString email() const override { return m_email; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/src/syndication/rdf/resource.cpp new/syndication-18.08.0/src/syndication/rdf/resource.cpp --- old/syndication-18.04.3/src/syndication/rdf/resource.cpp 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/src/syndication/rdf/resource.cpp 2018-08-03 18:40:38.000000000 +0200 @@ -27,11 +27,10 @@ #include "property.h" #include "statement.h" -#include <krandom.h> - #include <QList> #include <QString> #include <QWeakPointer> +#include <QUuid> namespace Syndication { @@ -69,7 +68,7 @@ Resource::Resource(const QString &uri) : d(new ResourcePrivate) { if (uri.isNull()) { - d->uri = KRandom::randomString(10); // TODO: ensure uniqueness + d->uri = QUuid().createUuid().toString(); d->isAnon = true; } else { d->uri = uri; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/tests/CMakeLists.txt new/syndication-18.08.0/tests/CMakeLists.txt --- old/syndication-18.04.3/tests/CMakeLists.txt 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/tests/CMakeLists.txt 2018-08-03 18:40:38.000000000 +0200 @@ -8,5 +8,5 @@ set(testloader_SRCS testloader.cpp) add_executable(testloader ${testloader_SRCS}) -target_link_libraries(testloader KF5Syndication KF5::CoreAddons Qt5::Widgets) +target_link_libraries(testloader KF5Syndication Qt5::Widgets Qt5::Network) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/syndication-18.04.3/tests/testloader.cpp new/syndication-18.08.0/tests/testloader.cpp --- old/syndication-18.04.3/tests/testloader.cpp 2018-06-12 08:19:25.000000000 +0200 +++ new/syndication-18.08.0/tests/testloader.cpp 2018-08-03 18:40:38.000000000 +0200 @@ -27,6 +27,7 @@ #include "specificdocument.h" #include "feed.h" #include "loader.h" +#include "dataretriever.h" #include "atom/parser.h" #include "rdf/parser.h" #include "rss2/parser.h" @@ -42,12 +43,62 @@ #include <QDir> #include <QFile> #include <QString> +#include <QNetworkAccessManager> +#include <QNetworkRequest> +#include <QNetworkReply> #include <cstdlib> #include <iostream> using namespace Syndication; +class SimpleRetriever : public Syndication::DataRetriever +{ + Q_OBJECT +public: + explicit SimpleRetriever() + : mMgr(new QNetworkAccessManager) + , mReply(nullptr) + { + } + ~SimpleRetriever() + { + delete mReply; + delete mMgr; + } + + void retrieveData(const QUrl & url) override + { + mReply = mMgr->get(QNetworkRequest(url)); + connect(mReply, &QNetworkReply::finished, + this, [this]() { + if (mReply->error() == QNetworkReply::NoError) { + Q_EMIT dataRetrieved(mReply->readAll(), true); + } else { + Q_EMIT dataRetrieved({}, false); + } + }); + } + void abort() override + { + if (mReply) { + mReply->abort(); + } + } + int errorCode() const override + { + if (mReply) { + return mReply->error(); + } else { + return 0; + } + } + +private: + QNetworkAccessManager *mMgr; + QNetworkReply *mReply; +}; + TestLibSyndication::TestLibSyndication(const QString &url) { QUrl kurl = QUrl::fromUserInput(url); @@ -56,7 +107,7 @@ Loader *loader = Loader::create(this, SLOT(slotLoadingComplete(Syndication::Loader *, Syndication::FeedPtr, Syndication::ErrorCode))); - loader->loadFrom(kurl); + loader->loadFrom(kurl, new SimpleRetriever()); } void TestLibSyndication::slotLoadingComplete(Syndication::Loader *loader, @@ -102,3 +153,4 @@ return app.exec(); } +#include "testloader.moc"
