Commit 7e6ff7d7 authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent d1fee71d
Pipeline #39287 passed with stage
in 13 minutes and 54 seconds
...@@ -24,7 +24,7 @@ KCMAkregatorAdvancedConfig::KCMAkregatorAdvancedConfig(QWidget *parent, const QV ...@@ -24,7 +24,7 @@ KCMAkregatorAdvancedConfig::KCMAkregatorAdvancedConfig(QWidget *parent, const QV
: KCModule(parent, args) : KCModule(parent, args)
, m_widget(new SettingsAdvanced(this)) , m_widget(new SettingsAdvanced(this))
{ {
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->addWidget(m_widget); layout->addWidget(m_widget);
KAboutData *about = new KAboutData(QStringLiteral("kcmakradvancedconfig"), KAboutData *about = new KAboutData(QStringLiteral("kcmakradvancedconfig"),
i18n("Advanced Feed Reader Settings"), i18n("Advanced Feed Reader Settings"),
......
...@@ -25,7 +25,7 @@ KCMAkregatorAppearanceConfig::KCMAkregatorAppearanceConfig(QWidget *parent, cons ...@@ -25,7 +25,7 @@ KCMAkregatorAppearanceConfig::KCMAkregatorAppearanceConfig(QWidget *parent, cons
{ {
m_ui.setupUi(m_widget); m_ui.setupUi(m_widget);
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->addWidget(m_widget); layout->addWidget(m_widget);
connect(m_ui.kcfg_UseCustomColors, &QAbstractButton::toggled, m_ui.kcfg_ColorUnreadArticles, &QWidget::setEnabled); connect(m_ui.kcfg_UseCustomColors, &QAbstractButton::toggled, m_ui.kcfg_ColorUnreadArticles, &QWidget::setEnabled);
......
...@@ -25,7 +25,7 @@ KCMAkregatorArchiveConfig::KCMAkregatorArchiveConfig(QWidget *parent, const QVar ...@@ -25,7 +25,7 @@ KCMAkregatorArchiveConfig::KCMAkregatorArchiveConfig(QWidget *parent, const QVar
{ {
Ui::SettingsArchive m_ui; Ui::SettingsArchive m_ui;
m_ui.setupUi(m_widget); m_ui.setupUi(m_widget);
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->addWidget(m_widget); layout->addWidget(m_widget);
connect(m_ui.rb_LimitArticleNumber, &QAbstractButton::toggled, connect(m_ui.rb_LimitArticleNumber, &QAbstractButton::toggled,
......
...@@ -27,7 +27,7 @@ KCMAkregatorBrowserConfig::KCMAkregatorBrowserConfig(QWidget *parent, const QVar ...@@ -27,7 +27,7 @@ KCMAkregatorBrowserConfig::KCMAkregatorBrowserConfig(QWidget *parent, const QVar
Ui::SettingsBrowser ui; Ui::SettingsBrowser ui;
ui.setupUi(m_widget); ui.setupUi(m_widget);
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->addWidget(m_widget); layout->addWidget(m_widget);
connect(ui.kcfg_ExternalBrowserUseCustomCommand, &QAbstractButton::toggled, connect(ui.kcfg_ExternalBrowserUseCustomCommand, &QAbstractButton::toggled,
......
...@@ -28,7 +28,7 @@ KCMAkregatorGeneralConfig::KCMAkregatorGeneralConfig(QWidget *parent, const QVar ...@@ -28,7 +28,7 @@ KCMAkregatorGeneralConfig::KCMAkregatorGeneralConfig(QWidget *parent, const QVar
Ui::SettingsGeneral ui; Ui::SettingsGeneral ui;
ui.setupUi(m_widget); ui.setupUi(m_widget);
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->addWidget(m_widget); layout->addWidget(m_widget);
ui.kcfg_AutoFetchInterval->setSuffix(ki18np(" minute", " minutes")); ui.kcfg_AutoFetchInterval->setSuffix(ki18np(" minute", " minutes"));
......
...@@ -21,7 +21,7 @@ K_PLUGIN_FACTORY(KCMAkregatorPluginsConfigFactory, registerPlugin<KCMAkregatorPl ...@@ -21,7 +21,7 @@ K_PLUGIN_FACTORY(KCMAkregatorPluginsConfigFactory, registerPlugin<KCMAkregatorPl
KCMAkregatorPluginsConfig::KCMAkregatorPluginsConfig(QWidget *parent, const QVariantList &args) KCMAkregatorPluginsConfig::KCMAkregatorPluginsConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args) : KCModule(parent, args)
{ {
QHBoxLayout *lay = new QHBoxLayout(this); auto *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0); lay->setContentsMargins(0, 0, 0, 0);
KAboutData *about = new KAboutData(QStringLiteral("kcmakrpluginsconfig"), KAboutData *about = new KAboutData(QStringLiteral("kcmakrpluginsconfig"),
......
...@@ -22,7 +22,7 @@ K_PLUGIN_FACTORY(KCMAkregatorUserFeedBackConfigFactory, registerPlugin<KCMAkrega ...@@ -22,7 +22,7 @@ K_PLUGIN_FACTORY(KCMAkregatorUserFeedBackConfigFactory, registerPlugin<KCMAkrega
KCMAkregatorUserFeedBackConfig::KCMAkregatorUserFeedBackConfig(QWidget *parent, const QVariantList &args) KCMAkregatorUserFeedBackConfig::KCMAkregatorUserFeedBackConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args) : KCModule(parent, args)
{ {
QHBoxLayout *lay = new QHBoxLayout(this); auto *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0); lay->setContentsMargins(0, 0, 0, 0);
KAboutData *about = new KAboutData(QStringLiteral("kcmaddressbookuserfeedbackconfig"), KAboutData *about = new KAboutData(QStringLiteral("kcmaddressbookuserfeedbackconfig"),
......
...@@ -98,7 +98,7 @@ void AkregatorPlugin::addFeed() ...@@ -98,7 +98,7 @@ void AkregatorPlugin::addFeed()
void AkregatorPlugin::readProperties(const KConfigGroup &config) void AkregatorPlugin::readProperties(const KConfigGroup &config)
{ {
if (part()) { if (part()) {
Akregator::Part *myPart = static_cast<Akregator::Part *>(part()); auto *myPart = static_cast<Akregator::Part *>(part());
myPart->readProperties(config); myPart->readProperties(config);
} }
} }
...@@ -106,7 +106,7 @@ void AkregatorPlugin::readProperties(const KConfigGroup &config) ...@@ -106,7 +106,7 @@ void AkregatorPlugin::readProperties(const KConfigGroup &config)
void AkregatorPlugin::saveProperties(KConfigGroup &config) void AkregatorPlugin::saveProperties(KConfigGroup &config)
{ {
if (part()) { if (part()) {
Akregator::Part *myPart = static_cast<Akregator::Part *>(part()); auto *myPart = static_cast<Akregator::Part *>(part());
myPart->saveProperties(config); myPart->saveProperties(config);
} }
} }
......
...@@ -244,8 +244,8 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget) ...@@ -244,8 +244,8 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget)
// toolbar / View // toolbar / View
const MainWidget::ViewMode viewMode = static_cast<MainWidget::ViewMode>(Settings::viewMode()); const auto viewMode = static_cast<MainWidget::ViewMode>(Settings::viewMode());
QActionGroup *group = new QActionGroup(this); auto *group = new QActionGroup(this);
action = coll->addAction(QStringLiteral("normal_view")); action = coll->addAction(QStringLiteral("normal_view"));
action->setCheckable(true); action->setCheckable(true);
action->setChecked(viewMode == MainWidget::NormalView); action->setChecked(viewMode == MainWidget::NormalView);
...@@ -306,7 +306,7 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget) ...@@ -306,7 +306,7 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget)
coll->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R)); coll->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R));
// Settings menu // Settings menu
KToggleAction *sqf = coll->add<KToggleAction>(QStringLiteral("show_quick_filter")); auto *sqf = coll->add<KToggleAction>(QStringLiteral("show_quick_filter"));
sqf->setText(i18n("Show Quick Filter")); sqf->setText(i18n("Show Quick Filter"));
connect(sqf, &QAction::triggered, d->mainWidget, &MainWidget::slotToggleShowQuickFilter); connect(sqf, &QAction::triggered, d->mainWidget, &MainWidget::slotToggleShowQuickFilter);
sqf->setChecked(Settings::showQuickFilter()); sqf->setChecked(Settings::showQuickFilter());
...@@ -352,7 +352,7 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget) ...@@ -352,7 +352,7 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget)
connect(action, &QAction::triggered, d->mainWidget, &MainWidget::slotArticleDelete); connect(action, &QAction::triggered, d->mainWidget, &MainWidget::slotArticleDelete);
coll->setDefaultShortcut(action, QKeySequence(Qt::Key_Delete)); coll->setDefaultShortcut(action, QKeySequence(Qt::Key_Delete));
KActionMenu *statusMenu = coll->add<KActionMenu>(QStringLiteral("article_set_status")); auto *statusMenu = coll->add<KActionMenu>(QStringLiteral("article_set_status"));
statusMenu->setText(i18n("&Mark As")); statusMenu->setText(i18n("&Mark As"));
statusMenu->setEnabled(false); statusMenu->setEnabled(false);
...@@ -380,7 +380,7 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget) ...@@ -380,7 +380,7 @@ void ActionManagerImpl::initMainWidget(MainWidget *mainWidget)
connect(action, &QAction::triggered, d->mainWidget, &MainWidget::slotSetSelectedArticleUnread); connect(action, &QAction::triggered, d->mainWidget, &MainWidget::slotSetSelectedArticleUnread);
statusMenu->addAction(action); statusMenu->addAction(action);
KToggleAction *importantAction = coll->add<KToggleAction>(QStringLiteral("article_set_status_important")); auto *importantAction = coll->add<KToggleAction>(QStringLiteral("article_set_status_important"));
importantAction->setText(i18n("&Mark as Important")); importantAction->setText(i18n("&Mark as Important"));
importantAction->setIcon(QIcon::fromTheme(QStringLiteral("mail-mark-important"))); importantAction->setIcon(QIcon::fromTheme(QStringLiteral("mail-mark-important")));
const QList<QKeySequence> importantSC = {QKeySequence(Qt::CTRL + Qt::Key_I), QKeySequence(Qt::Key_I)}; const QList<QKeySequence> importantSC = {QKeySequence(Qt::CTRL + Qt::Key_I), QKeySequence(Qt::Key_I)};
......
...@@ -50,7 +50,7 @@ AddFeedDialog::AddFeedDialog(QWidget *parent, const QString &name) ...@@ -50,7 +50,7 @@ AddFeedDialog::AddFeedDialog(QWidget *parent, const QString &name)
{ {
setObjectName(name); setObjectName(name);
setWindowTitle(i18nc("@title:window", "Add Feed")); setWindowTitle(i18nc("@title:window", "Add Feed"));
QVBoxLayout *mainLayout = new QVBoxLayout(this); auto *mainLayout = new QVBoxLayout(this);
widget = new AddFeedWidget(this); widget = new AddFeedWidget(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
......
...@@ -157,7 +157,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &) ...@@ -157,7 +157,7 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
QDir().mkpath(path); QDir().mkpath(path);
m_standardFeedList = path + QStringLiteral("/feeds.opml"); m_standardFeedList = path + QStringLiteral("/feeds.opml");
Backend::StorageFactoryDummyImpl *dummyFactory = new Backend::StorageFactoryDummyImpl(); auto *dummyFactory = new Backend::StorageFactoryDummyImpl();
if (!Backend::StorageFactoryRegistry::self()->registerFactory(dummyFactory, dummyFactory->key())) { if (!Backend::StorageFactoryRegistry::self()->registerFactory(dummyFactory, dummyFactory->key())) {
// There was already a dummy factory registered. // There was already a dummy factory registered.
delete dummyFactory; delete dummyFactory;
...@@ -269,7 +269,7 @@ void Part::slotOnShutdown() ...@@ -269,7 +269,7 @@ void Part::slotOnShutdown()
void Part::initializeTrayIcon() void Part::initializeTrayIcon()
{ {
TrayIcon *trayIcon = new TrayIcon(m_mainWidget->window()); auto *trayIcon = new TrayIcon(m_mainWidget->window());
TrayIcon::setInstance(trayIcon); TrayIcon::setInstance(trayIcon);
m_actionManager->setTrayIcon(trayIcon); m_actionManager->setTrayIcon(trayIcon);
......
...@@ -128,14 +128,14 @@ void ArticleListView::setArticleModel(ArticleModel *model) ...@@ -128,14 +128,14 @@ void ArticleListView::setArticleModel(ArticleModel *model)
m_proxy->setSourceModel(model); m_proxy->setSourceModel(model);
m_proxy->setSortRole(ArticleModel::SortRole); m_proxy->setSortRole(ArticleModel::SortRole);
m_proxy->setFilters(m_matchers); m_proxy->setFilters(m_matchers);
FilterDeletedProxyModel *const proxy2 = new FilterDeletedProxyModel(model); auto *const proxy2 = new FilterDeletedProxyModel(model);
proxy2->setSortRole(ArticleModel::SortRole); proxy2->setSortRole(ArticleModel::SortRole);
proxy2->setSourceModel(m_proxy); proxy2->setSourceModel(m_proxy);
connect(model, &QAbstractItemModel::rowsInserted, connect(model, &QAbstractItemModel::rowsInserted,
m_proxy.data(), &QSortFilterProxyModel::invalidate); m_proxy.data(), &QSortFilterProxyModel::invalidate);
FilterColumnsProxyModel *const columnsProxy = new FilterColumnsProxyModel(model); auto *const columnsProxy = new FilterColumnsProxyModel(model);
columnsProxy->setSortRole(ArticleModel::SortRole); columnsProxy->setSortRole(ArticleModel::SortRole);
columnsProxy->setSourceModel(proxy2); columnsProxy->setSourceModel(proxy2);
columnsProxy->setColumnEnabled(ArticleModel::ItemTitleColumn); columnsProxy->setColumnEnabled(ArticleModel::ItemTitleColumn);
...@@ -399,7 +399,7 @@ void ArticleListView::mousePressEvent(QMouseEvent *ev) ...@@ -399,7 +399,7 @@ void ArticleListView::mousePressEvent(QMouseEvent *ev)
void ArticleListView::contextMenuEvent(QContextMenuEvent *event) void ArticleListView::contextMenuEvent(QContextMenuEvent *event)
{ {
QWidget *w = ActionManager::getInstance()->container(QStringLiteral("article_popup")); QWidget *w = ActionManager::getInstance()->container(QStringLiteral("article_popup"));
QMenu *popup = qobject_cast<QMenu *>(w); auto *popup = qobject_cast<QMenu *>(w);
if (popup) { if (popup) {
popup->exec(event->globalPos()); popup->exec(event->globalPos());
} }
......
...@@ -159,7 +159,7 @@ bool Criterion::satisfiedBy(const Article &article) const ...@@ -159,7 +159,7 @@ bool Criterion::satisfiedBy(const Article &article) const
bool satisfied = false; bool satisfied = false;
const Predicate predicateType = static_cast<Predicate>(m_predicate & ~Negation); const auto predicateType = static_cast<Predicate>(m_predicate & ~Negation);
QString subjectType = QLatin1String(concreteSubject.typeName()); QString subjectType = QLatin1String(concreteSubject.typeName());
switch (predicateType) { switch (predicateType) {
...@@ -265,8 +265,8 @@ void ArticleMatcher::readConfig(KConfigGroup *config) ...@@ -265,8 +265,8 @@ void ArticleMatcher::readConfig(KConfigGroup *config)
bool ArticleMatcher::operator==(const AbstractMatcher &other) const bool ArticleMatcher::operator==(const AbstractMatcher &other) const
{ {
AbstractMatcher *ptr = const_cast<AbstractMatcher *>(&other); auto *ptr = const_cast<AbstractMatcher *>(&other);
ArticleMatcher *o = dynamic_cast<ArticleMatcher *>(ptr); auto *o = dynamic_cast<ArticleMatcher *>(ptr);
if (!o) { if (!o) {
return false; return false;
} else { } else {
......
...@@ -59,7 +59,7 @@ ArticleViewerWebEngineWidgetNg::ArticleViewerWebEngineWidgetNg(KActionCollection ...@@ -59,7 +59,7 @@ ArticleViewerWebEngineWidgetNg::ArticleViewerWebEngineWidgetNg(KActionCollection
void ArticleViewerWebEngineWidgetNg::initializeLayout(KActionCollection *ac) void ArticleViewerWebEngineWidgetNg::initializeLayout(KActionCollection *ac)
{ {
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this); mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this);
...@@ -163,7 +163,7 @@ void ArticleViewerWebEngineWidgetNg::slotOpenInBrowser() ...@@ -163,7 +163,7 @@ void ArticleViewerWebEngineWidgetNg::slotOpenInBrowser()
{ {
const QUrl currentUrl(mArticleViewerNg->url()); const QUrl currentUrl(mArticleViewerNg->url());
if (currentUrl.isLocalFile()) { if (currentUrl.isLocalFile()) {
WebEngineViewer::WebEngineExportHtmlPageJob *job = new WebEngineViewer::WebEngineExportHtmlPageJob; auto *job = new WebEngineViewer::WebEngineExportHtmlPageJob;
job->setEngineView(mArticleViewerNg); job->setEngineView(mArticleViewerNg);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::failed, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageFailed); connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::failed, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageFailed);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::success, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageSuccess); connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::success, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageSuccess);
......
...@@ -46,7 +46,7 @@ ArticleViewerWidget::ArticleViewerWidget(const QString &grantleeDirectory, KActi ...@@ -46,7 +46,7 @@ ArticleViewerWidget::ArticleViewerWidget(const QString &grantleeDirectory, KActi
, m_articleViewerWidgetNg(new Akregator::ArticleViewerWebEngineWidgetNg(ac, this)) , m_articleViewerWidgetNg(new Akregator::ArticleViewerWebEngineWidgetNg(ac, this))
, m_grantleeDirectory(grantleeDirectory) , m_grantleeDirectory(grantleeDirectory)
{ {
QGridLayout *layout = new QGridLayout(this); auto *layout = new QGridLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_articleViewerWidgetNg); layout->addWidget(m_articleViewerWidgetNg);
m_articleHtmlWriter = new Akregator::ArticleHtmlWebEngineWriter(m_articleViewerWidgetNg->articleViewerNg(), this); m_articleHtmlWriter = new Akregator::ArticleHtmlWebEngineWriter(m_articleViewerWidgetNg->articleViewerNg(), this);
......
...@@ -52,7 +52,7 @@ void CreateFolderCommand::Private::doCreate() ...@@ -52,7 +52,7 @@ void CreateFolderCommand::Private::doCreate()
return; return;
} }
Folder *parentFolder = qobject_cast<Folder *>(m_selectedSubscription); auto *parentFolder = qobject_cast<Folder *>(m_selectedSubscription);
if (!parentFolder) { if (!parentFolder) {
parentFolder = m_selectedSubscription ? m_selectedSubscription->parent() : nullptr; parentFolder = m_selectedSubscription ? m_selectedSubscription->parent() : nullptr;
} }
...@@ -62,7 +62,7 @@ void CreateFolderCommand::Private::doCreate() ...@@ -62,7 +62,7 @@ void CreateFolderCommand::Private::doCreate()
TreeNode *const after = (m_selectedSubscription && m_selectedSubscription->isGroup()) ? m_selectedSubscription : nullptr; TreeNode *const after = (m_selectedSubscription && m_selectedSubscription->isGroup()) ? m_selectedSubscription : nullptr;
Folder *const newFolder = new Folder(name); auto *const newFolder = new Folder(name);
parentFolder->insertChild(newFolder, after); parentFolder->insertChild(newFolder, after);
m_subscriptionListView->ensureNodeVisible(newFolder); m_subscriptionListView->ensureNodeVisible(newFolder);
q->done(); q->done();
......
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
private: private:
static DeleteSubscriptionJob *reallyCreateJob(TreeNode *node) static DeleteSubscriptionJob *reallyCreateJob(TreeNode *node)
{ {
DeleteSubscriptionJob *job = new DeleteSubscriptionJob; auto *job = new DeleteSubscriptionJob;
job->setSubscriptionId(node->id()); job->setSubscriptionId(node->id());
return job; return job;
} }
......
...@@ -46,7 +46,7 @@ ExpireItemsCommand::Private::Private(ExpireItemsCommand *qq) : q(qq) ...@@ -46,7 +46,7 @@ ExpireItemsCommand::Private::Private(ExpireItemsCommand *qq) : q(qq)
void ExpireItemsCommand::Private::addDeleteJobForFeed(Feed *feed) void ExpireItemsCommand::Private::addDeleteJobForFeed(Feed *feed)
{ {
Q_ASSERT(feed); Q_ASSERT(feed);
ArticleDeleteJob *job = new ArticleDeleteJob(q); auto *job = new ArticleDeleteJob(q);
connect(job, &ArticleDeleteJob::finished, q, [this](KJob *job) { connect(job, &ArticleDeleteJob::finished, q, [this](KJob *job) {
jobFinished(job); jobFinished(job);
}); });
......
...@@ -15,9 +15,9 @@ using namespace Akregator; ...@@ -15,9 +15,9 @@ using namespace Akregator;
CrashWidget::CrashWidget(QWidget *parent) CrashWidget::CrashWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
QVBoxLayout *vbox = new QVBoxLayout(this); auto *vbox = new QVBoxLayout(this);
QHBoxLayout *labelLayout = new QHBoxLayout; auto *labelLayout = new QHBoxLayout;
QLabel *label = new QLabel(i18n("Akregator did not close correctly. Would you like to restore the previous session?"), this); QLabel *label = new QLabel(i18n("Akregator did not close correctly. Would you like to restore the previous session?"), this);
label->setObjectName(QStringLiteral("restoresessionlabel")); label->setObjectName(QStringLiteral("restoresessionlabel"));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
...@@ -30,7 +30,7 @@ CrashWidget::CrashWidget(QWidget *parent) ...@@ -30,7 +30,7 @@ CrashWidget::CrashWidget(QWidget *parent)
labelLayout->addWidget(label); labelLayout->addWidget(label);
labelLayout->addStretch(0); labelLayout->addStretch(0);
QHBoxLayout *buttonLayout = new QHBoxLayout; auto *buttonLayout = new QHBoxLayout;
vbox->addLayout(buttonLayout); vbox->addLayout(buttonLayout);
buttonLayout->addStretch(0); buttonLayout->addStretch(0);
......
...@@ -358,7 +358,7 @@ void Feed::loadFavicon(const QString &url, bool downloadFavicon) ...@@ -358,7 +358,7 @@ void Feed::loadFavicon(const QString &url, bool downloadFavicon)
if (u.isLocalFile()) { if (u.isLocalFile()) {
setFaviconLocalPath(u.toLocalFile()); setFaviconLocalPath(u.toLocalFile());
} else { } else {
Akregator::DownloadFeedIconJob *job = new Akregator::DownloadFeedIconJob(this); auto *job = new Akregator::DownloadFeedIconJob(this);
job->setFeedIconUrl(u); job->setFeedIconUrl(u);
job->setDownloadFavicon(downloadFavicon); job->setDownloadFavicon(downloadFavicon);
connect(job, &DownloadFeedIconJob::result, this, [this](const QString &fileName) { connect(job, &DownloadFeedIconJob::result, this, [this](const QString &fileName) {
...@@ -581,7 +581,7 @@ QDomElement Feed::toOPML(QDomElement parent, QDomDocument document) const ...@@ -581,7 +581,7 @@ QDomElement Feed::toOPML(QDomElement parent, QDomDocument document) const
KJob *Feed::createMarkAsReadJob() KJob *Feed::createMarkAsReadJob()
{ {
ArticleModifyJob *job = new ArticleModifyJob; auto *job = new ArticleModifyJob;
const auto arts = articles(); const auto arts = articles();
for (const Article &i : arts) { for (const Article &i : arts) {
const ArticleId aid = { xmlUrl(), i.guid() }; const ArticleId aid = { xmlUrl(), i.guid() };
......
...@@ -601,7 +601,7 @@ void FeedListManagementImpl::removeFeed(const QString &url, const QString &catId ...@@ -601,7 +601,7 @@ void FeedListManagementImpl::removeFeed(const QString &url, const QString &catId
if (lastcatid == i->parent()->id()) { if (lastcatid == i->parent()->id()) {
if (i->xmlUrl().compare(url) == 0) { if (i->xmlUrl().compare(url) == 0) {
qCDebug(AKREGATOR_LOG) << "id:" << i->id(); qCDebug(AKREGATOR_LOG) << "id:" << i->id();
DeleteSubscriptionJob *job = new DeleteSubscriptionJob; auto *job = new DeleteSubscriptionJob;
job->setSubscriptionId(i->id()); job->setSubscriptionId(i->id());
job->start(); job->start();
} }
......
...@@ -60,7 +60,7 @@ FeedPropertiesDialog::FeedPropertiesDialog(QWidget *parent, const QString &name) ...@@ -60,7 +60,7 @@ FeedPropertiesDialog::FeedPropertiesDialog(QWidget *parent, const QString &name)
{ {
setObjectName(name); setObjectName(name);
setWindowTitle(i18nc("@title:window", "Feed Properties")); setWindowTitle(i18nc("@title:window", "Feed Properties"));
QVBoxLayout *mainLayout = new QVBoxLayout(this); auto *mainLayout = new QVBoxLayout(this);
widget = new FeedPropertiesWidget(this); widget = new FeedPropertiesWidget(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
......
...@@ -302,7 +302,7 @@ void Folder::updateUnreadCount() const ...@@ -302,7 +302,7 @@ void Folder::updateUnreadCount() const
KJob *Folder::createMarkAsReadJob() KJob *Folder::createMarkAsReadJob()
{ {
CompositeJob *job = new CompositeJob; auto *job = new CompositeJob;
const auto f = feeds(); const auto f = feeds();
for (Feed *const i : f) { for (Feed *const i : f) {
job->addSubjob(i->createMarkAsReadJob()); job->addSubjob(i->createMarkAsReadJob());
...@@ -440,7 +440,7 @@ QList<const TreeNode *> Folder::namedChildren(const QString &title) const ...@@ -440,7 +440,7 @@ QList<const TreeNode *> Folder::namedChildren(const QString &title) const
if (child->title() == title) { if (child->title() == title) {
nodeList.append(child); nodeList.append(child);
} }
const Folder *fld = dynamic_cast<const Folder *>(child); const auto *fld = dynamic_cast<const Folder *>(child);
if (fld) { if (fld) {
nodeList += fld->namedChildren(title); nodeList += fld->namedChildren(title);
} }
...@@ -456,7 +456,7 @@ QList<TreeNode *> Folder::namedChildren(const QString &title) ...@@ -456,7 +456,7 @@ QList<TreeNode *> Folder::namedChildren(const QString &title)
if (child->title() == title) { if (child->title() == title) {
nodeList.append(child); nodeList.append(child);
} }
Folder *const fld = qobject_cast<Folder *>(child); auto *const fld = qobject_cast<Folder *>(child);
if (fld) { if (fld) {
nodeList += fld->namedChildren(title); nodeList += fld->namedChildren(title);
} }
......
...@@ -134,7 +134,7 @@ QString GrantleeViewFormatter::formatArticles(const QVector<Article> &article, A ...@@ -134,7 +134,7 @@ QString GrantleeViewFormatter::formatArticles(const QVector<Article> &article, A
QList<ArticleGrantleeObject *> lstObj; QList<ArticleGrantleeObject *> lstObj;
lstObj.reserve(nbArticles); lstObj.reserve(nbArticles);
for (int i = 0; i < nbArticles; ++i) { for (int i = 0; i < nbArticles; ++i) {
ArticleGrantleeObject *articleObj = new ArticleGrantleeObject(article.at(i), icon); auto *articleObj = new ArticleGrantleeObject(article.at(i), icon);
articlesList << QVariant::fromValue(static_cast<QObject *>(articleObj)); articlesList << QVariant::fromValue(static_cast<QObject *>(articleObj));
lstObj.append(articleObj); lstObj.append(articleObj);
} }
......
...@@ -16,7 +16,7 @@ MainFrame::MainFrame(QWidget *parent, QWidget *visibleWidget) ...@@ -16,7 +16,7 @@ MainFrame::MainFrame(QWidget *parent, QWidget *visibleWidget)
: Frame(parent) : Frame(parent)
{ {
setRemovable(false); setRemovable(false);
QGridLayout *layout = new QGridLayout(this); auto *layout = new QGridLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(visibleWidget, 0, 0); layout->addWidget(visibleWidget, 0, 0);
} }
......
...@@ -17,10 +17,10 @@ using namespace Akregator; ...@@ -17,10 +17,10 @@ using namespace Akregator;
WebEngineFrame::WebEngineFrame(KActionCollection *ac, QWidget *parent) WebEngineFrame::WebEngineFrame(KActionCollection *ac, QWidget *parent)
: Frame(parent) : Frame(parent)
{ {
QVBoxLayout *layout = new QVBoxLayout(this); auto *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);