From 7a8dcdeb39c487c10d7908576d50059b9e10b937 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 24 Aug 2021 18:42:08 +0300 Subject: [PATCH] syndication: replace boost::shared_ptr with std::shared_ptr where possible Signed-off-by: Ivailo Monev --- syndication/atom/content.h | 10 ++++------ syndication/atom/document.h | 7 +++---- syndication/documentsource.h | 9 ++++----- syndication/elementwrapper.h | 10 ++++------ syndication/feed.h | 8 +++----- syndication/item.h | 10 ++++------ syndication/mapper/mapperatomimpl.h | 5 ++--- syndication/mapper/mapperrdfimpl.h | 6 ++---- syndication/mapper/mapperrss2impl.h | 6 ++---- syndication/rdf/literal.h | 8 ++++---- syndication/rdf/model.h | 10 ++++------ syndication/rdf/resource.h | 12 +++++------- syndication/rdf/resourcewrapper.h | 6 ++++-- syndication/rdf/sequence.h | 10 +++++----- syndication/rdf/statement.h | 8 ++++---- syndication/rss2/document.h | 13 ++++++------- syndication/rss2/item.cpp | 14 +++++++------- syndication/rss2/item.h | 19 +++++++++---------- 18 files changed, 76 insertions(+), 95 deletions(-) diff --git a/syndication/atom/content.h b/syndication/atom/content.h index 67e040a2..420d91e4 100644 --- a/syndication/atom/content.h +++ b/syndication/atom/content.h @@ -23,14 +23,12 @@ #ifndef SYNDICATION_ATOM_CONTENT_H #define SYNDICATION_ATOM_CONTENT_H -#include - #include - -#include - #include #include +#include + +#include namespace Syndication { namespace Atom { @@ -193,7 +191,7 @@ class SYNDICATION_EXPORT Content : public ElementWrapper private: class ContentPrivate; - boost::shared_ptr d; + std::shared_ptr d; }; } // namespace Atom diff --git a/syndication/atom/document.h b/syndication/atom/document.h index 6685b718..f885d7ba 100644 --- a/syndication/atom/document.h +++ b/syndication/atom/document.h @@ -23,12 +23,11 @@ #ifndef SYNDICATION_ATOM_DOCUMENT_H #define SYNDICATION_ATOM_DOCUMENT_H -#include -#include - +#include #include -#include +#include +#include namespace Syndication { diff --git a/syndication/documentsource.h b/syndication/documentsource.h index ff4581bb..eee35aef 100644 --- a/syndication/documentsource.h +++ b/syndication/documentsource.h @@ -24,12 +24,11 @@ #define SYNDICATION_DOCUMENTSOURCE_H #include -#include - -#include "ksyndication_export.h" - #include #include +#include + +#include "ksyndication_export.h" namespace Syndication { @@ -134,7 +133,7 @@ class SYNDICATION_EXPORT DocumentSource private: class DocumentSourcePrivate; - boost::shared_ptr d; + std::shared_ptr d; }; } // namespace Syndication diff --git a/syndication/elementwrapper.h b/syndication/elementwrapper.h index 913c596f..3191657c 100644 --- a/syndication/elementwrapper.h +++ b/syndication/elementwrapper.h @@ -23,13 +23,11 @@ #define SYNDICATION_ELEMENTWRAPPER_H #include - -#include - -#include "ksyndication_export.h" - #include #include +#include + +#include "ksyndication_export.h" namespace Syndication { @@ -293,7 +291,7 @@ class SYNDICATION_EXPORT ElementWrapper private: class ElementWrapperPrivate; - boost::shared_ptr d; + std::shared_ptr d; }; } // namespace Syndication diff --git a/syndication/feed.h b/syndication/feed.h index ff8209fe..1d47a295 100644 --- a/syndication/feed.h +++ b/syndication/feed.h @@ -23,15 +23,13 @@ #ifndef SYNDICATION_FEED_H #define SYNDICATION_FEED_H -#include - -#include "ksyndication_export.h" - #include - #include #include #include +#include + +#include "ksyndication_export.h" namespace Syndication { diff --git a/syndication/item.h b/syndication/item.h index b77ffd65..5fbacf23 100644 --- a/syndication/item.h +++ b/syndication/item.h @@ -24,15 +24,13 @@ #define SYNDICATION_ITEM_H #include -#include - -#include "ksyndication_export.h" - -#include - #include #include #include +#include +#include + +#include "ksyndication_export.h" namespace Syndication { diff --git a/syndication/mapper/mapperatomimpl.h b/syndication/mapper/mapperatomimpl.h index b5b1e5ac..2cf20428 100644 --- a/syndication/mapper/mapperatomimpl.h +++ b/syndication/mapper/mapperatomimpl.h @@ -31,15 +31,14 @@ #include - namespace Syndication { /** @internal */ class AtomMapper : public Mapper { - boost::shared_ptr map(SpecificDocumentPtr doc) const + FeedPtr map(SpecificDocumentPtr doc) const { - return boost::shared_ptr(new FeedAtomImpl(boost::static_pointer_cast(doc))); + return FeedPtr(new FeedAtomImpl(boost::static_pointer_cast(doc))); } }; diff --git a/syndication/mapper/mapperrdfimpl.h b/syndication/mapper/mapperrdfimpl.h index f737cdf4..3e6ca0b7 100644 --- a/syndication/mapper/mapperrdfimpl.h +++ b/syndication/mapper/mapperrdfimpl.h @@ -31,16 +31,14 @@ #include #include - - namespace Syndication { /** @internal */ class RDFMapper : public Mapper { - boost::shared_ptr map(SpecificDocumentPtr doc) const + FeedPtr map(SpecificDocumentPtr doc) const { - return boost::shared_ptr(new FeedRDFImpl(boost::static_pointer_cast(doc))); + return FeedPtr(new FeedRDFImpl(boost::static_pointer_cast(doc))); } }; diff --git a/syndication/mapper/mapperrss2impl.h b/syndication/mapper/mapperrss2impl.h index 1d8790bc..594be601 100644 --- a/syndication/mapper/mapperrss2impl.h +++ b/syndication/mapper/mapperrss2impl.h @@ -31,16 +31,14 @@ #include #include - - namespace Syndication { /** @internal */ class RSS2Mapper : public Mapper { - boost::shared_ptr map(SpecificDocumentPtr doc) const + FeedPtr map(SpecificDocumentPtr doc) const { - return boost::shared_ptr(new FeedRSS2Impl(boost::static_pointer_cast(doc))); + return FeedPtr(new FeedRSS2Impl(boost::static_pointer_cast(doc))); } }; diff --git a/syndication/rdf/literal.h b/syndication/rdf/literal.h index d853f9b6..6661f931 100644 --- a/syndication/rdf/literal.h +++ b/syndication/rdf/literal.h @@ -24,10 +24,11 @@ #define SYNDICATION_RDF_LITERAL_H #include -#include - +#include #include +#include + namespace Syndication { namespace RDF { @@ -154,8 +155,7 @@ class SYNDICATION_EXPORT Literal : public Node private: class LiteralPrivate; - typedef boost::shared_ptr LiteralPrivatePtr; - LiteralPrivatePtr d; + std::shared_ptr d; }; diff --git a/syndication/rdf/model.h b/syndication/rdf/model.h index 9b0172cf..5366b5d7 100644 --- a/syndication/rdf/model.h +++ b/syndication/rdf/model.h @@ -22,21 +22,19 @@ #ifndef SYNDICATION_RDF_MODEL_H #define SYNDICATION_RDF_MODEL_H +#include +#include +#include + #include #include #include - #include #include #include #include -#include #include -#include - -#include - namespace Syndication { namespace RDF { diff --git a/syndication/rdf/resource.h b/syndication/rdf/resource.h index ae027118..69b3a356 100644 --- a/syndication/rdf/resource.h +++ b/syndication/rdf/resource.h @@ -23,13 +23,12 @@ #ifndef SYNDICATION_RDF_RESOURCE_H #define SYNDICATION_RDF_RESOURCE_H -#include - -#include - #include - #include +#include +#include + +#include namespace Syndication { namespace RDF { @@ -205,8 +204,7 @@ class SYNDICATION_EXPORT Resource : public Node private: class ResourcePrivate; - typedef boost::shared_ptr ResourcePrivatePtr; - ResourcePrivatePtr d; + std::shared_ptr d; }; } // namespace RDF diff --git a/syndication/rdf/resourcewrapper.h b/syndication/rdf/resourcewrapper.h index 90728268..6525480a 100644 --- a/syndication/rdf/resourcewrapper.h +++ b/syndication/rdf/resourcewrapper.h @@ -22,9 +22,11 @@ #ifndef SYNDICATION_RDF_RESOURCEWRAPPER_H #define SYNDICATION_RDF_RESOURCEWRAPPER_H -#include +#include #include +#include + namespace Syndication { namespace RDF { @@ -102,7 +104,7 @@ class SYNDICATION_EXPORT ResourceWrapper private: class ResourceWrapperPrivate; - boost::shared_ptr d; + std::shared_ptr d; }; } // namespace RDF diff --git a/syndication/rdf/sequence.h b/syndication/rdf/sequence.h index 06b73d98..104d03b3 100644 --- a/syndication/rdf/sequence.h +++ b/syndication/rdf/sequence.h @@ -22,12 +22,12 @@ #ifndef SYNDICATION_RDF_SEQUENCE_H #define SYNDICATION_RDF_SEQUENCE_H -#include -#include - +#include +#include #include -#include +#include +#include namespace Syndication { namespace RDF { @@ -110,7 +110,7 @@ class SYNDICATION_EXPORT Sequence : public Resource private: class SequencePrivate; - boost::shared_ptr d; + std::shared_ptr d; }; } // namespace RDF diff --git a/syndication/rdf/statement.h b/syndication/rdf/statement.h index 8c19a616..5ad39b70 100644 --- a/syndication/rdf/statement.h +++ b/syndication/rdf/statement.h @@ -22,11 +22,11 @@ #ifndef SYNDICATION_RDF_STATEMENT_H #define SYNDICATION_RDF_STATEMENT_H -#include - +#include +#include #include -#include +#include namespace Syndication { namespace RDF { @@ -128,7 +128,7 @@ class SYNDICATION_EXPORT Statement private: class StatementPrivate; - boost::shared_ptr d; + std::shared_ptr d; }; diff --git a/syndication/rss2/document.h b/syndication/rss2/document.h index ef5acfea..3d97809b 100644 --- a/syndication/rss2/document.h +++ b/syndication/rss2/document.h @@ -23,17 +23,16 @@ #ifndef SYNDICATION_RSS2_DOCUMENT_H #define SYNDICATION_RSS2_DOCUMENT_H -#include -#include - -#include - #include #include #include - #include #include +#include +#include + +#include +#include namespace Syndication { namespace RSS2 { @@ -311,7 +310,7 @@ class SYNDICATION_EXPORT Document : public Syndication::SpecificDocument, explicit Document(const QDomElement& element); class DocumentPrivate; - boost::shared_ptr d; + std::shared_ptr d; }; diff --git a/syndication/rss2/item.cpp b/syndication/rss2/item.cpp index 05f1ab0e..a01189d4 100644 --- a/syndication/rss2/item.cpp +++ b/syndication/rss2/item.cpp @@ -20,6 +20,10 @@ * */ +#include +#include +#include + #include #include #include @@ -30,10 +34,6 @@ #include #include -#include -#include -#include - namespace Syndication { namespace RSS2 { @@ -41,15 +41,15 @@ class Item::ItemPrivate { public: - boost::shared_ptr doc; + DocumentPtr doc; }; -Item::Item(boost::shared_ptr doc) : ElementWrapper(), d(new ItemPrivate) +Item::Item(DocumentPtr doc) : ElementWrapper(), d(new ItemPrivate) { d->doc = doc; } -Item::Item(const QDomElement& element, boost::shared_ptr doc) : ElementWrapper(element), d(new ItemPrivate) +Item::Item(const QDomElement& element, DocumentPtr doc) : ElementWrapper(element), d(new ItemPrivate) { d->doc = doc; } diff --git a/syndication/rss2/item.h b/syndication/rss2/item.h index c8925348..06dd3c4a 100644 --- a/syndication/rss2/item.h +++ b/syndication/rss2/item.h @@ -23,16 +23,15 @@ #ifndef SYNDICATION_RSS2_ITEM_H #define SYNDICATION_RSS2_ITEM_H -#include -#include -#include -#include - -#include - #include #include #include +#include +#include + +#include +#include +#include namespace Syndication { @@ -57,7 +56,7 @@ class SYNDICATION_EXPORT Item : public ElementWrapper, public Syndication::Speci * Default constructor, creates a null object, for which isNull() is * @c true. */ - explicit Item(boost::shared_ptr doc=boost::shared_ptr()); + explicit Item(DocumentPtr doc=DocumentPtr()); /** * Creates an Item object wrapping an @c <item> XML element. @@ -65,7 +64,7 @@ class SYNDICATION_EXPORT Item : public ElementWrapper, public Syndication::Speci * @param element The @c <item> element to wrap * @param doc the document this item is part of */ - explicit Item(const QDomElement& element, boost::shared_ptr doc=boost::shared_ptr()); + explicit Item(const QDomElement& element, DocumentPtr doc=DocumentPtr()); /** * creates a copy of an item. As the d pointer is shared, @@ -272,7 +271,7 @@ class SYNDICATION_EXPORT Item : public ElementWrapper, public Syndication::Speci private: class ItemPrivate; - boost::shared_ptr d; + std::shared_ptr d; }; } // namespace RSS2 -- 2.11.0