Commit 5cdac9fc authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent c0aa59e2
Pipeline #33664 passed with stage
in 31 minutes and 57 seconds
......@@ -27,7 +27,7 @@ public:
void save() override;
private:
Akregator::SettingsAdvanced *m_widget = nullptr;
Akregator::SettingsAdvanced *const m_widget;
};
#endif
......@@ -23,7 +23,7 @@ public:
explicit KCMAkregatorAppearanceConfig(QWidget *parent, const QVariantList &args);
private:
QWidget *m_widget = nullptr;
QWidget *const m_widget;
Akregator::Ui::SettingsAppearance m_ui;
};
......
......@@ -30,7 +30,7 @@ public:
void save() override;
private:
QWidget *m_widget = nullptr;
QWidget *const m_widget;
QButtonGroup *m_archiveModeGroup = nullptr;
};
......
......@@ -22,7 +22,7 @@ public:
explicit KCMAkregatorBrowserConfig(QWidget *parent, const QVariantList &args);
private:
QWidget *m_widget = nullptr;
QWidget *const m_widget;
};
#endif // AKREGATOR_CONFIG_BROWSER_H
......@@ -22,7 +22,7 @@ public:
explicit KCMAkregatorGeneralConfig(QWidget *parent, const QVariantList &args);
private:
QWidget *m_widget = nullptr;
QWidget *const m_widget;
};
#endif // AKREGATOR_CONFIG_GENERAL_H
......@@ -134,13 +134,6 @@ static Part *mySelf = nullptr;
Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
: KParts::Part(parent)
, m_standardListLoaded(false)
, m_shuttingDown(false)
, m_doCrashSave(false)
, m_backedUpList(false)
, m_mainWidget(nullptr)
, m_storage(nullptr)
, m_dialog(nullptr)
{
mySelf = this;
......
......@@ -172,13 +172,13 @@ private: // attributes
class ApplyFiltersInterceptor;
ApplyFiltersInterceptor *m_applyFiltersInterceptor = nullptr;
QString m_standardFeedList;
bool m_standardListLoaded;
bool m_shuttingDown;
bool m_doCrashSave;
bool m_standardListLoaded = false;
bool m_shuttingDown = false;
bool m_doCrashSave = false;
QTimer *m_autosaveTimer = nullptr;
/** did we backup the feed list already? */
bool m_backedUpList;
bool m_backedUpList = false;
Akregator::AkregatorCentralWidget *mCentralWidget = nullptr;
QPointer<MainWidget> m_mainWidget;
Backend::Storage *m_storage = nullptr;
......
......@@ -12,7 +12,6 @@ using namespace Akregator;
ArticleHtmlWebEngineWriter::ArticleHtmlWebEngineWriter(ArticleViewerWebEngine *view, QObject *parent)
: QObject(parent)
, mState(Ended)
, mBaseUrl(QStringLiteral("file:///"))
, mWebView(view)
{
......
......@@ -34,11 +34,11 @@ private:
Begun,
Queued,
Ended
} mState;
} mState = Ended;
QString mHtml;
QUrl mBaseUrl;
ArticleViewerWebEngine *mWebView = nullptr;
ArticleViewerWebEngine *const mWebView;
};
}
......
......@@ -66,8 +66,6 @@ public:
ArticleViewerWebEngine::ArticleViewerWebEngine(KActionCollection *ac, QWidget *parent)
: WebEngineViewer::WebEngineView(parent)
, mActionCollection(ac)
, mLastButtonClicked(LeftButton)
, mViewerPluginToolManager(nullptr)
{
mNetworkAccessManager = new WebEngineViewer::InterceptorManager(this, ac, this);
......
......@@ -59,7 +59,7 @@ public:
void execPrintPreviewPage(QPrinter *printer, int timeout);
protected:
QUrl mCurrentUrl;
KActionCollection *mActionCollection = nullptr;
KActionCollection *const mActionCollection;
PimCommon::ShareServiceUrlManager *mShareServiceManager = nullptr;
KIO::KUriFilterSearchProviderActions *mWebShortcutMenuManager = nullptr;
......@@ -121,7 +121,7 @@ protected:
private:
void openSafeUrl(const QUrl &url);
bool urlIsAMalwareButContinue();
MousePressedButtonType mLastButtonClicked;
MousePressedButtonType mLastButtonClicked = LeftButton;
MessageViewer::ViewerPluginToolManager *mViewerPluginToolManager = nullptr;
WebEngineViewer::WebEngineAccessKey *mWebEngineViewAccessKey = nullptr;
};
......
......@@ -45,16 +45,14 @@ InvokeWrapper<Arg, R, C> invoke(R *receiver, void (C::*memberFun)(Arg))
ArticleViewerWebEngineWidgetNg::ArticleViewerWebEngineWidgetNg(ArticleViewerWebEngine *customViewer, KActionCollection *ac, QWidget *parent)
: QWidget(parent)
, mCurrentPrinter(nullptr)
, mArticleViewerNg(customViewer)
{
mArticleViewerNg = customViewer;
initializeLayout(ac);
}
ArticleViewerWebEngineWidgetNg::ArticleViewerWebEngineWidgetNg(KActionCollection *ac, QWidget *parent)
: QWidget(parent)
, mArticleViewerNg(nullptr)
, mCurrentPrinter(nullptr)
{
initializeLayout(ac);
}
......
......@@ -45,7 +45,6 @@ using namespace Akregator::Filters;
ArticleViewerWidget::ArticleViewerWidget(const QString &grantleeDirectory, KActionCollection *ac, QWidget *parent)
: QWidget(parent)
, m_node(nullptr)
, m_viewMode(NormalView)
, m_articleViewerWidgetNg(new Akregator::ArticleViewerWebEngineWidgetNg(ac, this))
, m_grantleeDirectory(grantleeDirectory)
{
......
......@@ -139,12 +139,12 @@ private:
enum ViewMode {
NormalView, CombinedView, SummaryView
};
ViewMode m_viewMode;
ViewMode m_viewMode = NormalView;
Akregator::ArticleHtmlWebEngineWriter *m_articleHtmlWriter = nullptr;
Akregator::ArticleViewerWebEngineWidgetNg *m_articleViewerWidgetNg = nullptr;
Akregator::ArticleViewerWebEngineWidgetNg *const m_articleViewerWidgetNg;
QSharedPointer<ArticleFormatter> m_normalViewFormatter;
QSharedPointer<ArticleFormatter> m_combinedViewFormatter;
QString m_grantleeDirectory;
const QString m_grantleeDirectory;
};
} // namespace Akregator
......
......@@ -60,8 +60,8 @@ public:
Q_REQUIRED_RESULT QString actionToken() const;
private:
Article mArticle;
ArticleFormatter::IconOption mArticleFormatOption;
const Article mArticle;
const ArticleFormatter::IconOption mArticleFormatOption;
};
}
#endif // ARTICLEGRANTLEEOBJECT_H
......@@ -54,7 +54,7 @@ public:
QString text;
private:
DefaultNormalViewFormatter *parent = nullptr;
DefaultNormalViewFormatter *const parent;
};
DefaultNormalViewFormatter::DefaultNormalViewFormatter(const QString &grantleeDirectory, QPaintDevice *device)
......
......@@ -23,11 +23,11 @@ public:
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;
Q_REQUIRED_RESULT int pointsToPixel(int pointSize) const;
const QString mHtmlArticleFileName;
const QString mDirectionString;
const QString mGrantleeThemePath;
const int mDeviceDpiY;
};
}
......
......@@ -14,7 +14,6 @@ using namespace Akregator;
MainFrame::MainFrame(QWidget *parent, QWidget *visibleWidget)
: Frame(parent)
, mArticleViewer(nullptr)
{
setRemovable(false);
QGridLayout *layout = new QGridLayout(this);
......
......@@ -26,7 +26,6 @@ class Application : public KontactInterface::PimUniqueApplication
public:
Application(int &argc, char **argv[])
: KontactInterface::PimUniqueApplication(argc, argv)
, mMainWindow(nullptr)
{
}
......
......@@ -86,7 +86,6 @@ MainWidget::~MainWidget()
MainWidget::MainWidget(Part *part, QWidget *parent, ActionManagerImpl *actionManager, const QString &name)
: QWidget(parent)
, m_feedList()
, m_viewMode(NormalView)
, m_actionManager(actionManager)
, m_feedListManagementInterface(new FeedListManagementImpl)
{
......
......@@ -264,7 +264,7 @@ private:
QSplitter *m_horizontalSplitter = nullptr;
Akregator::Part *m_part = nullptr;
ViewMode m_viewMode;
ViewMode m_viewMode = NormalView;
QTimer *m_fetchTimer = nullptr;
QTimer *m_expiryTimer = nullptr;
......
......@@ -80,7 +80,7 @@ private Q_SLOTS:
private:
QPointer<Akregator::Part> m_part;
KSqueezedTextLabel *m_statusLabel = nullptr;
KSqueezedTextLabel *const m_statusLabel;
};
} // namespace Akregator
......
......@@ -86,7 +86,7 @@ private:
QPointer<QAbstractItemView> m_feedSelector;
Akregator::ArticleLister *m_articleLister = nullptr;
Akregator::SingleArticleDisplay *m_singleDisplay = nullptr;
Akregator::FilterUnreadProxyModel *m_subscriptionModel = nullptr;
Akregator::FilterUnreadProxyModel *const m_subscriptionModel;
QAbstractItemModel *m_currentModel = nullptr;
Akregator::FolderExpansionHandler *m_folderExpansionHandler = nullptr;
Akregator::ArticleModel *m_articleModel = nullptr;
......
......@@ -35,9 +35,9 @@ private Q_SLOTS:
void doMove();
private:
int m_id;
int m_destFolderId;
int m_afterId;
int m_id = 0;
int m_destFolderId = 0;
int m_afterId = -1;
QWeakPointer<FeedList> m_feedList;
};
......
......@@ -68,7 +68,6 @@ static const Akregator::TreeNode *nodeForIndex(const QModelIndex &index, const F
Akregator::FilterUnreadProxyModel::FilterUnreadProxyModel(QObject *parent)
: QSortFilterProxyModel(parent)
, m_doFilter(false)
, m_selectedHierarchy()
{
setDynamicSortFilter(true);
......
......@@ -46,7 +46,7 @@ private:
typedef QSet<QModelIndex> SelectionHierarchy;
bool m_doFilter;
bool m_doFilter = false;
SelectionHierarchy m_selectedHierarchy;
};
......
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