Commit 20b420f6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization + missing Q_REQUIRED_RESULT

parent 0d69e5e6
......@@ -64,7 +64,6 @@ Feed *AddFeedDialog::feed() const
AddFeedDialog::AddFeedDialog(QWidget *parent, const QString &name)
: QDialog(parent)
, m_feed(nullptr)
{
setObjectName(name);
setWindowTitle(i18n("Add Feed"));
......
......@@ -49,7 +49,7 @@ public:
explicit AddFeedDialog(QWidget *parent = nullptr, const QString &name = QString());
~AddFeedDialog() override;
QSize sizeHint() const override;
Q_REQUIRED_RESULT QSize sizeHint() const override;
void setUrl(const QString &t);
Feed *feed() const;
......
......@@ -62,7 +62,7 @@ public:
explicit SortColorizeProxyModel(QObject *parent = nullptr);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
void setFilters(const std::vector<QSharedPointer<const Akregator::Filters::AbstractMatcher> > &);
......@@ -98,7 +98,7 @@ public:
QAbstractItemView *itemView() override;
//impl ArticleLister
QPoint scrollBarPositions() const override;
Q_REQUIRED_RESULT QPoint scrollBarPositions() const override;
//impl ArticleLister
void setScrollBarPositions(const QPoint &p) override;
......
......@@ -69,23 +69,23 @@ public:
explicit ArticleModel(const QVector<Article> &articles, QObject *parent = nullptr);
~ArticleModel() override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
Q_REQUIRED_RESULT int columnCount(const QModelIndex &parent = QModelIndex()) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
Q_REQUIRED_RESULT int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant headerData(int section, Qt::Orientation, int role) const override;
Q_REQUIRED_RESULT QVariant headerData(int section, Qt::Orientation, int role) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
bool rowMatches(int row, const QSharedPointer<const Akregator::Filters::AbstractMatcher> &matcher) const;
Q_REQUIRED_RESULT bool rowMatches(int row, const QSharedPointer<const Akregator::Filters::AbstractMatcher> &matcher) const;
Article article(int row) const;
Q_REQUIRED_RESULT Article article(int row) const;
QStringList mimeTypes() const override;
Q_REQUIRED_RESULT QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
Qt::ItemFlags flags(const QModelIndex &idx) const override;
Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &idx) const override;
public Q_SLOTS:
......
......@@ -70,9 +70,9 @@ public:
* @param node The node to observe */
void showNode(Akregator::TreeNode *node);
QSize sizeHint() const override;
Q_REQUIRED_RESULT QSize sizeHint() const override;
qreal zoomFactor() const;
Q_REQUIRED_RESULT qreal zoomFactor() const;
Akregator::ArticleViewerWebEngineWidgetNg *articleViewerWidgetNg() const;
......
......@@ -611,9 +611,9 @@ void Feed::slotAddToFetchQueue(FetchQueue *queue, bool intervalFetchOnly)
interval = Settings::autoFetchInterval() * 60;
}
uint lastFetch = d->m_archive->lastFetch().toSecsSinceEpoch();
const uint lastFetch = d->m_archive->lastFetch().toSecsSinceEpoch();
uint now = QDateTime::currentDateTimeUtc().toSecsSinceEpoch();
const uint now = QDateTime::currentDateTimeUtc().toSecsSinceEpoch();
if (interval > 0 && (now - lastFetch) >= static_cast<uint>(interval)) {
queue->addFeed(this);
......@@ -710,7 +710,7 @@ bool Feed::usesExpiryByAge() const
bool Feed::isExpired(const Article &a) const
{
QDateTime now = QDateTime::currentDateTime();
const QDateTime now = QDateTime::currentDateTime();
int expiryAge = -1;
// check whether the feed uses the global default and the default is limitArticleAge
if (d->m_archiveMode == globalDefault && Settings::archiveMode() == Settings::EnumArchiveMode::limitArticleAge) {
......
......@@ -61,20 +61,20 @@ public:
/** returns the number of unread articles in all children
@return number of unread articles */
int unread() const override;
Q_REQUIRED_RESULT int unread() const override;
/** returns the number of articles in all children
@return number of articles */
int totalCount() const override;
Q_REQUIRED_RESULT int totalCount() const override;
/** Helps the rest of the app to decide if node should be handled as group or not. */
bool isGroup() const override
Q_REQUIRED_RESULT bool isGroup() const override
{
return true;
}
//impl
bool isAggregation() const override
Q_REQUIRED_RESULT bool isAggregation() const override
{
return true;
}
......@@ -90,19 +90,19 @@ public:
@return a list of pointers to the child nodes
*/
QList<const TreeNode *> children() const override;
Q_REQUIRED_RESULT QList<const TreeNode *> children() const override;
QList<const TreeNode *> namedChildren(const QString &title) const;
QList<TreeNode *> namedChildren(const QString &title);
Q_REQUIRED_RESULT QList<const TreeNode *> namedChildren(const QString &title) const;
Q_REQUIRED_RESULT QList<TreeNode *> namedChildren(const QString &title);
QList<TreeNode *> children() override;
Q_REQUIRED_RESULT QList<TreeNode *> children() override;
QVector<const Feed *> feeds() const override;
QVector<Feed *> feeds() override;
QVector<const Folder *> folders() const override;
QVector<Folder *> folders() override;
Q_REQUIRED_RESULT QVector<const Feed *> feeds() const override;
Q_REQUIRED_RESULT QVector<Feed *> feeds() override;
Q_REQUIRED_RESULT QVector<const Folder *> folders() const override;
Q_REQUIRED_RESULT QVector<Folder *> folders() override;
int indexOf(const TreeNode *node) const;
Q_REQUIRED_RESULT int indexOf(const TreeNode *node) const;
TreeNode *childAt(int pos) override;
......@@ -136,7 +136,7 @@ public:
/** returns whether the feed group is opened or not.
Use only in \ref Folder . */
bool isOpen() const;
Q_REQUIRED_RESULT bool isOpen() const;
/** open/close the feed group (display it as expanded/collapsed in the tree view). Use only in \ref Folder . */
void setOpen(bool open);
......@@ -147,12 +147,12 @@ public:
TreeNode *next() override;
const TreeNode *next() const override;
QIcon icon() const override;
Q_REQUIRED_RESULT QIcon icon() const override;
/* returns whether @p node is among the direct or indirect children of this
* folder
*/
bool subtreeContains(const Akregator::TreeNode *node) const;
Q_REQUIRED_RESULT bool subtreeContains(const Akregator::TreeNode *node) const;
KJob *createMarkAsReadJob() override;
......
......@@ -49,7 +49,7 @@ public:
Backend::Storage *storage();
void setStorage(Backend::Storage *storage);
QSharedPointer<FeedList> feedList() const;
Q_REQUIRED_RESULT QSharedPointer<FeedList> feedList() const;
void setFeedList(const QSharedPointer<FeedList> &feedList);
FetchQueue *fetchQueue() const;
......
......@@ -107,10 +107,6 @@ int main(int argc, char **argv)
AkregratorMigrateApplication migrate;
migrate.migrate();
// start knotifyclient if not already started.
// makes it work for people who doesn't use full kde, according to kmail devels
//KNotifyClient::startDaemon();
// see if we are starting with session management
if (app.isSessionRestored()) {
auto mainWindow = new Akregator::MainWindow();
......
......@@ -103,7 +103,7 @@ public:
*/
void addFeedToGroup(const QString &url, const QString &group);
QSharedPointer<FeedList> allFeedsList()
Q_REQUIRED_RESULT QSharedPointer<FeedList> allFeedsList()
{
return m_feedList;
}
......@@ -113,7 +113,7 @@ public:
void saveProperties(KConfigGroup &config);
//Returns true if networking is available
bool isNetworkAvailable() const;
Q_REQUIRED_RESULT bool isNetworkAvailable() const;
enum ViewMode {
NormalView = 0,
......
......@@ -72,7 +72,7 @@ public:
Loads the part
@return Whether the part has been successfully created or not.
*/
bool loadPart();
Q_REQUIRED_RESULT bool loadPart();
public Q_SLOTS:
void slotClearStatusText();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment