Commit bf66ec8f authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent 743ee3f1
Pipeline #39509 passed with stage
in 15 minutes and 13 seconds
......@@ -25,7 +25,7 @@ JobTrackerSearchWidgetTest::~JobTrackerSearchWidgetTest()
void JobTrackerSearchWidgetTest::shouldHaveDefaultValue()
{
JobTrackerSearchWidget w;
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
auto *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
int top = -1;
int bottom = -1;
......@@ -37,17 +37,17 @@ void JobTrackerSearchWidgetTest::shouldHaveDefaultValue()
QCOMPARE(left, 0);
QCOMPARE(right, 0);
QLineEdit *mSearchLineEdit = w.findChild<QLineEdit *>(QStringLiteral("searchline"));
auto *mSearchLineEdit = w.findChild<QLineEdit *>(QStringLiteral("searchline"));
QVERIFY(mSearchLineEdit);
QVERIFY(mSearchLineEdit->isClearButtonEnabled());
QVERIFY(mSearchLineEdit->text().isEmpty());
QComboBox *mSelectColumn = w.findChild<QComboBox *>(QStringLiteral("selectcolumn"));
auto *mSelectColumn = w.findChild<QComboBox *>(QStringLiteral("selectcolumn"));
QVERIFY(mSelectColumn);
QCOMPARE(mSelectColumn->count(), 8);
QCOMPARE(mSelectColumn->currentIndex(), 0);
QCheckBox *mSelectOnlyError = w.findChild<QCheckBox *>(QStringLiteral("selectonlyerror"));
auto *mSelectOnlyError = w.findChild<QCheckBox *>(QStringLiteral("selectonlyerror"));
QVERIFY(mSelectOnlyError);
QVERIFY(!mSelectOnlyError->text().isEmpty());
QCOMPARE(mSelectOnlyError->checkState(), Qt::Unchecked);
......@@ -57,7 +57,7 @@ void JobTrackerSearchWidgetTest::shouldEmitSignal()
{
JobTrackerSearchWidget w;
QSignalSpy searchWidgetSignal(&w, &JobTrackerSearchWidget::searchTextChanged);
QLineEdit *mSearchLineEdit = w.findChild<QLineEdit *>(QStringLiteral("searchline"));
auto *mSearchLineEdit = w.findChild<QLineEdit *>(QStringLiteral("searchline"));
const QString foo = QStringLiteral("foo");
mSearchLineEdit->setText(foo);
QCOMPARE(searchWidgetSignal.count(), 1);
......@@ -71,7 +71,7 @@ void JobTrackerSearchWidgetTest::shouldEmitColumnChanged()
{
JobTrackerSearchWidget w;
QSignalSpy columnChangedSignal(&w, &JobTrackerSearchWidget::columnChanged);
QComboBox *mSelectColumn = w.findChild<QComboBox *>(QStringLiteral("selectcolumn"));
auto *mSelectColumn = w.findChild<QComboBox *>(QStringLiteral("selectcolumn"));
mSelectColumn->setCurrentIndex(2);
QCOMPARE(columnChangedSignal.count(), 1);
}
......@@ -80,7 +80,7 @@ void JobTrackerSearchWidgetTest::shouldEmitSelectOnlyErrorChanged()
{
JobTrackerSearchWidget w;
QSignalSpy selectOnlyErrorChangedSignal(&w, &JobTrackerSearchWidget::selectOnlyErrorChanged);
QCheckBox *mSelectOnlyError = w.findChild<QCheckBox *>(QStringLiteral("selectonlyerror"));
auto *mSelectOnlyError = w.findChild<QCheckBox *>(QStringLiteral("selectonlyerror"));
mSelectOnlyError->setChecked(true);
QCOMPARE(selectOnlyErrorChangedSignal.count(), 1);
}
......
......@@ -15,16 +15,16 @@ AgentConfigDialog::AgentConfigDialog(QWidget *parent)
: QDialog(parent)
, m_model(new AgentConfigModel(this))
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainWidget = new QWidget(this);
auto *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
ui.setupUi(mainWidget);
ui.propertyView->setModel(m_model);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close | QDialogButtonBox::Apply, this);
QPushButton *user1Button = new QPushButton;
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close | QDialogButtonBox::Apply, this);
auto *user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
QPushButton *user2Button = new QPushButton;
auto *user2Button = new QPushButton;
buttonBox->addButton(user2Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::accepted, this, &AgentConfigDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &AgentConfigDialog::reject);
......
......@@ -42,11 +42,11 @@ public:
explicit TextDialog(QWidget *parent = nullptr)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainLayout = new QVBoxLayout(this);
mText = new QPlainTextEdit(this);
mText->setReadOnly(true);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok, this);
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......@@ -132,7 +132,7 @@ AgentWidget::AgentWidget(QWidget *parent)
bool AgentWidget::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyPress && obj == ui.mFilterAccount) {
QKeyEvent *key = static_cast<QKeyEvent *>(event);
auto *key = static_cast<QKeyEvent *>(event);
if ((key->key() == Qt::Key_Enter) || (key->key() == Qt::Key_Return)) {
event->accept();
return true;
......@@ -148,7 +148,7 @@ void AgentWidget::addAgent()
const AgentType agentType = dlg->agentType();
if (agentType.isValid()) {
AgentInstanceCreateJob *job = new AgentInstanceCreateJob(agentType, this);
auto *job = new AgentInstanceCreateJob(agentType, this);
job->configure(this);
job->start(); // TODO: check result
}
......@@ -328,7 +328,7 @@ void AgentWidget::slotCloneAgent()
}
const AgentType agentType = mCloneSource.type();
if (agentType.isValid()) {
AgentInstanceCreateJob *job = new AgentInstanceCreateJob(agentType, this);
auto *job = new AgentInstanceCreateJob(agentType, this);
connect(job, &KJob::result, this, &AgentWidget::cloneAgent);
job->start();
} else {
......
......@@ -14,7 +14,7 @@
#include <KCalendarCore/Incidence>
#include <KCalendarCore/Event>
typedef QSharedPointer<KCalendarCore::Incidence> IncidencePtr;
using IncidencePtr = QSharedPointer<KCalendarCore::Incidence>;
class AkonadiBrowserModel::State
{
......
......@@ -81,13 +81,13 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget *parent)
: QWidget(parent)
{
Q_ASSERT(xmlGuiWindow);
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
QSplitter *splitter = new QSplitter(Qt::Horizontal, this);
auto *splitter = new QSplitter(Qt::Horizontal, this);
splitter->setObjectName(QStringLiteral("collectionSplitter"));
layout->addWidget(splitter);
QSplitter *splitter2 = new QSplitter(Qt::Vertical, this);
auto *splitter2 = new QSplitter(Qt::Vertical, this);
splitter2->setObjectName(QStringLiteral("ffvSplitter"));
mCollectionView = new Akonadi::EntityTreeView(xmlGuiWindow, this);
......@@ -95,13 +95,13 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget *parent)
mCollectionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
splitter2->addWidget(mCollectionView);
EntityListView *favoritesView = new EntityListView(xmlGuiWindow, this);
auto *favoritesView = new EntityListView(xmlGuiWindow, this);
//favoritesView->setViewMode( QListView::IconMode );
splitter2->addWidget(favoritesView);
splitter->addWidget(splitter2);
ChangeRecorder *tagRecorder = new ChangeRecorder(this);
auto *tagRecorder = new ChangeRecorder(this);
tagRecorder->setObjectName(QStringLiteral("tagRecorder"));
tagRecorder->setTypeMonitored(Monitor::Tags);
tagRecorder->setChangeRecordingEnabled(false);
......@@ -135,7 +135,7 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget *parent)
// new ModelTest( mBrowserModel );
EntityMimeTypeFilterModel *collectionFilter = new EntityMimeTypeFilterModel(this);
auto *collectionFilter = new EntityMimeTypeFilterModel(this);
collectionFilter->setSourceModel(mBrowserModel);
collectionFilter->addMimeTypeInclusionFilter(Collection::mimeType());
collectionFilter->setHeaderGroup(EntityTreeModel::CollectionTreeHeaders);
......@@ -148,28 +148,28 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget *parent)
mCollectionView->setModel(statisticsProxyModel);
Akonadi::SelectionProxyModel *selectionProxyModel = new Akonadi::SelectionProxyModel(mCollectionView->selectionModel(), this);
auto *selectionProxyModel = new Akonadi::SelectionProxyModel(mCollectionView->selectionModel(), this);
selectionProxyModel->setSourceModel(mBrowserModel);
selectionProxyModel->setFilterBehavior(KSelectionProxyModel::ChildrenOfExactSelection);
EntityMimeTypeFilterModel *itemFilter = new EntityMimeTypeFilterModel(this);
auto *itemFilter = new EntityMimeTypeFilterModel(this);
itemFilter->setSourceModel(selectionProxyModel);
itemFilter->addMimeTypeExclusionFilter(Collection::mimeType());
itemFilter->setHeaderGroup(EntityTreeModel::ItemListHeaders);
const KConfigGroup group = KSharedConfig::openConfig()->group("FavoriteCollectionsModel");
connect(mBrowserModel, &AkonadiBrowserModel::columnsChanged, itemFilter, &EntityMimeTypeFilterModel::invalidate);
AkonadiBrowserSortModel *sortModel = new AkonadiBrowserSortModel(mBrowserModel, this);
auto *sortModel = new AkonadiBrowserSortModel(mBrowserModel, this);
sortModel->setDynamicSortFilter(true);
sortModel->setSourceModel(itemFilter);
FavoriteCollectionsModel *favoritesModel = new FavoriteCollectionsModel(mBrowserModel, group, this);
auto *favoritesModel = new FavoriteCollectionsModel(mBrowserModel, group, this);
favoritesView->setModel(favoritesModel);
QSplitter *splitter3 = new QSplitter(Qt::Vertical, this);
auto *splitter3 = new QSplitter(Qt::Vertical, this);
splitter3->setObjectName(QStringLiteral("itemSplitter"));
splitter->addWidget(splitter3);
QWidget *itemViewParent = new QWidget(this);
auto *itemViewParent = new QWidget(this);
itemUi.setupUi(itemViewParent);
itemUi.modelBox->addItem(QStringLiteral("Generic"));
......@@ -187,7 +187,7 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget *parent)
splitter3->addWidget(itemViewParent);
itemViewParent->layout()->setContentsMargins(0, 0, 0, 0);
QWidget *contentViewParent = new QWidget(this);
auto *contentViewParent = new QWidget(this);
contentUi.setupUi(contentViewParent);
contentUi.saveButton->setEnabled(false);
connect(contentUi.saveButton, &QPushButton::clicked, this, &BrowserWidget::save);
......@@ -275,7 +275,7 @@ void BrowserWidget::currentChanged(const QModelIndex &index)
return;
}
ItemFetchJob *job = new ItemFetchJob(item, this);
auto *job = new ItemFetchJob(item, this);
job->fetchScope().fetchFullPayload();
job->fetchScope().fetchAllAttributes();
job->fetchScope().setFetchTags(true);
......@@ -287,7 +287,7 @@ void BrowserWidget::currentChanged(const QModelIndex &index)
void BrowserWidget::itemFetchDone(KJob *job)
{
ItemFetchJob *fetch = static_cast<ItemFetchJob *>(job);
auto *fetch = static_cast<ItemFetchJob *>(job);
if (job->error()) {
qCWarning(AKONADICONSOLE_LOG) << "Item fetch failed: " << job->errorString();
} else if (fetch->items().isEmpty()) {
......@@ -453,7 +453,7 @@ void BrowserWidget::save()
item.addAttribute(attr);
}
ItemModifyJob *store = new ItemModifyJob(item, this);
auto *store = new ItemModifyJob(item, this);
connect(store, &ItemModifyJob::result, this, &BrowserWidget::saveResult);
}
......@@ -504,7 +504,7 @@ void BrowserWidget::dumpToXml()
return;
}
XmlWriteJob *job = new XmlWriteJob(root, fileName, this);
auto *job = new XmlWriteJob(root, fileName, this);
connect(job, &XmlWriteJob::result, this, &BrowserWidget::dumpToXmlResult);
}
......@@ -575,7 +575,7 @@ void BrowserWidget::updateItemFetchScope()
void BrowserWidget::tagViewContextMenuRequested(const QPoint &pos)
{
const QModelIndex index = mTagView->indexAt(pos);
QMenu *menu = new QMenu(this);
auto *menu = new QMenu(this);
connect(menu, &QMenu::aboutToHide, menu, &QMenu::deleteLater);
menu->addAction(QIcon::fromTheme(QStringLiteral("list-add")), QStringLiteral("&Add tag..."), this, &BrowserWidget::addTagRequested);
if (index.isValid()) {
......@@ -590,7 +590,7 @@ void BrowserWidget::tagViewContextMenuRequested(const QPoint &pos)
void BrowserWidget::addTagRequested()
{
TagPropertiesDialog *dlg = new TagPropertiesDialog(this);
auto *dlg = new TagPropertiesDialog(this);
connect(dlg, &TagPropertiesDialog::accepted, this, &BrowserWidget::createTag);
connect(dlg, &TagPropertiesDialog::rejected, dlg, &TagPropertiesDialog::deleteLater);
dlg->show();
......@@ -598,13 +598,13 @@ void BrowserWidget::addTagRequested()
void BrowserWidget::addSubTagRequested()
{
QAction *action = qobject_cast<QAction *>(sender());
auto *action = qobject_cast<QAction *>(sender());
const Akonadi::Tag parentTag = action->parent()->property("Tag").value<Akonadi::Tag>();
Akonadi::Tag tag;
tag.setParent(parentTag);
TagPropertiesDialog *dlg = new TagPropertiesDialog(tag, this);
auto *dlg = new TagPropertiesDialog(tag, this);
connect(dlg, &TagPropertiesDialog::accepted, this, &BrowserWidget::createTag);
connect(dlg, &TagPropertiesDialog::rejected, dlg, &TagPropertiesDialog::deleteLater);
dlg->show();
......@@ -612,9 +612,9 @@ void BrowserWidget::addSubTagRequested()
void BrowserWidget::editTagRequested()
{
QAction *action = qobject_cast<QAction *>(sender());
auto *action = qobject_cast<QAction *>(sender());
const Akonadi::Tag tag = action->parent()->property("Tag").value<Akonadi::Tag>();
TagPropertiesDialog *dlg = new TagPropertiesDialog(tag, this);
auto *dlg = new TagPropertiesDialog(tag, this);
connect(dlg, &TagPropertiesDialog::accepted, this, &BrowserWidget::modifyTag);
connect(dlg, &TagPropertiesDialog::rejected, dlg, &TagPropertiesDialog::deleteLater);
dlg->show();
......@@ -630,7 +630,7 @@ void BrowserWidget::tagViewDoubleClicked(const QModelIndex &index)
const Akonadi::Tag tag = mTagModel->data(index, TagModel::TagRole).value<Akonadi::Tag>();
Q_ASSERT(tag.isValid());
TagPropertiesDialog *dlg = new TagPropertiesDialog(tag, this);
auto *dlg = new TagPropertiesDialog(tag, this);
connect(dlg, &TagPropertiesDialog::accepted, this, &BrowserWidget::modifyTag);
connect(dlg, &TagPropertiesDialog::rejected, dlg, &TagPropertiesDialog::deleteLater);
dlg->show();
......@@ -644,14 +644,14 @@ void BrowserWidget::removeTagRequested()
return;
}
QAction *action = qobject_cast<QAction *>(sender());
auto *action = qobject_cast<QAction *>(sender());
const Akonadi::Tag tag = action->parent()->property("Tag").value<Akonadi::Tag>();
new Akonadi::TagDeleteJob(tag, this);
}
void BrowserWidget::createTag()
{
TagPropertiesDialog *dlg = qobject_cast<TagPropertiesDialog *>(sender());
auto *dlg = qobject_cast<TagPropertiesDialog *>(sender());
Q_ASSERT(dlg);
if (dlg->changed()) {
......@@ -661,7 +661,7 @@ void BrowserWidget::createTag()
void BrowserWidget::modifyTag()
{
TagPropertiesDialog *dlg = qobject_cast<TagPropertiesDialog *>(sender());
auto *dlg = qobject_cast<TagPropertiesDialog *>(sender());
Q_ASSERT(dlg);
if (dlg->changed()) {
......
......@@ -30,7 +30,7 @@ ConnectionPage::ConnectionPage(const QString &identifier, QWidget *parent)
, mIdentifier(identifier)
, mShowAllConnections(false)
{
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
auto h = new QHBoxLayout;
layout->addLayout(h);
......
......@@ -28,7 +28,7 @@ using org::freedesktop::Akonadi::DebugInterface;
DebugWidget::DebugWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
QString service = QStringLiteral("org.freedesktop.Akonadi");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
......@@ -40,7 +40,7 @@ DebugWidget::DebugWidget(QWidget *parent)
connect(cb, &QCheckBox::toggled, this, &DebugWidget::enableDebugger);
layout->addWidget(cb);
QSplitter *splitter = new QSplitter(Qt::Vertical, this);
auto *splitter = new QSplitter(Qt::Vertical, this);
splitter->setObjectName(QStringLiteral("debugSplitter"));
layout->addWidget(splitter);
......@@ -56,7 +56,7 @@ DebugWidget::DebugWidget(QWidget *parent)
connect(iface, &org::freedesktop::Akonadi::TracerNotification::warningEmitted, this, &DebugWidget::warningEmitted);
connect(iface, &org::freedesktop::Akonadi::TracerNotification::errorEmitted, this, &DebugWidget::errorEmitted);
QHBoxLayout *buttonLayout = new QHBoxLayout;
auto *buttonLayout = new QHBoxLayout;
layout->addLayout(buttonLayout);
QPushButton *clearGeneralButton = new QPushButton(QStringLiteral("Clear Information View"), this);
......
......@@ -28,12 +28,12 @@ InstanceSelector::InstanceSelector(const QString &remoteHost, QWidget *parent, Q
, ui(new Ui::InstanceSelector)
, m_remoteHost(remoteHost)
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainWidget = new QWidget(this);
auto *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
ui->setupUi(mainWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Close, this);
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Close, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......@@ -52,9 +52,9 @@ InstanceSelector::InstanceSelector(const QString &remoteHost, QWidget *parent, Q
}
slotAccept();
} else {
QStandardItemModel *model = new QStandardItemModel(this);
auto *model = new QStandardItemModel(this);
for (const QString &inst : insts) {
QStandardItem *item = new QStandardItem;
auto *item = new QStandardItem;
item->setText(inst.isEmpty() ? QStringLiteral("<global>") : inst);
item->setData(inst, Qt::UserRole);
model->appendRow(item);
......@@ -83,7 +83,7 @@ void InstanceSelector::slotAccept()
qputenv("AKONADI_INSTANCE", m_instance.toUtf8());
Akonadi::Instance::setIdentifier(m_instance);
MainWindow *mWindow = new MainWindow;
auto *mWindow = new MainWindow;
if (!m_remoteHost.isEmpty()) {
mWindow->setWindowTitle(QStringLiteral("Remote Akonadi Console (%1)").arg(m_remoteHost));
} else if (!m_instance.isEmpty()) {
......
......@@ -14,7 +14,7 @@
JobTrackerSearchWidget::JobTrackerSearchWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
auto *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
......
......@@ -40,9 +40,9 @@ JobTrackerWidget::JobTrackerWidget(const char *name, QWidget *parent, const QStr
{
d->model = new JobTrackerModel(name, this);
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
QCheckBox *enableCB = new QCheckBox(this);
auto *enableCB = new QCheckBox(this);
enableCB->setText(checkboxText);
connect(enableCB, &QAbstractButton::toggled, d->model, &JobTrackerModel::setEnabled);
layout->addWidget(enableCB);
......@@ -67,7 +67,7 @@ JobTrackerWidget::JobTrackerWidget(const char *name, QWidget *parent, const QStr
layout->addWidget(d->tv);
d->model->setEnabled(false); // since it can be slow, default to off
QHBoxLayout *layout2 = new QHBoxLayout;
auto *layout2 = new QHBoxLayout;
QPushButton *button = new QPushButton(QStringLiteral("Save to file..."), this);
connect(button, &QAbstractButton::clicked,
this, &JobTrackerWidget::slotSaveToFile);
......
......@@ -38,9 +38,9 @@
MainWidget::MainWidget(KXmlGuiWindow *parent)
: QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
QTabWidget *tabWidget = new QTabWidget(this);
auto *tabWidget = new QTabWidget(this);
tabWidget->setObjectName(QStringLiteral("mainTab"));
layout->addWidget(tabWidget);
......
......@@ -30,10 +30,10 @@ MonitorsWidget::MonitorsWidget(QWidget *parent)
{
mModel = new MonitorsModel(this);
QHBoxLayout *layout = new QHBoxLayout(this);
auto *layout = new QHBoxLayout(this);
mTreeView = new QTreeView(this);
QSortFilterProxyModel *mProxyModel = new QSortFilterProxyModel(this);
auto *mProxyModel = new QSortFilterProxyModel(this);
mProxyModel->setDynamicSortFilter(true);
mProxyModel->sort(0);
mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
......
......@@ -46,11 +46,11 @@ NotificationMonitor::NotificationMonitor(QWidget *parent)
m_filterModel = new NotificationFilterModel(this);
m_filterModel->setSourceModel(m_model);
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
auto hLayout = new QHBoxLayout;
layout->addLayout(hLayout);
QCheckBox *enableCB = new QCheckBox(this);
auto *enableCB = new QCheckBox(this);
enableCB->setText(QStringLiteral("Enable notification monitor"));
enableCB->setChecked(m_model->isEnabled());
connect(enableCB, &QCheckBox::toggled, m_model, &NotificationModel::setEnabled);
......
......@@ -305,7 +305,7 @@ public:
// childNode is a query in transaction
if (childNode->parent->parent) {
ConnectionNode *connection = static_cast<ConnectionNode *>(childNode->parent->parent);
auto *connection = static_cast<ConnectionNode *>(childNode->parent->parent);
const int trxIdx = connection->queries.indexOf(childNode->parent);
return createIndex(trxIdx, 0, childNode->parent);
} else {
......@@ -730,7 +730,7 @@ QueryDebugger::QueryDebugger(QWidget *parent)
this, &QueryDebugger::debuggerToggled);
mQueryList = new QueryDebuggerModel(this);
QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this);
auto *proxy = new QSortFilterProxyModel(this);
proxy->setSourceModel(mQueryList);
proxy->setDynamicSortFilter(true);
mUi->queryListView->setModel(proxy);
......
......@@ -40,9 +40,9 @@ SearchWidget::SearchWidget(QWidget *parent)
{
Akonadi::ControlGui::widgetNeedsAkonadi(this);
QVBoxLayout *layout = new QVBoxLayout(this);
auto *layout = new QVBoxLayout(this);
QHBoxLayout *hbox = new QHBoxLayout;
auto *hbox = new QHBoxLayout;
hbox->addWidget(new QLabel(QStringLiteral("Search store:")), 0, {});
mStoreCombo = new KComboBox;
mStoreCombo->setObjectName(QStringLiteral("SearchStoreCombo"));
......@@ -55,7 +55,7 @@ SearchWidget::SearchWidget(QWidget *parent)
mVSplitter = new QSplitter(Qt::Vertical);
mVSplitter->setObjectName(QStringLiteral("SearchVSplitter"));
auto w = new QWidget;
QVBoxLayout *vbox = new QVBoxLayout(w);
auto *vbox = new QVBoxLayout(w);
vbox->addWidget(new QLabel(QStringLiteral("Search query:")));
mQueryWidget = new QPlainTextEdit;
vbox->addWidget(mQueryWidget);
......@@ -217,7 +217,7 @@ void SearchWidget::itemFetched(KJob *job)
return;
}
Akonadi::ItemFetchJob *fetchJob = qobject_cast<Akonadi::ItemFetchJob *>(job);
auto *fetchJob = qobject_cast<Akonadi::ItemFetchJob *>(job);
if (!fetchJob->items().isEmpty()) {
const Akonadi::Item item = fetchJob->items().first();
mItemView->setPlainText(QString::fromUtf8(item.payloadData()));
......
......@@ -45,16 +45,16 @@ bool TagPropertiesDialog::changed() const
void TagPropertiesDialog::setupUi()
{
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &TagPropertiesDialog::slotAccept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &TagPropertiesDialog::reject);
QWidget *widget = new QWidget(this);
auto *widget = new QWidget(this);
ui.setupUi(widget);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(widget);
mainLayout->addWidget(buttonBox);
......
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