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

Use auto vs auto * where it's possible

parent 3f2c226c
Pipeline #49632 failed with stage
in 12 minutes and 33 seconds
......@@ -27,7 +27,7 @@ private Q_SLOTS:
Akonadi::Item item;
KCalendarCore::Event::Ptr event(new KCalendarCore::Event);
item.setPayload<KCalendarCore::Event::Ptr>(event);
auto *dialog = new IncidenceDialog();
auto dialog = new IncidenceDialog();
dialog->load(item);
// Put the dialog into a known, valid state.
......
......@@ -29,10 +29,10 @@ void FreeBusyGanttProxyModelTest::initTestCase()
void FreeBusyGanttProxyModelTest::testModelValidity()
{
auto *fbModel = new CalendarSupport::FreeBusyItemModel();
auto *ganttModel = new FreeBusyGanttProxyModel();
auto fbModel = new CalendarSupport::FreeBusyItemModel();
auto ganttModel = new FreeBusyGanttProxyModel();
ganttModel->setSourceModel(fbModel);
auto *modelTest = new QAbstractItemModelTester(ganttModel);
auto modelTest = new QAbstractItemModelTester(ganttModel);
Q_UNUSED(modelTest)
......
......@@ -23,7 +23,7 @@ AlarmDialog::AlarmDialog(KCalendarCore::Incidence::IncidenceType incidenceType,
, mIncidenceType(incidenceType)
{
setWindowTitle(i18nc("@title:window", "Create a new reminder"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
......@@ -38,7 +38,7 @@ AttachmentEditDialog::AttachmentEditDialog(AttachmentIconItem *item, QWidget *pa
QMimeDatabase db;
mMimeType = db.mimeTypeForName(item->mimeType());
QWidget *page = new QWidget(this);
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
......
......@@ -195,7 +195,7 @@ QMimeData *AttachmentIconView::mimeData(const QList<QListWidgetItem *> items) co
QStringList labels;
for (QListWidgetItem *it : items) {
if (it->isSelected()) {
auto *item = static_cast<AttachmentIconItem *>(it);
auto item = static_cast<AttachmentIconItem *>(it);
if (item->isBinary()) {
urls.append(item->tempFileForAttachment());
} else {
......@@ -205,7 +205,7 @@ QMimeData *AttachmentIconView::mimeData(const QList<QListWidgetItem *> items) co
}
}
if (selectionMode() == NoSelection) {
auto *item = static_cast<AttachmentIconItem *>(currentItem());
auto item = static_cast<AttachmentIconItem *>(currentItem());
if (item) {
urls.append(QUrl(item->uri()));
labels.append(QString::fromLatin1(QUrl::toPercentEncoding(item->label())));
......@@ -215,7 +215,7 @@ QMimeData *AttachmentIconView::mimeData(const QList<QListWidgetItem *> items) co
QMap<QString, QString> metadata;
metadata[QStringLiteral("labels")] = labels.join(QLatin1Char(':'));
auto *mimeData = new QMimeData;
auto mimeData = new QMimeData;
mimeData->setUrls(urls);
KUrlMimeData::setMetaData(metadata, mimeData);
return mimeData;
......@@ -240,7 +240,7 @@ void AttachmentIconView::startDrag(Qt::DropActions supportedActions)
const QPoint hotspot(pixmap.width() / 2, pixmap.height() / 2);
auto *drag = new QDrag(this);
auto drag = new QDrag(this);
drag->setMimeData(mimeData());
drag->setPixmap(pixmap);
......
......@@ -53,7 +53,7 @@ void AttendeeComboBoxDelegate::setStandardIndex(int index)
QWidget *AttendeeComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem & /* option */, const QModelIndex & /* index */) const
{
auto *editor = new AttendeeComboBox(parent);
auto editor = new AttendeeComboBox(parent);
for (const QPair<QIcon, QString> &pair : qAsConst(mEntries)) {
editor->addItem(pair.first, pair.second);
......@@ -70,7 +70,7 @@ QWidget *AttendeeComboBoxDelegate::createEditor(QWidget *parent, const QStyleOpt
void AttendeeComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
auto *comboBox = static_cast<AttendeeComboBox *>(editor);
auto comboBox = static_cast<AttendeeComboBox *>(editor);
int value = index.model()->data(index, Qt::EditRole).toUInt();
if (value >= mEntries.count()) {
value = mStandardIndex;
......@@ -80,7 +80,7 @@ void AttendeeComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex
void AttendeeComboBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
auto *comboBox = static_cast<AttendeeComboBox *>(editor);
auto comboBox = static_cast<AttendeeComboBox *>(editor);
model->setData(index, comboBox->currentIndex(), Qt::EditRole);
comboBox->menu()->close();
}
......@@ -110,7 +110,7 @@ void AttendeeComboBoxDelegate::paint(QPainter *painter, const QStyleOptionViewIt
bool AttendeeComboBoxDelegate::eventFilter(QObject *editor, QEvent *event)
{
if (event->type() == QEvent::Enter) {
auto *comboBox = static_cast<AttendeeComboBox *>(editor);
auto comboBox = static_cast<AttendeeComboBox *>(editor);
comboBox->showMenu();
return editor->eventFilter(editor, event);
}
......@@ -120,7 +120,7 @@ bool AttendeeComboBoxDelegate::eventFilter(QObject *editor, QEvent *event)
void AttendeeComboBoxDelegate::doCloseEditor(QWidget *editor)
{
auto *comboBox = static_cast<AttendeeComboBox *>(editor);
auto comboBox = static_cast<AttendeeComboBox *>(editor);
comboBox->menu()->close();
}
......
......@@ -21,7 +21,7 @@ AttendeeEditor::AttendeeEditor(QWidget *parent)
void AttendeeEditor::slotLineAdded(KPIM::MultiplyingLine *line)
{
auto *att = qobject_cast<AttendeeLine *>(line);
auto att = qobject_cast<AttendeeLine *>(line);
if (!att) {
return;
}
......@@ -38,7 +38,7 @@ void AttendeeEditor::slotCalculateTotal()
const QList<KPIM::MultiplyingLine *> listLines = lines();
for (KPIM::MultiplyingLine *line : listLines) {
auto *att = qobject_cast<AttendeeLine *>(line);
auto att = qobject_cast<AttendeeLine *>(line);
if (att) {
if (att->isEmpty()) {
++empty;
......@@ -83,7 +83,7 @@ void AttendeeEditor::setActions(AttendeeLine::AttendeeActions actions)
{
const QList<KPIM::MultiplyingLine *> listLines = lines();
for (KPIM::MultiplyingLine *line : listLines) {
auto *att = qobject_cast<AttendeeLine *>(line);
auto att = qobject_cast<AttendeeLine *>(line);
att->setActions(actions);
}
}
......@@ -30,7 +30,7 @@ QWidget *AttendeeLineEditDelegate::createEditor(QWidget *parent, const QStyleOpt
{
Q_UNUSED(option)
Q_UNUSED(index)
auto *editor = new AttendeeLineEdit(parent);
auto editor = new AttendeeLineEdit(parent);
connect(editor, &AttendeeLineEdit::leftPressed, this, &AttendeeLineEditDelegate::leftPressed);
connect(editor, &AttendeeLineEdit::rightPressed, this, &AttendeeLineEditDelegate::rightPressed);
editor->setToolTip(mToolTip);
......@@ -43,13 +43,13 @@ QWidget *AttendeeLineEditDelegate::createEditor(QWidget *parent, const QStyleOpt
void AttendeeLineEditDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
auto *lineedit = static_cast<AttendeeLineEdit *>(editor);
auto lineedit = static_cast<AttendeeLineEdit *>(editor);
lineedit->setText(index.model()->data(index, Qt::EditRole).toString());
}
void AttendeeLineEditDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
auto *lineedit = static_cast<AttendeeLineEdit *>(editor);
auto lineedit = static_cast<AttendeeLineEdit *>(editor);
model->setData(index, lineedit->text(), Qt::EditRole);
}
......@@ -82,7 +82,7 @@ bool AttendeeLineEditDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *v
switch (event->type()) {
#ifndef QT_NO_TOOLTIP
case QEvent::ToolTip: {
auto *he = static_cast<QHelpEvent *>(event);
auto he = static_cast<QHelpEvent *>(event);
QToolTip::showText(he->globalPos(), mToolTip, view);
return true;
}
......@@ -91,7 +91,7 @@ bool AttendeeLineEditDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *v
case QEvent::QueryWhatsThis:
return true;
case QEvent::WhatsThis: {
auto *he = static_cast<QHelpEvent *>(event);
auto he = static_cast<QHelpEvent *>(event);
QWhatsThis::showText(he->globalPos(), mWhatsThis, view);
return true;
}
......
......@@ -37,7 +37,7 @@ CategoryWidget::CategoryWidget(CategoryConfig *cc, QWidget *parent)
: QWidget(parent)
, mCategoryConfig(cc)
{
auto *topL = new QHBoxLayout(this);
auto topL = new QHBoxLayout(this);
topL->setContentsMargins(0, 0, 0, 0);
mWidgets = new CategoryWidgetBase(this);
topL->addWidget(mWidgets);
......@@ -213,7 +213,7 @@ CategoryDialog::CategoryDialog(CategoryConfig *cc, QWidget *parent)
, d(nullptr)
{
setWindowTitle(i18nc("@title:window", "Select Categories"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel /*| QDialogButtonBox::Help*/ | QDialogButtonBox::Apply, this);
......@@ -225,7 +225,7 @@ CategoryDialog::CategoryDialog(CategoryConfig *cc, QWidget *parent)
QWidget *page = new QWidget;
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
auto *lay = new QVBoxLayout(page);
auto lay = new QVBoxLayout(page);
lay->setContentsMargins(0, 0, 0, 0);
mWidgets = new CategoryWidget(cc, this);
......
......@@ -32,7 +32,7 @@ CategoryEditDialog::CategoryEditDialog(CategoryConfig *categoryConfig, QWidget *
, mCategoryConfig(categoryConfig)
{
setWindowTitle(i18nc("@title:window", "Edit Categories"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
......@@ -37,7 +37,7 @@ CategorySelectWidget::CategorySelectWidget(CategoryConfig *cc, QWidget *parent)
: QWidget(parent)
, mCategoryConfig(cc)
{
auto *topL = new QHBoxLayout(this);
auto topL = new QHBoxLayout(this);
topL->setContentsMargins(0, 0, 0, 0);
mWidgets = new CategorySelectWidgetBase(this);
topL->addWidget(mWidgets);
......@@ -151,7 +151,7 @@ CategorySelectDialog::CategorySelectDialog(CategoryConfig *cc, QWidget *parent)
, d(nullptr)
{
setWindowTitle(i18nc("@title:window", "Select Categories"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel /*| QDialogButtonBox::Help*/ | QDialogButtonBox::Apply, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
......@@ -160,7 +160,7 @@ CategorySelectDialog::CategorySelectDialog(CategoryConfig *cc, QWidget *parent)
connect(buttonBox, &QDialogButtonBox::rejected, this, &CategorySelectDialog::reject);
QWidget *page = new QWidget;
auto *lay = new QVBoxLayout(page);
auto lay = new QVBoxLayout(page);
lay->setContentsMargins(0, 0, 0, 0);
mWidgets = new CategorySelectWidget(cc, this);
......
......@@ -109,7 +109,7 @@ void ItemEditorPrivate::itemFetchResult(KJob *job)
return;
}
auto *fetchJob = qobject_cast<Akonadi::ItemFetchJob *>(job);
auto fetchJob = qobject_cast<Akonadi::ItemFetchJob *>(job);
if (fetchJob->items().isEmpty()) {
mItemUi->reject(ItemEditorUi::ItemFetchFailed);
return;
......@@ -142,7 +142,7 @@ void ItemEditorPrivate::itemMoveResult(KJob *job)
Q_Q(EditorItemManager);
if (job->error()) {
auto *moveJob = qobject_cast<Akonadi::ItemMoveJob *>(job);
auto moveJob = qobject_cast<Akonadi::ItemMoveJob *>(job);
Q_ASSERT(moveJob);
Q_UNUSED(moveJob)
// Q_ASSERT(!moveJob->items().isEmpty());
......@@ -224,7 +224,7 @@ void ItemEditorPrivate::itemChanged(const Akonadi::Item &item, const QSet<QByteA
dlg->addButton(i18n("Ignore and Overwrite changes"), QMessageBox::RejectRole);
if (dlg->exec() == QMessageBox::AcceptRole) {
auto *job = new Akonadi::ItemFetchJob(mItem);
auto job = new Akonadi::ItemFetchJob(mItem);
job->setFetchScope(mFetchScope);
mItem = item;
......@@ -288,7 +288,7 @@ void EditorItemManager::load(const Akonadi::Item &item)
Q_D(ItemEditor);
// We fetch anyways to make sure we have everything required including tags
auto *job = new Akonadi::ItemFetchJob(item, this);
auto job = new Akonadi::ItemFetchJob(item, this);
job->setFetchScope(d->mFetchScope);
connect(job, SIGNAL(result(KJob *)), SLOT(itemFetchResult(KJob *)));
}
......
......@@ -27,7 +27,7 @@ FreeBusyUrlDialog::FreeBusyUrlDialog(const AttendeeData::Ptr &attendee, QWidget
{
setModal(true);
setWindowTitle(i18nc("@title:window", "Edit Free/Busy Location"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QFrame *topFrame = new QFrame(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
......
......@@ -170,7 +170,7 @@ void IncidenceAttachment::removeSelectedAttachments()
for (int itemIndex = 0; itemIndex < mAttachmentView->count(); ++itemIndex) {
QListWidgetItem *it = mAttachmentView->item(itemIndex);
if (it->isSelected()) {
auto *attitem = static_cast<AttachmentIconItem *>(it);
auto attitem = static_cast<AttachmentIconItem *>(it);
if (attitem) {
const KCalendarCore::Attachment att = attitem->attachment();
labels << att.label();
......@@ -217,7 +217,7 @@ void IncidenceAttachment::saveAttachment(QListWidgetItem *item)
Q_ASSERT(item);
Q_ASSERT(dynamic_cast<AttachmentIconItem *>(item));
auto *attitem = static_cast<AttachmentIconItem *>(item);
auto attitem = static_cast<AttachmentIconItem *>(item);
if (attitem->attachment().isEmpty()) {
return;
}
......@@ -258,7 +258,7 @@ void IncidenceAttachment::showAttachment(QListWidgetItem *item)
{
Q_ASSERT(item);
Q_ASSERT(dynamic_cast<AttachmentIconItem *>(item));
auto *attitem = static_cast<AttachmentIconItem *>(item);
auto attitem = static_cast<AttachmentIconItem *>(item);
if (attitem->attachment().isEmpty()) {
return;
}
......@@ -323,7 +323,7 @@ void IncidenceAttachment::editSelectedAttachments()
if (item->isSelected()) {
Q_ASSERT(dynamic_cast<AttachmentIconItem *>(item));
auto *attitem = static_cast<AttachmentIconItem *>(item);
auto attitem = static_cast<AttachmentIconItem *>(item);
if (attitem->attachment().isEmpty()) {
return;
}
......@@ -518,7 +518,7 @@ void IncidenceAttachment::setupAttachmentIconView()
connect(mAttachmentView, &AttachmentIconView::itemSelectionChanged, this, &IncidenceAttachment::slotSelectionChanged);
connect(mAttachmentView, &AttachmentIconView::customContextMenuRequested, this, &IncidenceAttachment::showContextMenu);
auto *layout = new QGridLayout(mUi->mAttachmentViewPlaceHolder);
auto layout = new QGridLayout(mUi->mAttachmentViewPlaceHolder);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mAttachmentView);
}
......
......@@ -74,7 +74,7 @@ IncidenceAttendee::IncidenceAttendee(QWidget *parent, IncidenceDateTime *dateTim
setObjectName(QStringLiteral("IncidenceAttendee"));
auto *filterProxyModel = new AttendeeFilterProxyModel(this);
auto filterProxyModel = new AttendeeFilterProxyModel(this);
filterProxyModel->setDynamicSortFilter(true);
filterProxyModel->setSourceModel(mDataModel);
......@@ -334,7 +334,7 @@ void IncidenceAttendee::checkIfExpansionIsNeeded(const KCalendarCore::Attendee &
mGroupList.remove(attendee.uid());
if (!fullname.isEmpty()) {
auto *job = new Akonadi::ContactGroupSearchJob();
auto job = new Akonadi::ContactGroupSearchJob();
job->setQuery(Akonadi::ContactGroupSearchJob::Name, fullname);
connect(job, &Akonadi::ContactGroupSearchJob::result, this, &IncidenceAttendee::groupSearchResult);
......@@ -344,7 +344,7 @@ void IncidenceAttendee::checkIfExpansionIsNeeded(const KCalendarCore::Attendee &
void IncidenceAttendee::groupSearchResult(KJob *job)
{
auto *searchJob = qobject_cast<Akonadi::ContactGroupSearchJob *>(job);
auto searchJob = qobject_cast<Akonadi::ContactGroupSearchJob *>(job);
Q_ASSERT(searchJob);
Q_ASSERT(mMightBeGroupJobs.contains(job));
......@@ -375,7 +375,7 @@ void IncidenceAttendee::updateGroupExpand()
void IncidenceAttendee::slotGroupSubstitutionPressed()
{
for (auto it = mGroupList.cbegin(), end = mGroupList.cend(); it != end; ++it) {
auto *expandJob = new Akonadi::ContactGroupExpandJob(it.value(), this);
auto expandJob = new Akonadi::ContactGroupExpandJob(it.value(), this);
connect(expandJob, &Akonadi::ContactGroupExpandJob::result, this, &IncidenceAttendee::expandResult);
mExpandGroupJobs.insert(expandJob, it.key());
expandJob->start();
......@@ -384,7 +384,7 @@ void IncidenceAttendee::slotGroupSubstitutionPressed()
void IncidenceAttendee::expandResult(KJob *job)
{
auto *expandJob = qobject_cast<Akonadi::ContactGroupExpandJob *>(job);
auto expandJob = qobject_cast<Akonadi::ContactGroupExpandJob *>(job);
Q_ASSERT(expandJob);
Q_ASSERT(mExpandGroupJobs.contains(job));
const auto uid = mExpandGroupJobs.take(job);
......
......@@ -42,7 +42,7 @@ void IncidenceCategories::load(const KCalendarCore::Incidence::Ptr &incidence)
mMissingCategories.clear();
if (mLoadedIncidence) {
auto *fetchJob = new Akonadi::TagFetchJob(this);
auto fetchJob = new Akonadi::TagFetchJob(this);
fetchJob->fetchScope().fetchAttribute<Akonadi::TagAttribute>();
connect(fetchJob, &Akonadi::TagFetchJob::result, this, &IncidenceCategories::onTagsFetched);
}
......@@ -80,7 +80,7 @@ void IncidenceCategories::createMissingCategories()
{
for (const QString &category : qAsConst(mMissingCategories)) {
Akonadi::Tag missingTag = Akonadi::Tag::genericTag(category);
auto *createJob = new Akonadi::TagCreateJob(missingTag, this);
auto createJob = new Akonadi::TagCreateJob(missingTag, this);
connect(createJob, &Akonadi::TagCreateJob::result, this, &IncidenceCategories::onMissingTagCreated);
}
}
......@@ -103,7 +103,7 @@ void IncidenceCategories::onTagsFetched(KJob *job)
qCWarning(INCIDENCEEDITOR_LOG) << "Failed to load tags " << job->errorString();
return;
}
auto *fetchJob = static_cast<Akonadi::TagFetchJob *>(job);
auto fetchJob = static_cast<Akonadi::TagFetchJob *>(job);
const Akonadi::Tag::List jobTags = fetchJob->tags();
Q_ASSERT(mLoadedIncidence);
......@@ -127,7 +127,7 @@ void IncidenceCategories::onMissingTagCreated(KJob *job)
qCWarning(INCIDENCEEDITOR_LOG) << "Failed to create tag " << job->errorString();
return;
}
auto *createJob = static_cast<Akonadi::TagCreateJob *>(job);
auto createJob = static_cast<Akonadi::TagCreateJob *>(job);
int count = mMissingCategories.removeAll(createJob->tag().name());
Q_ASSERT(count > 0);
......
......@@ -132,7 +132,7 @@ void IncidenceDescription::setupToolBar()
KActionCollection *collection = new KActionCollection(this);
mUi->mDescriptionEdit->richTextComposer()->createActions(collection);
auto *mEditToolBar = new KToolBar(mUi->mEditToolBarPlaceHolder);
auto mEditToolBar = new KToolBar(mUi->mEditToolBarPlaceHolder);
mEditToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
mEditToolBar->addAction(collection->action(QStringLiteral("format_text_bold")));
mEditToolBar->addAction(collection->action(QStringLiteral("format_text_italic")));
......@@ -162,7 +162,7 @@ void IncidenceDescription::setupToolBar()
mEditToolBar->addAction(collection->action(QStringLiteral("manage_link")));
mUi->mDescriptionEdit->richTextComposer()->setEnableActions(false);
auto *layout = new QGridLayout(mUi->mEditToolBarPlaceHolder);
auto layout = new QGridLayout(mUi->mEditToolBarPlaceHolder);
layout->addWidget(mEditToolBar);
#endif
......
......@@ -117,7 +117,7 @@ IncidenceDialogPrivate::IncidenceDialogPrivate(Akonadi::IncidenceChanger *change
Q_Q(IncidenceDialog);
mUi->setupUi(q);
mUi->mMessageWidget->hide();
auto *layout = new QGridLayout(mUi->mCalSelectorPlaceHolder);
auto layout = new QGridLayout(mUi->mCalSelectorPlaceHolder);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(mCalSelector);
......@@ -127,31 +127,31 @@ IncidenceDialogPrivate::IncidenceDialogPrivate(Akonadi::IncidenceChanger *change
// Now instantiate the logic of the dialog. These editors update the ui, validate
// fields and load/store incidences in the ui.
auto *ieGeneral = new IncidenceWhatWhere(mUi);
auto ieGeneral = new IncidenceWhatWhere(mUi);
mEditor->combine(ieGeneral);
auto *ieCategories = new IncidenceCategories(mUi);
auto ieCategories = new IncidenceCategories(mUi);
mEditor->combine(ieCategories);
mIeDateTime = new IncidenceDateTime(mUi);
mEditor->combine(mIeDateTime);
auto *ieCompletionPriority = new IncidenceCompletionPriority(mUi);
auto ieCompletionPriority = new IncidenceCompletionPriority(mUi);
mEditor->combine(ieCompletionPriority);
auto *ieDescription = new IncidenceDescription(mUi);
auto ieDescription = new IncidenceDescription(mUi);
mEditor->combine(ieDescription);
auto *ieAlarm = new IncidenceAlarm(mIeDateTime, mUi);
auto ieAlarm = new IncidenceAlarm(mIeDateTime, mUi);
mEditor->combine(ieAlarm);
auto *ieAttachments = new IncidenceAttachment(mUi);
auto ieAttachments = new IncidenceAttachment(mUi);
mEditor->combine(ieAttachments);
mIeRecurrence = new IncidenceRecurrence(mIeDateTime, mUi);
mEditor->combine(mIeRecurrence);
auto *ieSecrecy = new IncidenceSecrecy(mUi);
auto ieSecrecy = new IncidenceSecrecy(mUi);
mEditor->combine(ieSecrecy);
mIeAttendee = new IncidenceAttendee(qq, mIeDateTime, mUi);
......
......@@ -27,7 +27,7 @@ IncidenceDialog *IncidenceDialogFactory::create(bool needsSaving,
case KCalendarCore::IncidenceBase::TypeEvent: // Fall through
case KCalendarCore::IncidenceBase::TypeTodo:
case KCalendarCore::IncidenceBase::TypeJournal: {
auto *dialog = new IncidenceDialog(changer, parent, flags);
auto dialog = new IncidenceDialog(changer, parent, flags);
// needs to be save to akonadi?, apply button should be turned on if so.
dialog->setInitiallyDirty(needsSaving /* mInitiallyDirty */);
......
......@@ -55,11 +55,11 @@ IncidenceResource::IncidenceResource(IncidenceAttendee *ieAttendee, IncidenceDat
attrs << QStringLiteral("cn") << QStringLiteral("mail");
completer = new QCompleter(this);
auto *model = new ResourceModel(attrs, this);
auto model = new ResourceModel(attrs, this);
auto *proxyModel = new KDescendantsProxyModel(this);
auto proxyModel = new KDescendantsProxyModel(this);
proxyModel->setSourceModel(model);
auto *proxyModel2 = new SwitchRoleProxy(this);
auto proxyModel2 = new SwitchRoleProxy(this);
proxyModel2->setSourceModel(proxyModel);
completer->setModel(proxyModel2);
......@@ -67,9 +67,9 @@ IncidenceResource::IncidenceResource(IncidenceAttendee *ieAttendee, IncidenceDat
completer->setWrapAround(false);
mUi->mNewResource->setCompleter(completer);
auto *attendeeDelegate = new AttendeeLineEditDelegate(this);
auto attendeeDelegate = new AttendeeLineEditDelegate(this);
auto *filterProxyModel = new ResourceFilterProxyModel(this);
auto filterProxyModel = new ResourceFilterProxyModel(this);
filterProxyModel->setDynamicSortFilter(true);
filterProxyModel->setSourceModel(dataModel);
......
......@@ -251,7 +251,7 @@ Akonadi::ITIPHandlerDialogDelegate *IndividualMailComponentFactory::createITIPHa
KCalendarCore::iTIPMethod method,
QWidget *parent)
{
auto *askDelegator = new IndividualMailITIPHandlerDialogDelegate(incidence, method, parent);
auto askDelegator = new IndividualMailITIPHandlerDialogDelegate(incidence, method, parent);
connect(askDelegator, &IndividualMailITIPHandlerDialogDelegate::setEdit, this, &IndividualMailComponentFactory::onSetEdit);
connect(askDelegator, &IndividualMailITIPHandlerDialogDelegate::setUpdate, this, &IndividualMailComponentFactory::onSetUpdate);
......
......@@ -24,11 +24,11 @@ IndividualMailDialog::IndividualMailDialog(const QString &question,
{
setWindowTitle(i18nc("@title:window", "Group Scheduling Email"));
m_detailsWidget = new QWidget();
auto *layout = new QGridLayout(m_detailsWidget);
auto layout = new QGridLayout(m_detailsWidget);
mAttendeeDecision.reserve(attendees.size());
int row = 0;
for (const KCalendarCore::Attendee &attendee : attendees) {
auto *options = new QComboBox();
auto options = new QComboBox();
options->addItem(i18nc("@item:inlistbox ITIP Messages for one attendee", "Send update"), QVariant(Update));
options->addItem(i18nc("@item:inlistbox ITIP Messages for one attendee", "Send no update"), QVariant(NoUpdate));
options->addItem(i18nc("@item:inlistbox ITIP Messages for one attendee", "Edit mail"), QVariant(Edit));
......
......@@ -109,7 +109,7 @@ ResourceManagement::ResourceManagement(QWidget *parent)
QWidget *w = new QWidget(this);
mUi->setupUi(w);
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(w);
mainLayout->addWidget(buttonBox);
......@@ -119,7 +119,7 @@ ResourceManagement::ResourceManagement(QWidget *parent)
mAgendaView = new EventViews::AgendaView(QDate(), QDate(), false, false);
auto *fbCalendar = new FreebusyViewCalendar();
auto fbCalendar = new FreebusyViewCalendar();
fbCalendar->mCalendar = mFreebusyCalendar.calendar();
mFbCalendar = EventViews::ViewCalendar::Ptr(fbCalendar);
mAgendaView->addCalendar(mFbCalendar);
......@@ -129,7 +129,7 @@ ResourceManagement::ResourceManagement(QWidget *parent)
QStringList attrs;
attrs << QStringLiteral("cn") << QStringLiteral("mail") << QStringLiteral("owner") << QStringLiteral("givenname") << QStringLiteral("sn")
<< QStringLiteral("kolabDescAttribute") << QStringLiteral("description");
auto *resourcemodel = new ResourceModel(attrs, this);
auto resourcemodel = new ResourceModel(attrs, this);
mUi->treeResults->setModel(resourcemodel);
// This doesn't work till now :(-> that's why i use the click signal
......
......@@ -77,7 +77,7 @@ Qt::ItemFlags ResourceModel::flags(const QModelIndex &index) const
ResourceItem *ResourceModel::getItem(const QModelIndex &index) const
{
if (index.isValid()) {
auto *item = static_cast<ResourceItem *>(index.internalPointer());
auto item = static_cast<ResourceItem *>(index.internalPointer());
if (item) {
return item;
}
......