Commit ae53c52c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify pointer + use Q_REQUIRED_RESULT

parent 9c5aca0f
Pipeline #194352 passed with stage
in 1 minute and 27 seconds
......@@ -41,9 +41,18 @@ static QString akregatorNamespace()
return QStringLiteral("http://akregator.kde.org/StorageExporter#");
}
enum TextMode { PlainText, Html };
enum TextMode {
PlainText,
Html,
};
enum Status { Deleted = 0x01, Trash = 0x02, New = 0x04, Read = 0x08, Keep = 0x10 };
enum Status {
Deleted = 0x01,
Trash = 0x02,
New = 0x04,
Read = 0x08,
Keep = 0x10,
};
class Element
{
......
......@@ -12,6 +12,8 @@ using namespace Akregator;
FeedListManagementInterface *FeedListManagementInterface::m_instance = nullptr;
FeedListManagementInterface::~FeedListManagementInterface() = default;
FeedListManagementInterface *FeedListManagementInterface::instance()
{
return m_instance;
......@@ -21,5 +23,3 @@ void FeedListManagementInterface::setInstance(FeedListManagementInterface *iface
{
m_instance = iface;
}
FeedListManagementInterface::~FeedListManagementInterface() = default;
......@@ -56,7 +56,7 @@ public:
void setTrayIcon(TrayIcon *trayIcon);
KActionCollection *actionCollection() const;
WebEngineViewer::ZoomActionMenu *zoomActionMenu() const override;
QString quickSearchLineText() const;
Q_REQUIRED_RESULT QString quickSearchLineText() const;
public Q_SLOTS:
......
......@@ -29,10 +29,10 @@ public:
~ExpireItemsCommand() override;
void setFeedList(const QWeakPointer<FeedList> &feedList);
QWeakPointer<FeedList> feedList() const;
Q_REQUIRED_RESULT QWeakPointer<FeedList> feedList() const;
void setFeeds(const QVector<uint> &feeds);
QVector<uint> feeds() const;
Q_REQUIRED_RESULT QVector<uint> feeds() const;
private:
void doStart() override;
......
......@@ -30,7 +30,11 @@ public:
void setTargetList(const QWeakPointer<FeedList> &feedList);
enum RootFolderOption { None, Auto, Ask };
enum RootFolderOption {
None,
Auto,
Ask,
};
void setImportedRootFolderOption(RootFolderOption opt);
void setImportedRootFolderName(const QString &defaultName);
......
......@@ -24,7 +24,12 @@ public:
explicit FeedPropertiesWidget(QWidget *parent = nullptr, const QString &name = QString());
~FeedPropertiesWidget() override;
enum IntervalStep { Minutes = 0, Hours, Days, Never };
enum IntervalStep {
Minutes = 0,
Hours,
Days,
Never,
};
public Q_SLOTS:
void slotUpdateComboBoxActivated(int index);
......
......@@ -57,7 +57,12 @@ class AKREGATORPART_EXPORT SubscriptionListModel : public QAbstractItemModel
public:
enum Role { SubscriptionIdRole = Qt::UserRole, IsFetchableRole, IsGroupRole, IsAggregationRole, LinkRole, IdRole, IsOpenRole, HasUnreadRole };
enum Column { TitleColumn = 0, UnreadCountColumn = 1, TotalCountColumn = 2, ColumnCount = 3 };
enum Column {
TitleColumn = 0,
UnreadCountColumn = 1,
TotalCountColumn = 2,
ColumnCount = 3,
};
explicit SubscriptionListModel(const QSharedPointer<const FeedList> &feedList, QObject *parent = nullptr);
......
......@@ -35,7 +35,11 @@ public:
{
}
enum Column { TitleColumn = 0, UnreadColumn = 1, TotalColumn = 2 };
enum Column {
TitleColumn = 0,
UnreadColumn = 1,
TotalColumn = 2,
};
public Q_SLOTS:
......
......@@ -16,7 +16,10 @@ namespace Akregator
class FilterColumnsProxyModel : public QSortFilterProxyModel
{
public:
enum Mode { Blacklist, Whitelist };
enum Mode {
Blacklist,
Whitelist,
};
explicit FilterColumnsProxyModel(QObject *parent = nullptr);
......
......@@ -10,4 +10,4 @@
namespace TextUtil
{
Q_REQUIRED_RESULT QString normalize(QStringView str);
};
}
......@@ -16,8 +16,8 @@ using namespace Akregator;
AkregatorCentralWidget::AkregatorCentralWidget(QWidget *parent)
: QStackedWidget(parent)
, mCrashWidget(new CrashWidget(this))
{
mCrashWidget = new CrashWidget(this);
connect(mCrashWidget, &CrashWidget::restoreSession, this, &AkregatorCentralWidget::slotRestoreSession);
addWidget(mCrashWidget);
}
......
......@@ -29,7 +29,7 @@ Q_SIGNALS:
private:
void slotRestoreSession(Akregator::CrashWidget::CrashAction type);
Akregator::CrashWidget *mCrashWidget = nullptr;
Akregator::CrashWidget *const mCrashWidget;
Akregator::MainWidget *mMainWidget = nullptr;
};
}
......@@ -27,6 +27,7 @@ using namespace Akregator::Filters;
SearchBar::SearchBar(QWidget *parent)
: QWidget(parent)
, m_searchLine(new StatusSearchLine(this))
{
m_delay = 400;
auto layout = new QHBoxLayout(this);
......@@ -35,7 +36,6 @@ SearchBar::SearchBar(QWidget *parent)
layout->setSpacing(5);
setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
m_searchLine = new StatusSearchLine(this);
m_searchLine->setClearButtonEnabled(true);
m_searchLine->setPlaceholderText(i18n("Search articles..."));
layout->addWidget(m_searchLine);
......
......@@ -61,7 +61,7 @@ private:
QString m_searchText;
QTimer m_timer;
StatusSearchLine *m_searchLine = nullptr;
StatusSearchLine *const m_searchLine;
int m_delay;
std::vector<QSharedPointer<const Filters::AbstractMatcher>> m_matchers;
};
......
Supports Markdown
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