Commit 2c2c7cb8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: fix "auto *foo" -> "auto foo"

parent 1c5d7102
Pipeline #44882 passed with stage
in 12 minutes and 5 seconds
......@@ -1166,7 +1166,7 @@ bool AgendaItem::event(QEvent *event)
if (!mEventView->preferences()->enableToolTips()) {
return true;
} else if (mValid) {
auto *helpEvent = static_cast<QHelpEvent *>(event);
auto helpEvent = static_cast<QHelpEvent *>(event);
QToolTip::showText(
helpEvent->globalPos(),
KCalUtils::IncidenceFormatter::toolTipStr(
......
......@@ -749,19 +749,19 @@ void AgendaView::init(QDate start, QDate end)
}
// The widget itself
auto *allDayScrollArea = new AgendaScrollArea(true, this, d->mIsInteractive,
auto allDayScrollArea = new AgendaScrollArea(true, this, d->mIsInteractive,
d->mAllDayFrame);
allDayFrameLayout->addWidget(allDayScrollArea);
d->mAllDayAgenda = allDayScrollArea->agenda();
/* Create the main agenda widget and the related widgets */
QWidget *agendaFrame = new QWidget(d->mSplitterAgenda);
auto *agendaLayout = new QHBoxLayout(agendaFrame);
auto agendaLayout = new QHBoxLayout(agendaFrame);
agendaLayout->setContentsMargins(0, 0, 0, 0);
agendaLayout->setSpacing(SPACING);
// Create agenda
auto *scrollArea = new AgendaScrollArea(false, this, d->mIsInteractive,
auto scrollArea = new AgendaScrollArea(false, this, d->mIsInteractive,
agendaFrame);
d->mAgenda = scrollArea->agenda();
......@@ -774,7 +774,7 @@ void AgendaView::init(QDate start, QDate end)
// This timeLabelsZoneLayout is for adding some spacing
// to align timelabels, to agenda's grid
auto *timeLabelsZoneLayout = new QVBoxLayout();
auto timeLabelsZoneLayout = new QVBoxLayout();
agendaLayout->addLayout(timeLabelsZoneLayout);
agendaLayout->addWidget(scrollArea);
......@@ -1052,7 +1052,7 @@ void AgendaView::zoomView(const int delta, const QPoint &pos, const Qt::Orientat
{
// TODO find out why this is necessary. seems to be some kind of performance hack
static QDate zoomDate;
static auto *t = new QTimer(this);
static auto t = new QTimer(this);
//Zoom to the selected incidence, on the other way
// zoom to the date on screen after the first mousewheel move.
......@@ -1130,7 +1130,7 @@ void AgendaView::placeDecorations(DecorationList &decoList, const QDate &date, Q
decoHBox->setMinimumWidth(1);
for (CalendarDecoration::Element *it : elements) {
auto *label = new DecorationLabel(it, decoHBox);
auto label = new DecorationLabel(it, decoHBox);
label->setAlignment(Qt::AlignBottom);
label->setMinimumWidth(1);
layout->addWidget(label);
......@@ -1253,7 +1253,7 @@ void AgendaView::createDayLabels(bool force)
#endif
}
auto *rightSpacer = new QSpacerItem(d->mAllDayAgenda->scrollArea()->frameWidth(),
auto rightSpacer = new QSpacerItem(d->mAllDayAgenda->scrollArea()->frameWidth(),
1, QSizePolicy::Fixed);
d->mLayoutTopDayLabels->addSpacerItem(rightSpacer);
......@@ -1420,7 +1420,7 @@ void AgendaView::createTimeBarHeaders()
const auto lst = d->mTimeLabelsZone->timeLabels();
for (QScrollArea *area : lst) {
auto *timeLabel = static_cast<TimeLabels *>(area->widget());
auto timeLabel = static_cast<TimeLabels *>(area->widget());
QLabel *label
= new QLabel(timeLabel->header().replace(QLatin1Char('/'), QStringLiteral("/ ")),
d->mTimeBarHeaderFrame);
......
......@@ -415,7 +415,7 @@ QString TimeLabels::headerToolTip() const
bool TimeLabels::event(QEvent *event)
{
if (event->type() == QEvent::ToolTip) {
auto *helpEvent = static_cast<QHelpEvent *>(event);
auto helpEvent = static_cast<QHelpEvent *>(event);
const int cell = yposToCell(helpEvent->pos().y());
QString toolTip;
......
......@@ -66,8 +66,8 @@ void TimeLabelsZone::init()
void TimeLabelsZone::addTimeLabels(const QTimeZone &zone)
{
auto *area = new QScrollArea(this);
auto *labels = new TimeLabels(zone, 24, this);
auto area = new QScrollArea(this);
auto labels = new TimeLabels(zone, 24, this);
mTimeLabelsList.prepend(area);
area->setWidgetResizable(true);
area->setWidget(labels);
......@@ -94,7 +94,7 @@ void TimeLabelsZone::setupTimeLabel(QScrollArea *area)
area->verticalScrollBar()->setValue(mAgenda->verticalScrollBar()->value());
}
auto *timeLabels = static_cast<TimeLabels *>(area->widget());
auto timeLabels = static_cast<TimeLabels *>(area->widget());
timeLabels->setAgenda(mAgenda);
// timelabel's scroll is just a slave, this shouldn't be here
......@@ -116,7 +116,7 @@ int TimeLabelsZone::preferedTimeLabelsWidth() const
void TimeLabelsZone::updateAll()
{
for (QScrollArea *area : qAsConst(mTimeLabelsList)) {
auto *timeLabel = static_cast<TimeLabels *>(area->widget());
auto timeLabel = static_cast<TimeLabels *>(area->widget());
timeLabel->updateConfig();
}
}
......@@ -141,7 +141,7 @@ void TimeLabelsZone::updateTimeLabelsPosition()
if (mAgenda) {
const auto lst = timeLabels();
for (QScrollArea *area : lst) {
auto *label = static_cast<TimeLabels *>(area->widget());
auto label = static_cast<TimeLabels *>(area->widget());
const int adjustment = mAgenda->contentsY();
// y() is the offset to our parent (QScrollArea)
// and gets negative as we scroll
......
......@@ -51,7 +51,7 @@ TimeScaleConfigDialog::TimeScaleConfigDialog(const PrefsPtr &preferences, QWidge
, d(new Private(this, preferences))
{
setWindowTitle(i18nc("@title:window", "Timezone"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
setModal(true);
QWidget *mainwidget = new QWidget(this);
......@@ -106,7 +106,7 @@ TimeScaleConfigDialog::TimeScaleConfigDialog(const PrefsPtr &preferences, QWidge
this, &TimeScaleConfigDialog::slotUpdateButton);
for (const TimeZoneNamePair &item : qAsConst(selList)) {
auto *widgetItem = new QListWidgetItem(item.first);
auto widgetItem = new QListWidgetItem(item.first);
widgetItem->setData(TimeZoneNameRole, item.second);
listWidget->addItem(widgetItem);
}
......
......@@ -98,7 +98,7 @@ void EventView::setHolidayRegions(const QStringList &regions)
qDeleteAll(d->mHolidayRegions);
d->mHolidayRegions.clear();
for (const QString &regionStr : regions) {
auto *region = new KHolidays::HolidayRegion(regionStr);
auto region = new KHolidays::HolidayRegion(regionStr);
if (region->isValid()) {
d->mHolidayRegions.append(region);
} else {
......@@ -529,7 +529,7 @@ void EventView::restoreConfig(const KConfigGroup &configGroup)
} else if (useCustom) {
if (!d->collectionSelectionModel) {
// Sort the calendar model on calendar name
auto *sortProxy = new QSortFilterProxyModel(this);
auto sortProxy = new QSortFilterProxyModel(this);
sortProxy->setDynamicSortFilter(true);
sortProxy->setSortCaseSensitivity(Qt::CaseInsensitive);
......@@ -538,7 +538,7 @@ void EventView::restoreConfig(const KConfigGroup &configGroup)
}
// Only show the first column.
auto *columnFilterProxy = new KRearrangeColumnsProxyModel(this);
auto columnFilterProxy = new KRearrangeColumnsProxyModel(this);
columnFilterProxy->setSourceColumns(
QVector<int>() << Akonadi::ETMCalendar::CollectionTitle);
columnFilterProxy->setSourceModel(sortProxy);
......
......@@ -41,7 +41,7 @@ void EventViews::setResourceColor(const Akonadi::Collection &coll, const QColor
auto *colorAttr
= collection.attribute<Akonadi::CollectionColorAttribute>(Akonadi::Collection::AddIfMissing);
colorAttr->setColor(color);
auto *job = new Akonadi::CollectionModifyJob(collection, nullptr);
auto job = new Akonadi::CollectionModifyJob(collection, nullptr);
QObject::connect(job, &Akonadi::CollectionModifyJob::result, [=]() {
if (job->error()) {
qCWarning(CALENDARVIEW_LOG) << "Failed to set CollectionColorAttribute:" << job->errorString();
......
......@@ -64,9 +64,9 @@ void JournalDateView::addJournal(const Akonadi::Item &j)
QWidget *container = new QWidget(this);
layout()->addWidget(container);
auto *layout = new QHBoxLayout(container);
auto layout = new QHBoxLayout(container);
layout->addStretch(1);
auto *entry = new JournalFrame(j, mCalendar, this);
auto entry = new JournalFrame(j, mCalendar, this);
layout->addWidget(entry, 3 /*stretch*/);
layout->addStretch(1);
......@@ -140,14 +140,14 @@ JournalFrame::JournalFrame(const Akonadi::Item &j, const Akonadi::ETMCalendar::P
mWriteInProgress = false;
mChanger = nullptr;
auto *verticalLayout = new QVBoxLayout(this);
auto verticalLayout = new QVBoxLayout(this);
mBrowser = new QTextBrowser(this);
mBrowser->viewport()->installEventFilter(this);
mBrowser->setFrameStyle(QFrame::NoFrame);
verticalLayout->addWidget(mBrowser);
auto *buttonsLayout = new QHBoxLayout();
auto buttonsLayout = new QHBoxLayout();
verticalLayout->addLayout(buttonsLayout);
buttonsLayout->addStretch();
......
......@@ -23,11 +23,11 @@ using namespace EventViews;
JournalView::JournalView(QWidget *parent) : EventView(parent)
{
auto *topLayout = new QVBoxLayout(this);
auto topLayout = new QVBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
mSA = new QScrollArea(this);
mCurrentWidget = new QWidget(mSA->viewport());
auto *mVBoxVBoxLayout = new QVBoxLayout(mCurrentWidget);
auto mVBoxVBoxLayout = new QVBoxLayout(mCurrentWidget);
mVBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
mSA->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
mSA->setWidgetResizable(true);
......
......@@ -79,7 +79,7 @@ public:
bool ListViewItem::operator<(const QTreeWidgetItem &other) const
{
const auto *otheritem = static_cast<const ListViewItem *>(&other);
const auto otheritem = static_cast<const ListViewItem *>(&other);
switch (treeWidget()->sortColumn()) {
case StartDateTime_Column:
......@@ -334,7 +334,7 @@ Akonadi::Item::List ListView::selectedIncidences() const
QTreeWidgetItem *item = d->mTreeWidget->selectedItems().isEmpty() ? nullptr
: d->mTreeWidget->selectedItems().first();
if (item) {
auto *i = static_cast<ListViewItem *>(item);
auto i = static_cast<ListViewItem *>(item);
eventList.append(i->mIncidence);
}
return eventList;
......@@ -437,7 +437,7 @@ void ListView::Private::addIncidence(const Akonadi::ETMCalendar::Ptr &calendar,
tinc->setReadOnly(true);
}
}
auto *item = new ListViewItem(aitem, mTreeWidget);
auto item = new ListViewItem(aitem, mTreeWidget);
// set tooltips
for (int col = 0; col < Dummy_EOF_Column; ++col) {
......@@ -511,7 +511,7 @@ ListViewItem *ListView::Private::getItemForIncidence(const Akonadi::Item &aitem)
{
int index = 0;
while (QTreeWidgetItem *it = mTreeWidget->topLevelItem(index)) {
auto *item = static_cast<ListViewItem *>(it);
auto item = static_cast<ListViewItem *>(it);
if (item->mIncidence.id() == aitem.id()) {
return item;
}
......
......@@ -80,7 +80,7 @@ void MonthItem::updateMonthGraphicsItems()
}
// A new item needs to be created
auto *newItem = new MonthGraphicsItem(this);
auto newItem = new MonthGraphicsItem(this);
mMonthGraphicsItemList << newItem;
newItem->setStartDate(start);
newItem->setDaySpan(span);
......@@ -239,7 +239,7 @@ bool MonthItem::greaterThan(const MonthItem *e1, const MonthItem *e2)
bool MonthItem::greaterThanFallback(const MonthItem *other) const
{
const auto *h = qobject_cast<const HolidayMonthItem *>(other);
const auto h = qobject_cast<const HolidayMonthItem *>(other);
// If "other" is a holiday, display it first.
return !h;
......@@ -322,7 +322,7 @@ IncidenceMonthItem::~IncidenceMonthItem()
bool IncidenceMonthItem::greaterThanFallback(const MonthItem *other) const
{
const auto *o = qobject_cast<const IncidenceMonthItem *>(other);
const auto o = qobject_cast<const IncidenceMonthItem *>(other);
if (!o) {
return MonthItem::greaterThanFallback(other);
}
......@@ -707,7 +707,7 @@ HolidayMonthItem::~HolidayMonthItem()
bool HolidayMonthItem::greaterThanFallback(const MonthItem *other) const
{
const auto *o = qobject_cast<const HolidayMonthItem *>(other);
const auto o = qobject_cast<const HolidayMonthItem *>(other);
if (o) {
return MonthItem::greaterThanFallback(other);
}
......
......@@ -496,7 +496,7 @@ void MonthScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *mouseEvent)
MonthGraphicsItem *iItem = dynamic_cast<MonthGraphicsItem *>(itemAt(pos, {}));
if (iItem) {
if (iItem->monthItem()) {
auto *tmp = qobject_cast<IncidenceMonthItem *>(iItem->monthItem());
auto tmp = qobject_cast<IncidenceMonthItem *>(iItem->monthItem());
if (tmp) {
selectItem(iItem->monthItem());
mMonthView->defaultAction(tmp->akonadiItem());
......@@ -584,7 +584,7 @@ void MonthScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
selectItem(mClickedItem);
if (mouseEvent->button() == Qt::RightButton) {
auto *tmp = qobject_cast<IncidenceMonthItem *>(mClickedItem);
auto tmp = qobject_cast<IncidenceMonthItem *>(mClickedItem);
if (tmp) {
Q_EMIT showIncidencePopupSignal(tmp->akonadiItem(), tmp->realStartDate());
}
......@@ -725,7 +725,7 @@ void MonthScene::selectItem(MonthItem *item)
Another solution would be to have two Q_SIGNALS: incidenceSelected() and incidenceClicked()
*/
auto *tmp = qobject_cast<IncidenceMonthItem *>(item);
auto tmp = qobject_cast<IncidenceMonthItem *>(item);
if (!tmp) {
mSelectedItem = nullptr;
......@@ -747,7 +747,7 @@ void MonthScene::selectItem(MonthItem *item)
void MonthScene::removeIncidence(const QString &uid)
{
for (MonthItem *manager : qAsConst(mManagerList)) {
auto *imi = qobject_cast<IncidenceMonthItem *>(manager);
auto imi = qobject_cast<IncidenceMonthItem *>(manager);
if (!imi) {
continue;
}
......
......@@ -143,12 +143,12 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
: EventView(parent)
, d(new MonthViewPrivate(this))
{
auto *topLayout = new QHBoxLayout(this);
auto topLayout = new QHBoxLayout(this);
topLayout->addWidget(d->view);
topLayout->setContentsMargins(0, 0, 0, 0);
if (visibility == Visible) {
auto *rightLayout = new QVBoxLayout();
auto rightLayout = new QVBoxLayout();
rightLayout->setSpacing(0);
rightLayout->setContentsMargins(0, 0, 0, 0);
......@@ -172,7 +172,7 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
connect(d->fullView, &QAbstractButton::clicked,
this, &MonthView::changeFullView);
auto *minusMonth = new QToolButton(this);
auto minusMonth = new QToolButton(this);
minusMonth->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up-double")));
minusMonth->setAutoRaise(true);
minusMonth->setToolTip(i18nc("@info:tooltip", "Go back one month"));
......@@ -182,7 +182,7 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
connect(minusMonth, &QAbstractButton::clicked,
this, &MonthView::moveBackMonth);
auto *minusWeek = new QToolButton(this);
auto minusWeek = new QToolButton(this);
minusWeek->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up")));
minusWeek->setAutoRaise(true);
minusWeek->setToolTip(i18nc("@info:tooltip", "Go back one week"));
......@@ -192,7 +192,7 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
connect(minusWeek, &QAbstractButton::clicked,
this, &MonthView::moveBackWeek);
auto *plusWeek = new QToolButton(this);
auto plusWeek = new QToolButton(this);
plusWeek->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down")));
plusWeek->setAutoRaise(true);
plusWeek->setToolTip(i18nc("@info:tooltip", "Go forward one week"));
......@@ -202,7 +202,7 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
connect(plusWeek, &QAbstractButton::clicked,
this, &MonthView::moveFwdWeek);
auto *plusMonth = new QToolButton(this);
auto plusMonth = new QToolButton(this);
plusMonth->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down-double")));
plusMonth->setAutoRaise(true);
plusMonth->setToolTip(i18nc("@info:tooltip", "Go forward one month"));
......@@ -267,7 +267,7 @@ KCalendarCore::DateList MonthView::selectedIncidenceDates() const
{
KCalendarCore::DateList list;
if (d->scene->selectedItem()) {
auto *tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem());
auto tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem());
if (tmp) {
QDate selectedItemDate = tmp->realStartDate();
if (selectedItemDate.isValid()) {
......@@ -453,7 +453,7 @@ Akonadi::Item::List MonthView::selectedIncidences() const
{
Akonadi::Item::List selected;
if (d->scene->selectedItem()) {
auto *tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem());
auto tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem());
if (tmp) {
Akonadi::Item incidenceSelected = tmp->akonadiItem();
if (incidenceSelected.isValid()) {
......@@ -474,7 +474,7 @@ void MonthView::reloadIncidences()
MonthItem *itemToReselect = nullptr;
if (auto *tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem())) {
if (auto tmp = qobject_cast<IncidenceMonthItem *>(d->scene->selectedItem())) {
d->selectedItemId = tmp->akonadiItem().id();
d->selectedItemDate = tmp->realStartDate();
if (!d->selectedItemDate.isValid()) {
......
......@@ -141,7 +141,7 @@ MultiAgendaView::MultiAgendaView(QWidget *parent)
: EventView(parent)
, d(new Private(this))
{
auto *topLevelLayout = new QHBoxLayout(this);
auto topLevelLayout = new QHBoxLayout(this);
topLevelLayout->setSpacing(0);
topLevelLayout->setContentsMargins(0, 0, 0, 0);
......@@ -149,7 +149,7 @@ MultiAgendaView::MultiAgendaView(QWidget *parent)
int topLabelHeight = 2 * fm.height() + fm.lineSpacing();
QWidget *topSideBox = new QWidget(this);
auto *topSideBoxVBoxLayout = new QVBoxLayout(topSideBox);
auto topSideBoxVBoxLayout = new QVBoxLayout(topSideBox);
topSideBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
QWidget *topSideSpacer = new QWidget(topSideBox);
......@@ -164,7 +164,7 @@ MultiAgendaView::MultiAgendaView(QWidget *parent)
d->mLabel->setWordWrap(true);
QWidget *sideBox = new QWidget(d->mLeftSplitter);
auto *sideBoxVBoxLayout = new QVBoxLayout(sideBox);
auto sideBoxVBoxLayout = new QVBoxLayout(sideBox);
sideBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
// compensate for the frame the agenda views but not the timelabels have
......@@ -195,7 +195,7 @@ MultiAgendaView::MultiAgendaView(QWidget *parent)
d->mScrollArea->setFrameShape(QFrame::NoFrame);
topLevelLayout->addWidget(d->mScrollArea, 100);
d->mTopBox = new QWidget(d->mScrollArea->viewport());
auto *mTopBoxHBoxLayout = new QHBoxLayout(d->mTopBox);
auto mTopBoxHBoxLayout = new QHBoxLayout(d->mTopBox);
mTopBoxHBoxLayout->setContentsMargins(0, 0, 0, 0);
d->mScrollArea->setWidget(d->mTopBox);
......@@ -468,7 +468,7 @@ AgendaView *MultiAgendaView::Private::createView(const QString &title)
{
QWidget *box = new QWidget(mTopBox);
mTopBox->layout()->addWidget(box);
auto *layout = new QVBoxLayout(box);
auto layout = new QVBoxLayout(box);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(new ElidedLabel(title));
AgendaView *av = new AgendaView(q->preferences(),
......@@ -574,7 +574,7 @@ void MultiAgendaView::resizeSplitters()
return;
}
auto *lastMovedSplitter = qobject_cast<QSplitter *>(sender());
auto lastMovedSplitter = qobject_cast<QSplitter *>(sender());
if (!lastMovedSplitter) {
lastMovedSplitter = d->mLeftSplitter;
}
......@@ -688,22 +688,22 @@ void MultiAgendaView::doRestoreConfig(const KConfigGroup &configGroup)
d->mCollectionSelectionModels.resize(d->mCustomNumberOfColumns);
for (int i = 0; i < d->mCustomNumberOfColumns; ++i) {
// Sort the calanders by name
auto *sortProxy = new QSortFilterProxyModel(this);
auto sortProxy = new QSortFilterProxyModel(this);
sortProxy->setDynamicSortFilter(true);
sortProxy->setSourceModel(calendar()->entityTreeModel());
// Only show the first column
auto *columnFilterProxy = new KRearrangeColumnsProxyModel(this);
auto columnFilterProxy = new KRearrangeColumnsProxyModel(this);
columnFilterProxy->setSourceColumns(
QVector<int>() << Akonadi::ETMCalendar::CollectionTitle);
columnFilterProxy->setSourceModel(sortProxy);
// Keep track of selection.
auto *qsm = new QItemSelectionModel(columnFilterProxy);
auto qsm = new QItemSelectionModel(columnFilterProxy);
// Make the model checkable.
auto *checkableProxy = new KCheckableProxyModel(this);
auto checkableProxy = new KCheckableProxyModel(this);
checkableProxy->setSourceModel(columnFilterProxy);
checkableProxy->setSelectionModel(qsm);
const QString groupName
......
......@@ -25,7 +25,7 @@ TimelineItem::TimelineItem(const Akonadi::ETMCalendar::Ptr &calendar, uint index
, mIndex(index)
{
mModel->removeRow(mIndex);
auto *dummyItem = new QStandardItem;
auto dummyItem = new QStandardItem;
dummyItem->setData(KGantt::TypeTask, KGantt::ItemTypeRole);
mModel->insertRow(mIndex, dummyItem);
}
......@@ -54,7 +54,7 @@ void TimelineItem::insertIncidence(const Akonadi::Item &aitem, const QDateTime &
}
}
auto *item = new TimelineSubItem(mCalendar, aitem, this);
auto item = new TimelineSubItem(mCalendar, aitem, this);
item->setStartTime(start);
item->setOriginalStart(start);
......
......@@ -208,8 +208,8 @@ TimelineView::TimelineView(QWidget *parent)
: EventView(parent)
, d(new Private(this))
{
auto *vbox = new QVBoxLayout(this);
auto *splitter = new QSplitter(Qt::Horizontal, this);
auto vbox = new QVBoxLayout(this);
auto splitter = new QSplitter(Qt::Horizontal, this);
d->mLeftView = new QTreeWidget;
d->mLeftView->setHeader(new GanttHeaderView);
d->mLeftView->setHeaderLabel(i18n("Calendar"));
......@@ -222,7 +222,7 @@ TimelineView::TimelineView(QWidget *parent)
splitter->addWidget(d->mGantt);
connect(splitter, &QSplitter::splitterMoved,
d, &Private::splitterMoved);
auto *model = new QStandardItemModel(this);
auto model = new QStandardItemModel(this);
d->mRowController = new RowController;
......@@ -234,7 +234,7 @@ TimelineView::TimelineView(QWidget *parent)
d->mRowController->setModel(model);
d->mGantt->setRowController(d->mRowController);
auto *grid = new KGantt::DateTimeGrid();
auto grid = new KGantt::DateTimeGrid();
grid->setScale(KGantt::DateTimeGrid::ScaleHour);
grid->setDayWidth(800);
grid->setRowSeparators(true);
......@@ -291,7 +291,7 @@ void TimelineView::showDates(const QDate &start, const QDate &end, const QDate &
d->mEndDate = end;
d->mHintDate = QDateTime();
auto *grid = static_cast<KGantt::DateTimeGrid *>(d->mGantt->grid());
auto grid = static_cast<KGantt::DateTimeGrid *>(d->mGantt->grid());
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
grid->setStartDateTime(QDateTime(start));
#else
......@@ -416,11 +416,11 @@ QDate TimelineView::endDate() const
bool TimelineView::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::ToolTip) {
auto *helpEvent = static_cast<QHelpEvent *>(event);
auto helpEvent = static_cast<QHelpEvent *>(event);
QGraphicsItem *item = d->mGantt->itemAt(helpEvent->pos());
if (item) {
if (item->type() == KGantt::GraphicsItem::Type) {
auto *graphicsItem = static_cast<KGantt::GraphicsItem *>(item);
auto graphicsItem = static_cast<KGantt::GraphicsItem *>(item);
const QModelIndex itemIndex = graphicsItem->index();
auto *itemModel
......
......@@ -41,7 +41,7 @@ void TodoCompleteDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
if (index.data(Qt::EditRole).toInt() > 0) {
bool isEditing = false;
auto *view = qobject_cast<TodoViewView *>(parent());
auto view = qobject_cast<TodoViewView *>(parent());
if (view) {
isEditing = view->isEditing(index);
}
......@@ -91,7 +91,7 @@ QWidget *TodoCompleteDelegate::createEditor(QWidget *parent, const QStyleOptionV
Q_UNUSED(option);
Q_UNUSED(index);
auto *slider = new TodoCompleteSlider(parent);
auto slider = new TodoCompleteSlider(parent);
slider->setRange(0, 100);
slider->setOrientation(Qt::Horizontal);
......@@ -101,14 +101,14 @@ QWidget *TodoCompleteDelegate::createEditor(QWidget *parent, const QStyleOptionV
void TodoCompleteDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
auto *slider = static_cast<QSlider *>(editor);
auto slider = static_cast<QSlider *>(editor);
slider->setValue(index.data(Qt::EditRole).toInt());
}
void TodoCompleteDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
auto *slider = static_cast<QSlider *>(editor);
auto slider = static_cast<QSlider *>(editor);
model->setData(index, slider->value());
}
......@@ -150,7 +150,7 @@ QWidget *TodoPriorityDelegate::createEditor(QWidget *parent, const QStyleOptionV
Q_UNUSED(option);
Q_UNUSED(index);
auto *combo = new QComboBox(parent);
auto combo = new QComboBox(parent);
combo->addItem(i18nc("@action:inmenu Unspecified priority", "unspecified"));
combo->addItem(i18nc("@action:inmenu highest priority", "1 (highest)"));
......@@ -168,14 +168,14 @@ QWidget *TodoPriorityDelegate::createEditor(QWidget *parent, const QStyleOptionV
void TodoPriorityDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const