diff --git a/src/articlejobs.h b/src/articlejobs.h index d2f921e8..fc1edbe6 100644 --- a/src/articlejobs.h +++ b/src/articlejobs.h @@ -1,127 +1,127 @@ /* This file is part of Akregator. Copyright (C) 2007 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_ARTICLE_JOBS_H #define AKREGATOR_ARTICLE_JOBS_H #include #include #include #include #include #include "akregator_export.h" //transitional job classes namespace Akregator { class Article; class FeedList; class TreeNode; struct ArticleId { QString feedUrl; QString guid; - bool operator<(const ArticleId &other) const + Q_REQUIRED_RESULT bool operator<(const ArticleId &other) const { return feedUrl < other.feedUrl || (feedUrl == other.feedUrl && guid < other.guid); } }; typedef QList ArticleIdList; class AKREGATOR_EXPORT CompositeJob : public KCompositeJob { Q_OBJECT public: explicit CompositeJob(QObject *parent = nullptr); - bool addSubjob(KJob *job) override; + Q_REQUIRED_RESULT bool addSubjob(KJob *job) override; void start() override; }; class AKREGATOR_EXPORT ArticleDeleteJob : public KJob { Q_OBJECT public: explicit ArticleDeleteJob(QObject *parent = nullptr); void appendArticleIds(const Akregator::ArticleIdList &ids); void appendArticleId(const Akregator::ArticleId &id); void start() override; private Q_SLOTS: void doStart(); private: QSharedPointer m_feedList; ArticleIdList m_ids; }; class AKREGATOR_EXPORT ArticleModifyJob : public KJob { Q_OBJECT public: explicit ArticleModifyJob(QObject *parent = nullptr); // TODO replace this by passing modified item later void setStatus(const ArticleId &id, int status); void setKeep(const ArticleId &id, bool keep); void start() override; private Q_SLOTS: void doStart(); private: QSharedPointer m_feedList; QMap m_keepFlags; QMap m_status; }; class AKREGATOR_EXPORT ArticleListJob : public KJob { Q_OBJECT public: explicit ArticleListJob(TreeNode *parent = nullptr); QVector
articles() const; TreeNode *node() const; void start() override; enum Error { ListingFailed = KJob::UserDefinedError }; private Q_SLOTS: void doList(); private: const QPointer m_node; QVector
m_articles; }; } // namespace akregator #endif // AKREGATOR_ARTICLE_JOBS_H diff --git a/src/feed/feed.h b/src/feed/feed.h index b79313d5..e4eb9921 100644 --- a/src/feed/feed.h +++ b/src/feed/feed.h @@ -1,308 +1,308 @@ /* This file is part of Akregator. Copyright (C) 2004 Stanislav Karchebny 2005 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_FEED_H #define AKREGATOR_FEED_H #include "akregator_export.h" #include "treenode.h" #include #include class QDomElement; class QString; namespace Akregator { class Article; class FetchQueue; class TreeNodeVisitor; class ArticleDeleteJob; namespace Backend { class Storage; } /** represents a feed */ class AKREGATOR_EXPORT Feed : public TreeNode { friend class ::Akregator::Article; friend class ::Akregator::Folder; Q_OBJECT public: /** the archiving modes */ enum ArchiveMode { globalDefault, /**< use default from Settings (default) */ keepAllArticles, /**< Don't delete any articles */ disableArchiving, /**< Don't save any articles except articles with keep flag set (equal to maxArticleNumber() == 0) */ limitArticleNumber, /**< Save maxArticleNumber() articles, plus the ones with keep flag set */ limitArticleAge /**< Save articles not older than maxArticleAge() (or keep flag set) */ }; // class methods /** converts strings to ArchiveMode value if parsing fails, it returns ArchiveMode::globalDefault */ static ArchiveMode stringToArchiveMode(const QString &str); /** converts ArchiveMode values to corresponding strings */ static QString archiveModeToString(ArchiveMode mode); /** creates a Feed object from a description in OPML format */ static Feed *fromOPML(const QDomElement &e, Akregator::Backend::Storage *storage); /** default constructor */ explicit Feed(Akregator::Backend::Storage *storage); ~Feed(); - bool accept(TreeNodeVisitor *visitor) override; + Q_REQUIRED_RESULT bool accept(TreeNodeVisitor *visitor) override; /** exports the feed settings to OPML */ - QDomElement toOPML(QDomElement parent, QDomDocument document) const override; + Q_REQUIRED_RESULT QDomElement toOPML(QDomElement parent, QDomDocument document) const override; /** returns whether this feed uses its own fetch interval or the global setting @return @c true iff this feed has a custom fetch interval */ - bool useCustomFetchInterval() const; + Q_REQUIRED_RESULT bool useCustomFetchInterval() const; /** set if the feed has its custom fetch interval or uses the global setting @param enabled @c true: use custom interval, @c false: use global default */ void setCustomFetchIntervalEnabled(bool enabled); // FIXME is it -1 or 0 to disable interval fetching? /** Returns custom auto fetch interval of this feed. @return custom fetch interval in minutes, 0 if disabled */ - int fetchInterval() const; + Q_REQUIRED_RESULT int fetchInterval() const; /** Sets custom auto fetch interval. @param interval interval in minutes, -1 for disabling auto fetching */ void setFetchInterval(int interval); /** returns the archiving mode which is used for this feed */ - ArchiveMode archiveMode() const; + Q_REQUIRED_RESULT ArchiveMode archiveMode() const; /** sets the archiving mode for this feed */ void setArchiveMode(ArchiveMode archiveMode); /** returns the maximum age of articles used for expiration by age (used in @c limitArticleAge archive mode) @return expiry age in days */ - int maxArticleAge() const; + Q_REQUIRED_RESULT int maxArticleAge() const; /** sets the maximum age of articles used for expiration by age (used in @c limitArticleAge archive mode) @param maxArticleAge expiry age in days */ void setMaxArticleAge(int maxArticleAge); /** returns the article count limit used in @c limitArticleNumber archive mode **/ - int maxArticleNumber() const; + Q_REQUIRED_RESULT int maxArticleNumber() const; /** sets the article count limit used in @c limitArticleNumber archive mode **/ void setMaxArticleNumber(int maxArticleNumber); /** if @c true, new articles are marked immediately as read instead of new/unread. Useful for high-traffic feeds. */ - bool markImmediatelyAsRead() const; + Q_REQUIRED_RESULT bool markImmediatelyAsRead() const; void setMarkImmediatelyAsRead(bool enabled); void setUseNotification(bool enabled); - bool useNotification() const; + Q_REQUIRED_RESULT bool useNotification() const; /** if true, the linked URL is loaded directly in the article viewer instead of showing the description */ void setLoadLinkedWebsite(bool enabled); - bool loadLinkedWebsite() const; + Q_REQUIRED_RESULT bool loadLinkedWebsite() const; /** returns the feed logo */ - QString logoUrl() const; + Q_REQUIRED_RESULT QString logoUrl() const; /** sets the feed image */ void setLogoUrl(const QString &url); /** returns the url of the actual feed source (rss/rdf/atom file) */ - QString xmlUrl() const; + Q_REQUIRED_RESULT QString xmlUrl() const; /** sets the url of the actual feed source (rss/rdf/atom file) */ void setXmlUrl(const QString &s); /** returns the URL of the HTML page of this feed */ - QString htmlUrl() const; + Q_REQUIRED_RESULT QString htmlUrl() const; /** sets the URL of the HTML page of this feed */ void setHtmlUrl(const QString &s); Q_REQUIRED_RESULT QString faviconUrl() const; void setFaviconUrl(const QString &url); /** returns the description of this feed */ - QString description() const; + Q_REQUIRED_RESULT QString description() const; /** sets the description of this feed */ void setDescription(const QString &s); /** returns article by guid * @param guid the guid of the article to be returned * @return the article object with the given guid, or a * null article if non-existent */ - Article findArticle(const QString &guid) const; + Q_REQUIRED_RESULT Article findArticle(const QString &guid) const; /** returns whether a fetch error has occurred */ - bool fetchErrorOccurred() const; + Q_REQUIRED_RESULT bool fetchErrorOccurred() const; Syndication::ErrorCode fetchErrorCode() const; /** returns the unread count for this feed */ - int unread() const override; + Q_REQUIRED_RESULT int unread() const override; /** returns the number of total articles in this feed @return number of articles */ - int totalCount() const override; + Q_REQUIRED_RESULT int totalCount() const override; /** returns if the article archive of this feed is loaded */ - bool isArticlesLoaded() const; + Q_REQUIRED_RESULT bool isArticlesLoaded() const; /** returns if this node is a feed group (@c false here) */ - bool isGroup() const override + Q_REQUIRED_RESULT bool isGroup() const override { return false; } //impl - bool isAggregation() const override + Q_REQUIRED_RESULT bool isAggregation() const override { return false; } /** returns the next node in the tree. Calling next() unless it returns 0 iterates through the tree in pre-order */ const TreeNode *next() const override; TreeNode *next() override; //impl - QIcon icon() const override; + Q_REQUIRED_RESULT QIcon icon() const override; /** deletes expired articles */ void deleteExpiredArticles(Akregator::ArticleDeleteJob *job); - bool isFetching() const; + Q_REQUIRED_RESULT bool isFetching() const; QVector feeds() const override; QVector feeds() override; QVector folders() const override; QVector folders() override; KJob *createMarkAsReadJob() override; - QString comment() const; + Q_REQUIRED_RESULT QString comment() const; void setComment(const QString &comment); public Q_SLOTS: /** starts fetching */ void fetch(bool followDiscovery = false); void slotAbortFetch(); /** add this feed to the fetch queue @c queue */ void slotAddToFetchQueue(Akregator::FetchQueue *queue, bool intervalFetchOnly = false) override; void slotAddFeedIconListener(); Q_SIGNALS: /** emitted when fetching started */ void fetchStarted(Akregator::Feed *); /** emitted when feed finished fetching */ void fetched(Akregator::Feed *); /** emitted when a fetch error occurred */ void fetchError(Akregator::Feed *); /** emitted when a feed URL was found by auto discovery */ void fetchDiscovery(Akregator::Feed *); /** emitted when a fetch is aborted */ void fetchAborted(Akregator::Feed *); private: Akregator::Backend::Storage *storage(); private: void setFavicon(const QIcon &icon); void loadFavicon(const QString &url, bool downloadFavicon); QVector
articles() override; /** loads articles from archive **/ void loadArticles(); void enforceLimitArticleNumber(); void recalcUnreadCount(); void doArticleNotification() override; /** sets the unread count for this feed */ void setUnread(int unread); /** notifies that article @c mya was set to "deleted". To be called by @ref Article */ void setArticleDeleted(Article &a); /** Notifies that article @p a was changed. @param oldStatus The old status if the status was changed, or -1 if the status was not changed @param process Set to @c false to disable processing the change (updating article list and updating on-screen unread count) To be called by @ref Article */ void setArticleChanged(Article &a, int oldStatus = -1, bool process = true); void appendArticles(const Syndication::FeedPtr &feed); /** appends article @c a to the article list */ void appendArticle(const Article &a); /** checks whether article @c a is expired (considering custom and global archive mode settings) */ bool isExpired(const Article &a) const; /** returns @c true if either this article uses @c limitArticleAge as custom setting or uses the global default, which is @c limitArticleAge */ bool usesExpiryByAge() const; /** executes the actual fetch action */ void tryFetch(); void markAsFetchedNow(); private Q_SLOTS: void fetchCompleted(Syndication::Loader *loader, Syndication::FeedPtr doc, Syndication::ErrorCode errorCode); private: class Private; Private *d; }; } // namespace Akregator #endif // AKREGATOR_FEED_H diff --git a/src/feed/feedlist.h b/src/feed/feedlist.h index 1652278b..95f6624e 100644 --- a/src/feed/feedlist.h +++ b/src/feed/feedlist.h @@ -1,199 +1,199 @@ /* This file is part of Akregator. Copyright (C) 2004 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_FEEDLIST_H #define AKREGATOR_FEEDLIST_H #include "akregator_export.h" #include "feedlistmanagementinterface.h" #include #include class QDomDocument; class QDomNode; template class QList; template class QHash; class QString; class KJob; namespace Akregator { class Article; class Feed; class FeedList; class FetchQueue; class Folder; class TreeNode; namespace Backend { class Storage; } class AKREGATOR_EXPORT FeedListManagementImpl : public FeedListManagementInterface { public: explicit FeedListManagementImpl(const QSharedPointer &list = QSharedPointer()); void setFeedList(const QSharedPointer &list); - QStringList categories() const override; - QStringList feeds(const QString &catId) const override; + Q_REQUIRED_RESULT QStringList categories() const override; + Q_REQUIRED_RESULT QStringList feeds(const QString &catId) const override; void addFeed(const QString &url, const QString &catId) override; void removeFeed(const QString &url, const QString &catId) override; - QString getCategoryName(const QString &catId) const override; + Q_REQUIRED_RESULT QString getCategoryName(const QString &catId) const override; private: QSharedPointer m_feedList; }; /** @class FeedList The model of a feed tree, represents an OPML document. Contains an additional root node "All Feeds" which isn't stored. Note that a node instance must not be in more than one FeedList at a time! When deleting the feed list, all contained nodes are deleted! */ class AKREGATOR_EXPORT FeedList : public QObject { Q_OBJECT public: explicit FeedList(Akregator::Backend::Storage *storage); /** Destructor. Contained nodes are deleted! */ ~FeedList(); const Folder *allFeedsFolder() const; Folder *allFeedsFolder(); - bool isEmpty() const; + Q_REQUIRED_RESULT bool isEmpty() const; const TreeNode *findByID(int id) const; TreeNode *findByID(int id); - QList findByTitle(const QString &title) const; - QList findByTitle(const QString &title); + Q_REQUIRED_RESULT QList findByTitle(const QString &title) const; + Q_REQUIRED_RESULT QList findByTitle(const QString &title); /** returns the title of the feed list (as used in the OPML document) */ - QString title() const; + Q_REQUIRED_RESULT QString title() const; /** sets the title of the feed list */ void setTitle(const QString &name); /** * returns all feeds in this list */ QVector feeds() const; QVector feeds(); QVector feedIds() const; /** * returns all folders in this list */ QVector folders() const; QVector folders(); /** appends another feed list as sub tree. The root node of @c list is ignored. NOTE: nodes are _moved_ from @c list to this feed list, not copied */ void append(FeedList *list, Folder *parent = nullptr, TreeNode *after = nullptr); /** reads an OPML document and appends the items to this list @param doc the OPML document to parse @return whether parsing was successful or not (TODO: make errors more detailed) */ - bool readFromOpml(const QDomDocument &doc); + Q_REQUIRED_RESULT bool readFromOpml(const QDomDocument &doc); /** exports the feed list as OPML. The root node ("All Feeds") is ignored! */ - QDomDocument toOpml() const; + Q_REQUIRED_RESULT QDomDocument toOpml() const; /** returns a feed object for a given feed URL. If the feed list does not contain a feed with @c url, NULL is returned. If it contains the same feed multiple times, any of the Feed objects is returned. */ const Feed *findByURL(const QString &feedURL) const; Feed *findByURL(const QString &feedURL); const Article findArticle(const QString &feedURL, const QString &guid) const; - int unread() const; + Q_REQUIRED_RESULT int unread() const; void addToFetchQueue(FetchQueue *queue, bool intervalOnly = false); KJob *createMarkAsReadJob(); Q_SIGNALS: void signalDestroyed(Akregator::FeedList *); /** emitted when a node was added to the list */ void signalNodeAdded(Akregator::TreeNode *); /** emitted when a node was removed from the list */ void signalNodeRemoved(Akregator::TreeNode *); void signalAboutToRemoveNode(Akregator::TreeNode *); void signalNodeChanged(Akregator::TreeNode *); /** emitted when fetching started */ void fetchStarted(Akregator::Feed *); /** emitted when feed finished fetching */ void fetched(Akregator::Feed *); /** emitted when a fetch error occurred */ void fetchError(Akregator::Feed *); /** emitted when a feed URL was found by auto discovery */ void fetchDiscovery(Akregator::Feed *); /** emitted when a fetch is aborted */ void fetchAborted(Akregator::Feed *); void unreadCountChanged(int unread); private: void addNode(TreeNode *node, bool preserveID); void removeNode(TreeNode *node); int generateID() const; void setRootNode(Folder *folder); void parseChildNodes(QDomNode &node, Folder *parent); private Q_SLOTS: void slotNodeDestroyed(Akregator::TreeNode *node); void slotNodeAdded(Akregator::TreeNode *node); void slotNodeRemoved(Akregator::Folder *parent, Akregator::TreeNode *node); void rootNodeChanged(); private: friend class AddNodeVisitor; class AddNodeVisitor; friend class RemoveNodeVisitor; class RemoveNodeVisitor; class Private; Private *const d; }; } // namespace Akregator #endif // AKREGATOR_FEEDLIST_H diff --git a/src/feed/feedpropertiesdialog.h b/src/feed/feedpropertiesdialog.h index 96b8d617..1c18ebda 100644 --- a/src/feed/feedpropertiesdialog.h +++ b/src/feed/feedpropertiesdialog.h @@ -1,107 +1,107 @@ /* This file is part of Akregator. Copyright (C) 2004 Stanislav Karchebny This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_FEEDPROPERTIESDIALOG_H #define AKREGATOR_FEEDPROPERTIESDIALOG_H #include "feed.h" #include "ui_feedpropertieswidgetbase.h" #include #include namespace Akregator { class FeedPropertiesWidget : public QWidget, public Ui::FeedPropertiesWidgetBase { Q_OBJECT public: explicit FeedPropertiesWidget(QWidget *parent = nullptr, const QString &name = QString()); ~FeedPropertiesWidget(); enum IntervalStep { Minutes = 0, Hours, Days, Never }; public Q_SLOTS: void slotUpdateComboBoxActivated(int index); void slotUpdateComboBoxLabels(int value); void slotUpdateCheckBoxToggled(bool enabled); }; class FeedPropertiesDialog : public QDialog { Q_OBJECT public: explicit FeedPropertiesDialog(QWidget *parent = nullptr, const QString &name = QString()); ~FeedPropertiesDialog() override; void setFeed(Feed *feed); /** selects the text in the feed title lineedit */ void selectFeedName(); public Q_SLOTS: void accept() override; protected: - QString comment() const; - QString feedName() const; - QString url() const; - bool autoFetch() const; - int fetchInterval() const; - Feed::ArchiveMode archiveMode() const; - int maxArticleAge() const; - int maxArticleNumber() const; - bool markImmediatelyAsRead() const; - bool useNotification() const; - bool loadLinkedWebsite() const; + Q_REQUIRED_RESULT QString comment() const; + Q_REQUIRED_RESULT QString feedName() const; + Q_REQUIRED_RESULT QString url() const; + Q_REQUIRED_RESULT bool autoFetch() const; + Q_REQUIRED_RESULT int fetchInterval() const; + Q_REQUIRED_RESULT Feed::ArchiveMode archiveMode() const; + Q_REQUIRED_RESULT int maxArticleAge() const; + Q_REQUIRED_RESULT int maxArticleNumber() const; + Q_REQUIRED_RESULT bool markImmediatelyAsRead() const; + Q_REQUIRED_RESULT bool useNotification() const; + Q_REQUIRED_RESULT bool loadLinkedWebsite() const; void setFeedName(const QString &title); void setUrl(const QString &url); void setAutoFetch(bool); void setFetchInterval(int); void setArchiveMode(Feed::ArchiveMode mode); void setMaxArticleAge(int age); void setMaxArticleNumber(int number); void setMarkImmediatelyAsRead(bool enabled); void setUseNotification(bool enabled); void setLoadLinkedWebsite(bool enabled); void setComment(const QString &comment); private: FeedPropertiesWidget *widget = nullptr; Feed *m_feed = nullptr; QPushButton *mOkButton = nullptr; private Q_SLOTS: void slotSetWindowTitle(const QString &); }; } // namespace Akregator #endif // AKREGATOR_FEEDPROPERTIESDIALOG_H diff --git a/src/feed/feedretriever.h b/src/feed/feedretriever.h index 12eaffc5..2813af87 100644 --- a/src/feed/feedretriever.h +++ b/src/feed/feedretriever.h @@ -1,52 +1,52 @@ /* This file is part of Akregator. Copyright (C) 2018 Daniel Vrátil This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef FEEDRETRIEVER_H_ #define FEEDRETRIEVER_H_ #include class KJob; namespace Akregator { class FeedRetriever : public Syndication::DataRetriever { Q_OBJECT public: - explicit FeedRetriever(); + FeedRetriever(); void retrieveData(const QUrl &url) override; void abort() override; - int errorCode() const override; + Q_REQUIRED_RESULT int errorCode() const override; private Q_SLOTS: void getFinished(KJob *job); private: KJob *mJob = nullptr; int mError = 0; }; } #endif diff --git a/src/fetchqueue.h b/src/fetchqueue.h index a28d02fa..75056fe1 100644 --- a/src/fetchqueue.h +++ b/src/fetchqueue.h @@ -1,85 +1,85 @@ /* This file is part of Akregator. Copyright (C) 2004 Sashmit Bhaduri 2005 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_FETCHQUEUE_H #define AKREGATOR_FETCHQUEUE_H #include "akregator_export.h" #include namespace Akregator { class Feed; class TreeNode; class AKREGATOR_EXPORT FetchQueue : public QObject { Q_OBJECT public: explicit FetchQueue(QObject *parent = nullptr); ~FetchQueue(); /** returns true when no feeds are neither fetching nor queued */ - bool isEmpty() const; + Q_REQUIRED_RESULT bool isEmpty() const; /** adds a feed to the queue */ void addFeed(Feed *f); public Q_SLOTS: /** aborts currently fetching feeds and empties the queue */ void slotAbort(); Q_SIGNALS: void signalStarted(); void signalStopped(); void fetched(Akregator::Feed *); void fetchError(Akregator::Feed *); protected: /** fetches the next feed in the queue, unless the maximum of concurrent fetches is reached */ void fetchNextFeed(); void feedDone(Feed *f); void connectToFeed(Feed *feed); void disconnectFromFeed(Feed *feed); protected Q_SLOTS: void slotNodeDestroyed(Akregator::TreeNode *node); void slotFeedFetched(Akregator::Feed *); void slotFetchError(Akregator::Feed *); void slotFetchAborted(Akregator::Feed *); private: QList m_queuedFeeds; QList m_fetchingFeeds; }; } // namespace Akregator #endif // AKREGATOR_FETCHQUEUE_H diff --git a/src/formatter/articlegrantleeobject.h b/src/formatter/articlegrantleeobject.h index 7f372343..dc1f22a9 100644 --- a/src/formatter/articlegrantleeobject.h +++ b/src/formatter/articlegrantleeobject.h @@ -1,81 +1,81 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ARTICLEGRANTLEEOBJECT_H #define ARTICLEGRANTLEEOBJECT_H #include #include #include "articleformatter.h" #include namespace Akregator { class ArticleGrantleeObject : public QObject { Q_OBJECT Q_PROPERTY(QString strippedTitle READ strippedTitle) Q_PROPERTY(QString author READ author) Q_PROPERTY(QString content READ content) Q_PROPERTY(QString articleLinkUrl READ articleLinkUrl) Q_PROPERTY(QString articlePubDate READ articlePubDate) Q_PROPERTY(QString enclosure READ enclosure) Q_PROPERTY(QString articleCompleteStoryLink READ articleCompleteStoryLink) Q_PROPERTY(QString imageFeed READ imageFeed) Q_PROPERTY(Akregator::ArticleGrantleeObject::ArticleStatus articleStatus READ articleStatus) Q_PROPERTY(bool important READ important) Q_PROPERTY(QString actionToken READ actionToken) public: explicit ArticleGrantleeObject(const Article &article, ArticleFormatter::IconOption icon, QObject *parent = nullptr); ~ArticleGrantleeObject(); enum ArticleStatus { Unread = 0, Read, New }; Q_ENUMS(ArticleStatus) Akregator::ArticleGrantleeObject::ArticleStatus articleStatus() const; - QString strippedTitle() const; - QString author() const; - QString content() const; - QString articleLinkUrl() const; - QString articlePubDate() const; - QString enclosure() const; - QString articleCompleteStoryLink() const; - QString imageFeed() const; + Q_REQUIRED_RESULT QString strippedTitle() const; + Q_REQUIRED_RESULT QString author() const; + Q_REQUIRED_RESULT QString content() const; + Q_REQUIRED_RESULT QString articleLinkUrl() const; + Q_REQUIRED_RESULT QString articlePubDate() const; + Q_REQUIRED_RESULT QString enclosure() const; + Q_REQUIRED_RESULT QString articleCompleteStoryLink() const; + Q_REQUIRED_RESULT QString imageFeed() const; //Action - QString deleteAction() const; - QString markAsReadAction() const; - QString markAsUnreadAction() const; - QString markAsImportantAction() const; - QString sendUrlAction() const; - QString sendFileAction() const; + Q_REQUIRED_RESULT QString deleteAction() const; + Q_REQUIRED_RESULT QString markAsReadAction() const; + Q_REQUIRED_RESULT QString markAsUnreadAction() const; + Q_REQUIRED_RESULT QString markAsImportantAction() const; + Q_REQUIRED_RESULT QString sendUrlAction() const; + Q_REQUIRED_RESULT QString sendFileAction() const; - bool important() const; - QString actionToken() const; + Q_REQUIRED_RESULT bool important() const; + Q_REQUIRED_RESULT QString actionToken() const; private: Article mArticle; ArticleFormatter::IconOption mArticleFormatOption; }; } #endif // ARTICLEGRANTLEEOBJECT_H diff --git a/src/formatter/defaultcombinedviewformatter.h b/src/formatter/defaultcombinedviewformatter.h index 6fb97821..03527751 100644 --- a/src/formatter/defaultcombinedviewformatter.h +++ b/src/formatter/defaultcombinedviewformatter.h @@ -1,43 +1,43 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DEFAULTCOMBINEDVIEWFORMATTER_H #define DEFAULTCOMBINEDVIEWFORMATTER_H #include "articleformatter.h" #include "akregator_export.h" class QPaintDevice; namespace Akregator { class GrantleeViewFormatter; class AKREGATOR_EXPORT DefaultCombinedViewFormatter : public ArticleFormatter { public: explicit DefaultCombinedViewFormatter(const QString &grantleeDirectory, QPaintDevice *device = nullptr); ~DefaultCombinedViewFormatter() override; - QString formatArticles(const QVector
&articles, IconOption option) const override; + Q_REQUIRED_RESULT QString formatArticles(const QVector
&articles, IconOption option) const override; - QString formatSummary(TreeNode *node) const override; + Q_REQUIRED_RESULT QString formatSummary(TreeNode *node) const override; private: DefaultCombinedViewFormatter(); GrantleeViewFormatter *mGrantleeViewFormatter = nullptr; }; } #endif // DEFAULTCOMBINEDVIEWFORMATTER_H diff --git a/src/formatter/defaultnormalviewformatter.h b/src/formatter/defaultnormalviewformatter.h index af08209b..7abce17b 100644 --- a/src/formatter/defaultnormalviewformatter.h +++ b/src/formatter/defaultnormalviewformatter.h @@ -1,48 +1,48 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DEFAULTNORMALVIEWFORMATTER_H #define DEFAULTNORMALVIEWFORMATTER_H #include "articleformatter.h" #include "akregator_export.h" #include class QPaintDevice; namespace Akregator { class GrantleeViewFormatter; class AKREGATOR_EXPORT DefaultNormalViewFormatter : public ArticleFormatter { public: explicit DefaultNormalViewFormatter(const QString &grantleeDirectory, QPaintDevice *device = nullptr); ~DefaultNormalViewFormatter() override; - QString formatArticles(const QVector
&article, IconOption option) const override; + Q_REQUIRED_RESULT QString formatArticles(const QVector
&article, IconOption option) const override; - QString formatSummary(TreeNode *node) const override; + Q_REQUIRED_RESULT QString formatSummary(TreeNode *node) const override; private: DefaultNormalViewFormatter(); QString m_DefaultThemePath; class SummaryVisitor; SummaryVisitor *m_summaryVisitor = nullptr; GrantleeViewFormatter *mGrantleeViewFormatter = nullptr; }; } #endif // DEFAULTNORMALVIEWFORMATTER_H diff --git a/src/formatter/grantleeutil.h b/src/formatter/grantleeutil.h index 2a724fe1..3b00f58d 100644 --- a/src/formatter/grantleeutil.h +++ b/src/formatter/grantleeutil.h @@ -1,32 +1,32 @@ /* Copyright (C) 2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GRANTLEEUTIL_H #define GRANTLEEUTIL_H #include #include namespace Akregator { class Feed; namespace GrantleeUtil { -QString imageFeed(const Feed *feed); +Q_REQUIRED_RESULT QString imageFeed(const Feed *feed); } } #endif // GRANTLEEUTIL_H diff --git a/src/formatter/grantleeviewformatter.h b/src/formatter/grantleeviewformatter.h index 87a1ab2f..6b034e08 100644 --- a/src/formatter/grantleeviewformatter.h +++ b/src/formatter/grantleeviewformatter.h @@ -1,48 +1,48 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GRANTLEEVIEWFORMATTER_H #define GRANTLEEVIEWFORMATTER_H #include #include "article.h" #include "articleformatter.h" #include namespace Akregator { class Folder; class GrantleeViewFormatter : public GrantleeTheme::GenericFormatter { public: explicit GrantleeViewFormatter(const QString &htmlFileName, const QString &themePath, int deviceDpiY); ~GrantleeViewFormatter(); - QString formatArticles(const QVector
&article, ArticleFormatter::IconOption icon); - QString formatFolder(Akregator::Folder *node); - QString formatFeed(Akregator::Feed *feed); + Q_REQUIRED_RESULT QString formatArticles(const QVector
&article, ArticleFormatter::IconOption icon); + Q_REQUIRED_RESULT QString formatFolder(Akregator::Folder *node); + Q_REQUIRED_RESULT QString formatFeed(Akregator::Feed *feed); private: void addStandardObject(QVariantHash &grantleeObject); int pointsToPixel(int pointSize) const; QString mHtmlArticleFileName; QString mDirectionString; QString mGrantleeThemePath; int mDeviceDpiY; }; } #endif // GRANTLEEVIEWFORMATTER_H diff --git a/src/frame/frame.h b/src/frame/frame.h index c1bdb0c1..7315e10c 100644 --- a/src/frame/frame.h +++ b/src/frame/frame.h @@ -1,150 +1,150 @@ /* This file is part of Akregator. Copyright (C) 2004 Sashmit Bhaduri 2005 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_FRAME_H #define AKREGATOR_FRAME_H #include #include #include #include #include "akregator_export.h" class QUrl; namespace KPIM { class ProgressItem; } namespace Akregator { class OpenUrlRequest; class AKREGATOR_EXPORT Frame : public QWidget { Q_OBJECT public: explicit Frame(QWidget *parent = nullptr); ~Frame() override; enum State { Idle, Started, Completed, Canceled }; virtual qreal zoomFactor() const = 0; /** * Returns whether the frame can be removed from * Akregator (via detach or close tab etc.) Usually * all tabs but the main tab can be removed. * Default is @c true */ bool isRemovable() const; /** * returns the URL of the embedded part */ virtual QUrl url() const = 0; - QString title() const; - QString caption() const; - State state() const; - int progress() const; - QString statusText() const; - QIcon icon() const; + Q_REQUIRED_RESULT QString title() const; + Q_REQUIRED_RESULT QString caption() const; + Q_REQUIRED_RESULT State state() const; + Q_REQUIRED_RESULT int progress() const; + Q_REQUIRED_RESULT QString statusText() const; + Q_REQUIRED_RESULT QIcon icon() const; void setIcon(const QIcon &icon); - int id() const; + Q_REQUIRED_RESULT int id() const; /** * returns whether the embedded part is loading a website. If so, it can be stopped using slotStop() */ virtual bool isLoading() const; virtual bool openUrl(const OpenUrlRequest &request) = 0; /** * Load a frame from a config file for session management. */ virtual void loadConfig(const KConfigGroup & /*config*/, const QString & /*prefix*/) { } /** * Save a frame to a config file for session management. */ virtual bool saveConfig(KConfigGroup & /*config*/, const QString & /*prefix*/) { return false; } public Q_SLOTS: /** reloads the current content, if possible. See also isReloadable(). */ virtual void slotReload() { } virtual void slotStop(); void slotSetStarted(); void slotSetCanceled(const QString &); void slotSetCompleted(); void slotSetState(State); void slotSetProgress(int); void slotSetCaption(const QString &); void slotSetTitle(const QString &); void slotSetStatusText(const QString &); Q_SIGNALS: void signalCaptionChanged(Akregator::Frame *, const QString &); void signalTitleChanged(Akregator::Frame *, const QString &); void signalStarted(Akregator::Frame *); void signalCanceled(Akregator::Frame *, const QString &); void signalCompleted(Akregator::Frame *); void signalLoadingProgress(Akregator::Frame *, int); void signalStatusText(Akregator::Frame *, const QString &); void signalOpenUrlRequest(Akregator::OpenUrlRequest &request); void showStatusBarMessage(const QString &msg); protected: void setRemovable(bool removable); protected: QIcon m_icon; QString m_title; QString m_caption; State m_state; int m_progress; QString m_statusText; QString m_progressId; KPIM::ProgressItem *m_progressItem = nullptr; bool m_isRemovable = false; bool m_loading = false; int m_id; static int m_idCounter; }; } // namespace Akregator #endif // AKREGATOR_FRAME_H diff --git a/src/frame/mainframe.h b/src/frame/mainframe.h index 4a94d364..8ed2b0a8 100644 --- a/src/frame/mainframe.h +++ b/src/frame/mainframe.h @@ -1,64 +1,64 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MAINFRAME_H #define MAINFRAME_H #include "frame.h" namespace Akregator { class ArticleViewerWidget; class AKREGATOR_EXPORT MainFrame : public Frame { Q_OBJECT public: explicit MainFrame(QWidget *parent, QWidget *widget); ~MainFrame() override; - QUrl url() const override; + Q_REQUIRED_RESULT QUrl url() const override; bool openUrl(const OpenUrlRequest &) override { return false; } void setArticleViewer(Akregator::ArticleViewerWidget *articleViewer); - qreal zoomFactor() const override; + Q_REQUIRED_RESULT qreal zoomFactor() const override; public Q_SLOTS: void slotCopyLinkAsInFrame(int frameId); void slotSaveLinkAsInFrame(int frameId); void slotZoomChangeInFrame(int frameId, qreal value); void slotCopyInFrame(int frameId); void slotPrintInFrame(int frameId); void slotPrintPreviewInFrame(int frameId); void slotTextToSpeechInFrame(int frameId); void slotFindTextInFrame(int frameId); void slotCopyImageLocationInFrame(int frameId); void slotSaveImageOnDiskInFrame(int frameId); void slotMute(int frameId, bool mute); private: Akregator::ArticleViewerWidget *mArticleViewer = nullptr; }; } // namespace Akregator #endif // MAINFRAME_H diff --git a/src/frame/webengine/webengineframe.h b/src/frame/webengine/webengineframe.h index 3982fbc7..89ba9b49 100644 --- a/src/frame/webengine/webengineframe.h +++ b/src/frame/webengine/webengineframe.h @@ -1,74 +1,74 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef WEBENGINEFRAME_H #define WEBENGINEFRAME_H #include "frame.h" #include "akregatorpart_export.h" namespace Akregator { class ArticleViewerWebEngineWidgetNg; class AKREGATORPART_EXPORT WebEngineFrame : public Frame { Q_OBJECT public: explicit WebEngineFrame(KActionCollection *ac, QWidget *parent = nullptr); ~WebEngineFrame() override; QUrl url() const override; bool openUrl(const OpenUrlRequest &request) override; void loadConfig(const KConfigGroup &, const QString &) override; bool saveConfig(KConfigGroup &, const QString &) override; - qreal zoomFactor() const override; + Q_REQUIRED_RESULT qreal zoomFactor() const override; public Q_SLOTS: void slotReload() override; void slotStop() override; void slotZoomChangeInFrame(int frameId, qreal value); void slotCopyInFrame(int frameId); void slotPrintInFrame(int frameId); void slotPrintPreviewInFrame(int frameId); void slotFindTextInFrame(int frameId); void slotTextToSpeechInFrame(int frameId); void slotSaveLinkAsInFrame(int frameId); void slotCopyLinkAsInFrame(int frameId); void slotSaveImageOnDiskInFrame(int frameId); void slotCopyImageLocationInFrame(int frameId); void slotMute(int frameId, bool mute); Q_SIGNALS: void signalIconChanged(Akregator::Frame *, const QIcon &icon); void webPageMutedOrAudibleChanged(Akregator::Frame *, bool isAudioMuted, bool wasRecentlyAudible); private Q_SLOTS: void slotTitleChanged(const QString &title); void slotProgressChanged(int progress); void slotLoadStarted(); void slotLoadFinished(); void slotWebPageMutedOrAudibleChanged(bool isAudioMuted, bool wasRecentlyAudible); private: void loadUrl(const QUrl &url); Akregator::ArticleViewerWebEngineWidgetNg *mArticleViewerWidgetNg = nullptr; }; } #endif diff --git a/src/mainwidget.h b/src/mainwidget.h index dc942c33..cc0e7918 100644 --- a/src/mainwidget.h +++ b/src/mainwidget.h @@ -1,300 +1,300 @@ /* This file is part of Akregator. Copyright (C) 2004 Stanislav Karchebny 2004 Sashmit Bhaduri 2005 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_MAINWIDGET_H #define AKREGATOR_MAINWIDGET_H #include "akregatorpart_export.h" #include "articleviewer-ng/webengine/articleviewerwebenginewidgetng.h" #include "feed.h" #include #include #include #include class KConfig; class KConfigGroup; class QDomDocument; class QSplitter; namespace Akregator { class WebEngineFrame; class AbstractSelectionController; class ActionManagerImpl; class ArticleListView; class ArticleViewerWidget; class Folder; class FeedList; class FeedListManagementImpl; class Frame; class Part; class SearchBar; class SubscriptionListView; class TabWidget; class MainFrame; class DownloadArticleJob; /** * This is the main widget of the view, containing tree view, article list, viewer etc. */ class AKREGATORPART_EXPORT MainWidget : public QWidget { Q_OBJECT public: /** constructor @param part the Akregator::Part which contains this widget @param parent parent widget @param actionManager Akregator specific implementation of ActionManager @param name the name of the widget (@ref QWidget ) */ MainWidget(Akregator::Part *part, QWidget *parent, ActionManagerImpl *actionManager, const QString &name); /** destructor. Note that cleanups should be done in slotOnShutdown(), so we don't risk accessing self-deleting objects after deletion. */ ~MainWidget(); /** saves settings. Make sure that the Settings singleton is not destroyed yet when saveSettings is called */ void saveSettings(); /** Adds the feeds in @c doc to the "Imported Folder" @param doc the DOM tree (OPML) of the feeds to import */ void importFeedList(const QDomDocument &doc); /** * @return the displayed Feed List in OPML format */ - QDomDocument feedListToOPML(); + Q_REQUIRED_RESULT QDomDocument feedListToOPML(); void setFeedList(const QSharedPointer &feedList); /** * Add a feed to a group. * @param url The URL of the feed to add. * @param group The name of the folder into which the feed is added. * If the group does not exist, it is created. * The feed is added as the last member of the group. */ void addFeedToGroup(const QString &url, const QString &group); QSharedPointer allFeedsList() { return m_feedList; } /** session management **/ void readProperties(const KConfigGroup &config); void saveProperties(KConfigGroup &config); //Returns true if networking is available bool isNetworkAvailable() const; enum ViewMode { NormalView = 0, WidescreenView, CombinedView }; ViewMode viewMode() const { return m_viewMode; } void currentArticleInfo(QString &link, QString &title); void updateQuickSearchLineText(); Q_SIGNALS: /** emitted when the unread count of "All Feeds" was changed */ void signalUnreadCountChanged(int); /** emitted when the articles selected changed */ void signalArticlesSelected(const QVector &); public Q_SLOTS: /** opens the current article (currentItem) in external browser TODO: use selected instead of current? */ void slotOpenSelectedArticlesInBrowser(); /** opens current article in new tab, background/foreground depends on settings TODO: use selected instead of current? */ void slotOpenSelectedArticles(); void slotOpenSelectedArticlesInBackground(); void slotOnShutdown(); /** selected tree node has changed */ void slotNodeSelected(Akregator::TreeNode *node); /** the article selection has changed */ void slotArticleSelected(const Akregator::Article &); void ensureArticleTabVisible(); /** emits @ref signalUnreadCountChanged(int) */ void slotSetTotalUnread(); /** copies the link of current article to clipboard */ void slotCopyLinkAddress(); void slotRequestNewFrame(int &frameId); /** adds a new feed to the feed tree */ void slotFeedAdd(); /** adds a feed group to the feed tree */ void slotFeedAddGroup(); /** removes the currently selected feed (ask for confirmation)*/ void slotFeedRemove(); /** calls the properties dialog for feeds, starts renaming for feed groups */ void slotFeedModify(); /** fetches the currently selected feed */ void slotFetchCurrentFeed(); /** starts fetching of all feeds in the tree */ void slotFetchAllFeeds(); /** marks all articles in the currently selected feed as read */ void slotMarkAllRead(); /** marks all articles in all feeds in the tree as read */ void slotMarkAllFeedsRead(); /** opens the homepage of the currently selected feed */ void slotOpenHomepage(); /** reloads all open tabs */ void slotReloadAllTabs(); /** toggles the keep flag of the currently selected article */ void slotArticleToggleKeepFlag(bool enabled); /** deletes the currently selected article */ void slotArticleDelete(); /** marks the currently selected article as read */ void slotSetSelectedArticleRead(); /** marks the currently selected article as unread */ void slotSetSelectedArticleUnread(); /** marks the currently selected article as new */ void slotSetSelectedArticleNew(); /** marks the currently selected article as read after a user-set delay */ void slotSetCurrentArticleReadDelayed(); /** switches view mode to normal view */ void slotNormalView(); /** switches view mode to widescreen view */ void slotWidescreenView(); /** switches view mode to combined view */ void slotCombinedView(); /** toggles the visibility of the filter bar */ void slotToggleShowQuickFilter(); /** selects the previous unread article in the article list */ void slotPrevUnreadArticle(); /** selects the next unread article in the article list */ void slotNextUnreadArticle(); void slotMoveCurrentNodeUp(); void slotMoveCurrentNodeDown(); void slotMoveCurrentNodeLeft(); void slotMoveCurrentNodeRight(); void slotSendLink(); void slotSendFile(); void slotNetworkStatusChanged(bool status); void slotFocusQuickSearch(); protected: void sendArticle(bool attach = false); void addFeed(const QString &url, TreeNode *after, Folder *parent, bool autoExec = true); protected Q_SLOTS: /** special behaviour in article list view (TODO: move code there?) */ void slotMouseButtonPressed(int button, const QUrl &); /** opens the link of an article in the external browser */ void slotOpenArticleInBrowser(const Akregator::Article &article); void slotDoIntervalFetches(); void slotDeleteExpiredArticles(); void slotFetchingStarted(); void slotFetchingStopped(); void slotFramesChanged(); private Q_SLOTS: void slotShowStatusBarMessage(const QString &msg); void slotCurrentFrameChanged(int frameId); void slotArticleAction(Akregator::ArticleViewerWebEngine::ArticleAction type, const QString &articleId, const QString &feed); void slotSettingsChanged(); private: void slotSetFocusToViewer(); void sendArticle(const QByteArray &text, const QString &title, bool attach); void deleteExpiredArticles(const QSharedPointer &feedList); void connectFrame(Akregator::WebEngineFrame *frame); void cleanUpDownloadFile(); /** opens current article in new tab, background/foreground depends on settings TODO: use selected instead of current? */ void openSelectedArticles(bool openInBackground); AbstractSelectionController *m_selectionController; QSharedPointer m_feedList; SubscriptionListView *m_feedListView = nullptr; ArticleListView *m_articleListView = nullptr; ArticleViewerWidget *m_articleViewer = nullptr; TabWidget *m_tabWidget = nullptr; QWidget *m_mainTab = nullptr; MainFrame *m_mainFrame = nullptr; SearchBar *m_searchBar = nullptr; QSplitter *m_articleSplitter = nullptr; QSplitter *m_horizontalSplitter = nullptr; Akregator::Part *m_part = nullptr; ViewMode m_viewMode; QTimer *m_fetchTimer = nullptr; QTimer *m_expiryTimer = nullptr; QTimer *m_markReadTimer = nullptr; bool m_shuttingDown = false; bool m_displayingAboutPage = false; ActionManagerImpl *m_actionManager = nullptr; FeedListManagementImpl *const m_feedListManagementInterface = nullptr; QWidget *m_articleWidget = nullptr; QList > mListDownloadArticleJobs; }; } // namespace Akregator #endif // AKREGATOR_MAINWIDGET_H diff --git a/src/openurlrequest.h b/src/openurlrequest.h index 2c8d94c4..1e07077f 100644 --- a/src/openurlrequest.h +++ b/src/openurlrequest.h @@ -1,88 +1,88 @@ /* This file is part of Akregator. Copyright (C) 2006 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_OPENURLREQUEST_H #define AKREGATOR_OPENURLREQUEST_H #include #include #include "akregator_export.h" namespace Akregator { class AKREGATOR_EXPORT OpenUrlRequest { public: /** * Akregator-specific options specifying how a link should be handled. * TODO: check what can be done by overriding KURLArgs flags. */ enum Options { None = 0, /**< no explicit options, use default */ NewTab, /**< open in new tab */ ExternalBrowser /**< open in external browser */ }; explicit OpenUrlRequest(const QUrl &url = QUrl()); /** * the Id of the frame that sent the request */ int frameId() const; void setFrameId(int frameId); - QUrl url() const; + Q_REQUIRED_RESULT QUrl url() const; void setUrl(const QUrl &url); - KParts::OpenUrlArguments args() const; + Q_REQUIRED_RESULT KParts::OpenUrlArguments args() const; void setArgs(const KParts::OpenUrlArguments &args); - KParts::BrowserArguments browserArgs() const; + Q_REQUIRED_RESULT KParts::BrowserArguments browserArgs() const; void setBrowserArgs(const KParts::BrowserArguments &args); - Options options() const; + Q_REQUIRED_RESULT Options options() const; void setOptions(Options options); - bool openInBackground() const; + Q_REQUIRED_RESULT bool openInBackground() const; void setOpenInBackground(bool background); - QString debugInfo() const; + Q_REQUIRED_RESULT QString debugInfo() const; - bool wasHandled() const; + Q_REQUIRED_RESULT bool wasHandled() const; void setWasHandled(bool handled); private: int m_frameId = -1; QUrl m_url; KParts::OpenUrlArguments m_args; KParts::BrowserArguments m_browserArgs; Options m_options; bool m_inBackground = false; bool m_wasHandled = false; }; } // namespace Akregator #endif // AKREGATOR_OPENURLREQUEST_H diff --git a/src/subscription/subscriptionlistdelegate.h b/src/subscription/subscriptionlistdelegate.h index 3262f2a7..a21c1a3b 100644 --- a/src/subscription/subscriptionlistdelegate.h +++ b/src/subscription/subscriptionlistdelegate.h @@ -1,53 +1,53 @@ /* This file is part of Akregator. Copyright (C) 2007 Frank Osterfeld Copyright (C) 2009 Jonathan Marten This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_SUBSCRIPTIONLISTDELEGATE_H #define AKREGATOR_SUBSCRIPTIONLISTDELEGATE_H #include namespace Akregator { class SubscriptionListDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit SubscriptionListDelegate(QWidget *parent = nullptr); ~SubscriptionListDelegate() override; protected: - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; + Q_REQUIRED_RESULT QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override; private: void recalculateRowHeight(); int m_viewIconHeight = 0; }; } #endif // AKREGATOR_SUBSCRIPTIONLISTDELEGATE_H diff --git a/src/subscription/subscriptionlistmodel.h b/src/subscription/subscriptionlistmodel.h index a3290aa6..200922f8 100644 --- a/src/subscription/subscriptionlistmodel.h +++ b/src/subscription/subscriptionlistmodel.h @@ -1,168 +1,168 @@ /* This file is part of Akregator. Copyright (C) 2007 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_SUBSCRIPTIONLISTMODEL_H #define AKREGATOR_SUBSCRIPTIONLISTMODEL_H #include "akregatorpart_export.h" #include #include #include #include namespace Akregator { class Feed; class FeedList; class Folder; class TreeNode; /** * Filters feeds with unread counts. */ class FilterUnreadProxyModel : public QSortFilterProxyModel { Q_OBJECT public: explicit FilterUnreadProxyModel(QObject *parent = nullptr); - bool doFilter() const; + Q_REQUIRED_RESULT bool doFilter() const; void setDoFilter(bool v); void setSourceModel(QAbstractItemModel *src) override; public Q_SLOTS: void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); void clearCache(); private: - bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; + Q_REQUIRED_RESULT bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; typedef QSet SelectionHierarchy; bool m_doFilter; SelectionHierarchy m_selectedHierarchy; }; class AKREGATORPART_EXPORT SubscriptionListModel : public QAbstractItemModel { Q_OBJECT public: enum Role { SubscriptionIdRole = Qt::UserRole, IsFetchableRole, IsGroupRole, IsAggregationRole, LinkRole, IdRole, IsOpenRole, HasUnreadRole }; enum Column { TitleColumn = 0, UnreadCountColumn = 1, TotalCountColumn = 2, ColumnCount = 3 }; explicit SubscriptionListModel(const QSharedPointer &feedList, QObject *parent = nullptr); int columnCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex &index) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Qt::ItemFlags flags(const QModelIndex &index) const override; QStringList mimeTypes() const override; QMimeData *mimeData(const QModelIndexList &indexes) const override; bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; bool setData(const QModelIndex &idx, const QVariant &value, int role = Qt::EditRole) override; private: QModelIndex indexForNode(const TreeNode *node) const; private Q_SLOTS: void subscriptionAdded(Akregator::TreeNode *); void aboutToRemoveSubscription(Akregator::TreeNode *); void subscriptionRemoved(Akregator::TreeNode *); void subscriptionChanged(Akregator::TreeNode *); void fetchStarted(Akregator::Feed *); void fetched(Akregator::Feed *); void fetchError(Akregator::Feed *); void fetchAborted(Akregator::Feed *); private: QSharedPointer m_feedList; bool m_beganRemoval; }; } namespace Akregator { class AKREGATORPART_EXPORT FolderExpansionHandler : public QObject { Q_OBJECT public: explicit FolderExpansionHandler(QObject *parent = nullptr); void setFeedList(const QSharedPointer &feedList); void setModel(QAbstractItemModel *model); public Q_SLOTS: void itemExpanded(const QModelIndex &index); void itemCollapsed(const QModelIndex &index); private: void setExpanded(const QModelIndex &index, bool expanded); private: QSharedPointer m_feedList; QAbstractItemModel *m_model = nullptr; }; } // namespace Akregator #endif // AKREGATOR_SUBSCRIPTIONLISTMODEL_H diff --git a/src/treenode.h b/src/treenode.h index 07b3ac19..abfef3f9 100644 --- a/src/treenode.h +++ b/src/treenode.h @@ -1,240 +1,240 @@ /* This file is part of Akregator. Copyright (C) 2004 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_TREENODE_H #define AKREGATOR_TREENODE_H #include "akregator_export.h" #include #include #include class KJob; class QDomDocument; class QDomElement; class QIcon; class QString; template class QList; namespace Akregator { class ArticleListJob; class TreeNodeVisitor; class Article; class Feed; class Folder; class FetchQueue; /** \brief Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search folders later). TODO: detailed description goes here */ class AKREGATOR_EXPORT TreeNode : public QObject { friend class ::Akregator::ArticleListJob; friend class ::Akregator::Folder; Q_OBJECT public: /** Standard constructor */ TreeNode(); /** Standard destructor */ ~TreeNode() override; virtual bool accept(TreeNodeVisitor *visitor) = 0; /** The unread count, returns the number of new/unread articles in the node (for groups: the accumulated count of the subtree) @return number of new/unread articles */ virtual int unread() const = 0; /** returns the number of total articles in the node (for groups: the accumulated count of the subtree) @return number of articles */ virtual int totalCount() const = 0; /** Get title of node. @return the title of the node */ - QString title() const; + Q_REQUIRED_RESULT QString title() const; /** Sets the title of the node. @c title should not contain entities. @param title the title string */ void setTitle(const QString &title); /** Get the next sibling. @return the next sibling, 0 if there is none */ virtual const TreeNode *nextSibling() const; virtual TreeNode *nextSibling(); /** Get the previous sibling. @return the previous sibling, 0 if there is none */ virtual const TreeNode *prevSibling() const; virtual TreeNode *prevSibling(); /** Returns the parent node. @return the parent feed group, 0 if there is none */ virtual const Folder *parent() const; virtual Folder *parent(); /** returns the (direct) children of this node. @return a list of pointers to the child nodes */ virtual QList children() const; virtual QList children(); virtual QVector feeds() const = 0; virtual QVector feeds() = 0; virtual QVector folders() const = 0; virtual QVector folders() = 0; virtual TreeNode *childAt(int pos); virtual const TreeNode *childAt(int pos) const; /** Sets parent node; Don't call this directly, is done automatically by insertChild-methods in @ref Folder. */ virtual void setParent(Folder *parent); virtual QIcon icon() const = 0; ArticleListJob *createListJob(); /** Helps the rest of the app to decide if node should be handled as group or not. Only use where necessary, use polymorphism where possible. @return whether the node is a feed group or not */ virtual bool isGroup() const = 0; /** returns if the node represents an aggregation, i.e. containing * items from more than once source feed. Folders and virtual folders * are aggregations, feeds are not. */ virtual bool isAggregation() const = 0; /** exports node and child nodes to OPML (with akregator settings) @param parent the dom element the child node will be attached to @param document the opml document */ virtual QDomElement toOPML(QDomElement parent, QDomDocument document) const = 0; /** @param doNotify notification on changes on/off flag */ virtual void setNotificationMode(bool doNotify); /** returns the next node in the tree. Calling next() unless it returns 0 iterates through the tree in pre-order */ virtual const TreeNode *next() const = 0; virtual TreeNode *next() = 0; /** returns the ID of this node. IDs are managed by FeedList objects and must be unique within the list. Some IDs have a special meaning: @c 0 is the default value and indicates that no ID was set @c 1 is reserved for the "All Feeds" root node */ virtual uint id() const; /** sets the ID */ virtual void setId(uint id); QPoint listViewScrollBarPositions() const; void setListViewScrollBarPositions(const QPoint &pos); virtual KJob *createMarkAsReadJob() = 0; public Q_SLOTS: /** adds node to a fetch queue @param queue pointer to the queue @param intervalFetchesOnly determines whether to allow only interval fetches */ virtual void slotAddToFetchQueue(Akregator::FetchQueue *queue, bool intervalFetchesOnly = false) = 0; Q_SIGNALS: /** Emitted when this object is deleted. */ void signalDestroyed(Akregator::TreeNode *); /** Notification mechanism: emitted, when the node was modified and notification is enabled. A node change is renamed title, icon, unread count. Added, updated or removed articles are not notified via this signal */ void signalChanged(Akregator::TreeNode *); /** emitted when new articles were added to this node or any node in the subtree (for folders). Note that this has nothing to do with fetching, the article might have been moved from somewhere else in the tree into this subtree, e.g. by moving the feed the article is in. @param TreeNode* the node articles were added to @param guids the guids of the articles added */ void signalArticlesAdded(Akregator::TreeNode *, const QVector &guids); /** emitted when articles were updated */ void signalArticlesUpdated(Akregator::TreeNode *, const QVector &guids); /** emitted when articles were removed from this subtree. Note that this has nothing to do with actual article deletion! The article might have moved somewhere else in the tree, e.g. if the user moved the feed */ void signalArticlesRemoved(Akregator::TreeNode *, const QVector &guids); protected: /** call this if you modified the actual node (title, unread count). Call this only when the _actual_ _node_ has changed, i.e. title, unread count. Don't use for article changes! Will do notification immediately or cache it, depending on @c m_doNotify. */ virtual void nodeModified(); /** call this if the articles in the node were changed. Sends signalArticlesAdded/Updated/Removed signals Will do notification immediately or cache it, depending on @c m_doNotify. */ virtual void articlesModified(); /** reimplement this in subclasses to do the actual notification called by articlesModified */ virtual void doArticleNotification(); void emitSignalDestroyed(); private: /** Returns a sequence of the articles this node contains. For feed groups, this returns a concatenated list of all articles in the sub tree. @return sequence of articles */ virtual QVector
articles() = 0; private: bool m_doNotify = true; bool m_nodeChangeOccurred = false; bool m_articleChangeOccurred = false; QString m_title; Folder *m_parent = nullptr; QPoint m_scrollBarPositions; uint m_id = 0; bool m_signalDestroyedEmitted = false; }; } // namespace Akregator #endif // AKREGATOR_TREENODE_H diff --git a/src/urlhandler/webengine/urlhandlerwebengine.h b/src/urlhandler/webengine/urlhandlerwebengine.h index 274ac185..b7d0dfe2 100644 --- a/src/urlhandler/webengine/urlhandlerwebengine.h +++ b/src/urlhandler/webengine/urlhandlerwebengine.h @@ -1,113 +1,113 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef URLHANDLERWebEngine_H #define URLHANDLERWebEngine_H #include #include #include namespace Akregator { class ArticleViewerWebEngine; class URLHandlerWebEngine { public: virtual ~URLHandlerWebEngine() { } /** * Called when LMB-clicking on a link in the reader. Should start * processing equivalent to "opening" the link. * * @return true if the click was handled by this URLHandlerWebEngine, * false otherwise. */ virtual bool handleClick(const QUrl &url, ArticleViewerWebEngine *w) const = 0; /** * Called when RMB-clicking on a link in the reader. Should show * a context menu at the specified point with the specified * widget as parent. * * @return true if the right-click was handled by this * URLHandlerWebEngine, false otherwise. */ virtual bool handleContextMenuRequest(const QUrl &url, const QPoint &p, ArticleViewerWebEngine *w) const = 0; /** * Called when hovering over a link. * * @return a string to be shown in the status bar while hoverin * over this link. */ virtual QString statusBarMessage(const QUrl &url, ArticleViewerWebEngine *w) const = 0; }; class AkregatorConfigHandler : public URLHandlerWebEngine { public: AkregatorConfigHandler() : URLHandlerWebEngine() { } ~AkregatorConfigHandler() override { } - bool handleClick(const QUrl &, ArticleViewerWebEngine *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ArticleViewerWebEngine *) const override; - QString statusBarMessage(const QUrl &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ArticleViewerWebEngine *) const override; }; class MailToURLHandlerWebEngine : public URLHandlerWebEngine { public: MailToURLHandlerWebEngine() : URLHandlerWebEngine() { } ~MailToURLHandlerWebEngine() override { } - bool handleClick(const QUrl &, ArticleViewerWebEngine *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ArticleViewerWebEngine *) const override; - QString statusBarMessage(const QUrl &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ArticleViewerWebEngine *) const override; }; class ActionURLHandlerWebEngine : public URLHandlerWebEngine { public: ActionURLHandlerWebEngine() : URLHandlerWebEngine() { } ~ActionURLHandlerWebEngine() override { } - bool handleClick(const QUrl &, ArticleViewerWebEngine *) const override; - bool handleContextMenuRequest(const QUrl &, const QPoint &, ArticleViewerWebEngine *) const override; - QString statusBarMessage(const QUrl &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT bool handleClick(const QUrl &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &, const QPoint &, ArticleViewerWebEngine *) const override; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &, ArticleViewerWebEngine *) const override; }; } #endif // URLHANDLERWebEngine_H diff --git a/src/urlhandler/webengine/urlhandlerwebenginemanager.h b/src/urlhandler/webengine/urlhandlerwebenginemanager.h index dc035a01..4ac32499 100644 --- a/src/urlhandler/webengine/urlhandlerwebenginemanager.h +++ b/src/urlhandler/webengine/urlhandlerwebenginemanager.h @@ -1,52 +1,52 @@ /* Copyright (C) 2016-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef URLHANDLERWebEngineMANAGER_H #define URLHANDLERWebEngineMANAGER_H #include #include #include "akregator_export.h" namespace Akregator { class URLHandlerWebEngine; class ArticleViewerWebEngine; class AKREGATOR_EXPORT URLHandlerWebEngineManager : public QObject { Q_OBJECT public: ~URLHandlerWebEngineManager(); static URLHandlerWebEngineManager *instance(); void registerHandler(const URLHandlerWebEngine *handler); void unregisterHandler(const URLHandlerWebEngine *handler); - bool handleClick(const QUrl &url, ArticleViewerWebEngine *w = nullptr) const; - bool handleContextMenuRequest(const QUrl &url, const QPoint &p, ArticleViewerWebEngine *w = nullptr) const; - QString statusBarMessage(const QUrl &url, ArticleViewerWebEngine *w = nullptr) const; + Q_REQUIRED_RESULT bool handleClick(const QUrl &url, ArticleViewerWebEngine *w = nullptr) const; + Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &url, const QPoint &p, ArticleViewerWebEngine *w = nullptr) const; + Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &url, ArticleViewerWebEngine *w = nullptr) const; private: explicit URLHandlerWebEngineManager(QObject *parent = nullptr); static URLHandlerWebEngineManager *self; typedef QVector HandlerList; HandlerList mHandlers; }; } #endif // URLHANDLERWebEngineMANAGER_H diff --git a/src/utils/filtercolumnsproxymodel.h b/src/utils/filtercolumnsproxymodel.h index 9517fb77..0438eb40 100644 --- a/src/utils/filtercolumnsproxymodel.h +++ b/src/utils/filtercolumnsproxymodel.h @@ -1,58 +1,58 @@ /* This file is part of Akregator. Copyright (C) 2008 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_FILTERCOLUMNSPROXYMODEL_H #define AKREGATOR_FILTERCOLUMNSPROXYMODEL_H #include #include namespace Akregator { class FilterColumnsProxyModel : public QSortFilterProxyModel { public: enum Mode { Blacklist, Whitelist }; explicit FilterColumnsProxyModel(QObject *parent = nullptr); void setColumnEnabled(int col, bool enabled = true); - bool isColumnEnabled(int col) const; + Q_REQUIRED_RESULT bool isColumnEnabled(int col) const; - Mode mode() const; + Q_REQUIRED_RESULT Mode mode() const; void setMode(Mode mode); private: - bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override; + Q_REQUIRED_RESULT bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override; private: QVector m_columnStates; int m_vecSize = 0; Mode m_mode = Whitelist; }; } // namespace Akregator #endif // AKREGATOR_FILTERCOLUMNSPROXYMODEL_H diff --git a/src/widgets/searchbar.h b/src/widgets/searchbar.h index d86b51ff..f5384a3f 100644 --- a/src/widgets/searchbar.h +++ b/src/widgets/searchbar.h @@ -1,85 +1,85 @@ /* This file is part of Akregator. Copyright (C) 2005 Frank Osterfeld This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AKREGATOR_SEARCHBAR_H #define AKREGATOR_SEARCHBAR_H #include #include #include #include #include "widgets/statussearchline.h" #include "articlematcher.h" namespace Akregator { namespace Filters { class AbstractMatcher; } class SearchBar : public QWidget { Q_OBJECT public: explicit SearchBar(QWidget *parent = nullptr); ~SearchBar(); Q_REQUIRED_RESULT QString text() const; Q_REQUIRED_RESULT StatusSearchLine::Status status() const; void setDelay(int ms); Q_REQUIRED_RESULT int delay() const; void setFocusSearchLine(); - std::vector > matchers() const; + Q_REQUIRED_RESULT std::vector > matchers() const; void updateQuickSearchLineText(const QString &searchLine); Q_SIGNALS: /** emitted when the text and status filters were updated. Params are textfilter, statusfilter */ void signalSearch(const std::vector > &); void forceLostFocus(); public Q_SLOTS: void slotClearSearch(); void slotSetStatus(int status); void slotSetText(const QString &text); private Q_SLOTS: void slotSearchStringChanged(const QString &search); void slotStopActiveSearch(); void slotActivateSearch(); void slotStatusChanged(Akregator::StatusSearchLine::Status); private: void triggerTimer(); QString m_searchText; QTimer m_timer; StatusSearchLine *m_searchLine = nullptr; int m_delay; std::vector > m_matchers; }; } // namespace Akregator #endif //AKREGATOR_SEARCHBAR_H