Commit a6a125fd authored by Vincent Pinon's avatar Vincent Pinon
Browse files

clang-tidy -fix: modernize-use-auto

parent 27db4607
......@@ -524,7 +524,7 @@ void KeyframeModelList::checkConsistency()
}
}
Fun local_update = []() { return true; };
KeyframeType type = (KeyframeType)KdenliveSettings::defaultkeyframeinterp();
auto type = (KeyframeType)KdenliveSettings::defaultkeyframeinterp();
for (const auto &param : m_parameters) {
QList<GenTime> list = param.second->getKeyframePos();
for (auto &time : fullList) {
......
......@@ -782,7 +782,7 @@ void KeyframeView::copyCurrentValue(QModelIndex ix, const QString paramName)
const QStringList vals = val.split(QLatin1Char(' '));
int offset = pCore->getItemIn(m_model->getOwnerId());
qDebug()<<"=== COPYING VALS: "<<val<<", PARAM NAME_ "<<paramName;
QUndoCommand *parentCommand = new QUndoCommand();
auto *parentCommand = new QUndoCommand();
for (int kf : m_selectedKeyframes) {
QString oldValue = m_model->getInterpolatedValue(kf, ix).toString();
QStringList oldVals = oldValue.split(QLatin1Char(' '));
......
......@@ -249,7 +249,7 @@ void AssetParameterView::refresh(const QModelIndex &topLeft, const QModelIndex &
max = qMin(max, (size_t)bottomRight.row());
}
Q_ASSERT(max < m_widgets.size());
for (size_t i = (size_t)topLeft.row(); i <= max; ++i) {
for (auto i = (size_t)topLeft.row(); i <= max; ++i) {
m_widgets[i]->slotRefresh();
}
}
......
......@@ -491,12 +491,12 @@ ColorWheel::ColorWheel(QString id, QString name, NegQColor color, QWidget *paren
{
QFontInfo info(font());
int unitSize = info.pixelSize();
QVBoxLayout *lay = new QVBoxLayout(this);
auto *lay = new QVBoxLayout(this);
m_wheelName = new QLabel(name, this);
m_wheelName->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
lay->addWidget(m_wheelName);
m_container = new WheelContainer(id, name, color, unitSize, this);
QHBoxLayout *hb = new QHBoxLayout;
auto *hb = new QHBoxLayout;
m_redEdit = new QDoubleSpinBox(this);
m_redEdit->setPrefix(i18n("R: "));
m_redEdit->setFrame(QFrame::NoFrame);
......
......@@ -250,7 +250,7 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
QMapIterator<QPersistentModelIndex, QString> i(paramList);
while (i.hasNext()) {
i.next();
QCheckBox *cb = new QCheckBox(i.value(), this);
auto *cb = new QCheckBox(i.value(), this);
cb->setProperty("index", i.key());
l->addWidget(cb);
}
......
......@@ -280,7 +280,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackName)
updateLabel();
});
QToolButton *mute = new QToolButton(this);
auto *mute = new QToolButton(this);
mute->setDefaultAction(m_muteAction);
mute->setAutoRaise(true);
......@@ -320,7 +320,7 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackName)
});
}
QToolButton *showEffects = new QToolButton(this);
auto *showEffects = new QToolButton(this);
showEffects->setIcon(QIcon::fromTheme("autocorrection"));
showEffects->setToolTip(i18n("Open Effect Stack"));
showEffects->setAutoRaise(true);
......@@ -364,11 +364,11 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackName)
}
});
}
QVBoxLayout *lay = new QVBoxLayout;
auto *lay = new QVBoxLayout;
setContentsMargins(0, 0, 0, 0);
lay->setContentsMargins(0, 0, 0, 0);
lay->addWidget(m_trackLabel);
QHBoxLayout *buttonslay = new QHBoxLayout;
auto *buttonslay = new QHBoxLayout;
buttonslay->setSpacing(0);
buttonslay->setContentsMargins(0, 0, 0, 0);
if (m_collapse) {
......@@ -384,14 +384,14 @@ void MixerWidget::buildUI(Mlt::Tractor *service, const QString &trackName)
buttonslay->addWidget(showEffects);
lay->addLayout(buttonslay);
if (m_balanceSlider) {
QGridLayout *balancelay = new QGridLayout;
auto *balancelay = new QGridLayout;
balancelay->addWidget(m_balanceSlider, 0, 0, 1, 3);
balancelay->addWidget(labelLeft, 1, 0, 1, 1);
balancelay->addWidget(m_balanceSpin, 1, 1, 1, 1);
balancelay->addWidget(labelRight, 1, 2, 1, 1);
lay->addLayout(balancelay);
}
QHBoxLayout *hlay = new QHBoxLayout;
auto *hlay = new QHBoxLayout;
hlay->addWidget(m_audioMeterWidget.get());
hlay->addWidget(m_volumeSlider);
lay->addLayout(hlay);
......
......@@ -1324,7 +1324,7 @@ bool Bin::eventFilter(QObject *obj, QEvent *event)
if (idx.isValid() && idx.column() == 0 && m_proxyModel) {
std::shared_ptr<AbstractProjectItem> item = m_itemModel->getBinItemByIndex(m_proxyModel->mapToSource(idx));
if (item->itemType() == AbstractProjectItem::FolderItem) {
QTreeView *tView = static_cast<QTreeView *>(m_itemView);
auto *tView = static_cast<QTreeView *>(m_itemView);
QRect r = tView->visualRect(idx);
if (mouseEvent->pos().x() < r.x()) {
if (!tView->isExpanded(idx)) {
......
......@@ -89,8 +89,8 @@ void DragButton::mouseMoveEvent(QMouseEvent *event)
return;
}
QDrag *drag = new QDrag(this);
QMimeData *mimeData = new QMimeData;
auto *drag = new QDrag(this);
auto *mimeData = new QMimeData;
mimeData->setData(QStringLiteral("kdenlive/tag"), m_tag.toUtf8());
drag->setPixmap(defaultAction()->icon().pixmap(22, 22));
drag->setMimeData(mimeData);
......@@ -124,10 +124,10 @@ TagWidget::TagWidget(QWidget *parent)
: QWidget(parent)
{
setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
QHBoxLayout *lay = new QHBoxLayout;
auto *lay = new QHBoxLayout;
lay->setContentsMargins(2, 0, 2, 0);
lay->addStretch(10);
QToolButton *config = new QToolButton(this);
auto *config = new QToolButton(this);
QAction *ca = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18n("Configure"), this);
config->setAutoRaise(true);
config->setDefaultAction(ca);
......@@ -149,7 +149,7 @@ void TagWidget::setTagData(const QString tagData)
void TagWidget::rebuildTags(QMap <QString, QString> newTags)
{
QHBoxLayout *lay = static_cast<QHBoxLayout *>(layout());
auto *lay = static_cast<QHBoxLayout *>(layout());
qDeleteAll(tags);
tags.clear();
int ix = 1;
......@@ -180,7 +180,7 @@ void TagWidget::showTagsConfig()
const QString color = tb->tag();
const QString desc = tb->description();
QIcon ic = tb->icon();
QListWidgetItem *item = new QListWidgetItem(ic, desc, &list);
auto *item = new QListWidgetItem(ic, desc, &list);
item->setData(Qt::UserRole, color);
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
}
......
......@@ -2007,7 +2007,7 @@ void KdenliveSettingsDialog::downloadModelFinished(KJob* job)
qDebug()<<"=== DOWNLOAD FINISHED!!";
if (job->error() == 0 || job->error() == 112) {
qDebug()<<"=== NO ERROR ON DWNLD!!";
KIO::FileCopyJob *jb = static_cast<KIO::FileCopyJob*>(job);
auto *jb = static_cast<KIO::FileCopyJob*>(job);
if (jb) {
qDebug()<<"=== JOB FOUND!!";
QString archiveFile = jb->destUrl().toLocalFile();
......
......@@ -42,7 +42,7 @@ bool ShiftEnterFilter::eventFilter(QObject *obj, QEvent *event)
{
if(event->type() == QEvent::KeyPress)
{
QKeyEvent *keyEvent = static_cast <QKeyEvent*> (event);
auto *keyEvent = static_cast <QKeyEvent*> (event);
if((keyEvent->modifiers() & Qt::ShiftModifier) && ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return))) {
emit triggerUpdate();
return true;
......
......@@ -580,7 +580,7 @@ TextBasedEdit::TextBasedEdit(QWidget *parent)
});
// Visual text editor
QVBoxLayout *l = new QVBoxLayout;
auto *l = new QVBoxLayout;
l->setContentsMargins(0, 0, 0, 0);
m_visualEditor = new VideoTextEdit(this);
m_visualEditor->installEventFilter(this);
......
......@@ -120,7 +120,7 @@ Wizard::Wizard(bool autoClose, bool appImageCheck, QWidget *parent)
QLabel *lab = new QLabel(this);
lab->setText(i18n("Converting old custom effects successful:"));
m_startLayout->addWidget(lab);
QListWidget *list = new QListWidget(this);
auto *list = new QListWidget(this);
m_startLayout->addWidget(list);
list->addItems(conversion.first);
}
......@@ -128,7 +128,7 @@ Wizard::Wizard(bool autoClose, bool appImageCheck, QWidget *parent)
QLabel *lab = new QLabel(this);
lab->setText(i18n("Converting old custom effects failed:"));
m_startLayout->addWidget(lab);
QListWidget *list = new QListWidget(this);
auto *list = new QListWidget(this);
m_startLayout->addWidget(list);
list->addItems(conversion.second);
}
......
......@@ -118,8 +118,8 @@ void EffectListWidget::editCustomAsset(const QModelIndex &index)
if (desc.contains(QLatin1Char('('))) {
desc = desc.section(QLatin1Char('('), 0, -2).simplified();
}
QLineEdit *effectName = new QLineEdit(currentName, &dialog);
QTextEdit *descriptionBox = new QTextEdit(desc, &dialog);
auto *effectName = new QLineEdit(currentName, &dialog);
auto *descriptionBox = new QTextEdit(desc, &dialog);
form.addRow(i18n("Name : "), effectName);
form.addRow(i18n("Comments : "), descriptionBox);
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
......
......@@ -132,7 +132,7 @@ CollapsibleEffectView::CollapsibleEffectView(const std::shared_ptr<EffectItemMod
QLabel *in = new QLabel(i18n("In:"), this);
in->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
layZone->addWidget(in);
QToolButton *setIn = new QToolButton(this);
auto *setIn = new QToolButton(this);
setIn->setIcon(QIcon::fromTheme(QStringLiteral("zone-in")));
setIn->setAutoRaise(true);
setIn->setToolTip(i18n("Set zone in"));
......@@ -143,7 +143,7 @@ CollapsibleEffectView::CollapsibleEffectView(const std::shared_ptr<EffectItemMod
QLabel *out = new QLabel(i18n("Out:"), this);
out->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
layZone->addWidget(out);
QToolButton *setOut = new QToolButton(this);
auto *setOut = new QToolButton(this);
setOut->setIcon(QIcon::fromTheme(QStringLiteral("zone-out")));
setOut->setAutoRaise(true);
setOut->setToolTip(i18n("Set zone out"));
......@@ -477,8 +477,8 @@ void CollapsibleEffectView::slotSaveEffect()
{
QDialog dialog(this);
QFormLayout form(&dialog);
QLineEdit *effectName = new QLineEdit(&dialog);
QTextEdit *descriptionBox = new QTextEdit(&dialog);
auto *effectName = new QLineEdit(&dialog);
auto *descriptionBox = new QTextEdit(&dialog);
QString label_Name = QString("Name : ");
form.addRow(label_Name, effectName);
QString label = QString("Comments : ");
......
......@@ -204,7 +204,7 @@ void EffectStackView::setModel(std::shared_ptr<EffectStackModel> model, const QS
connect(m_model.get(), &EffectStackModel::enabledStateChanged, this, &EffectStackView::changeEnabledState);
connect(m_model.get(), &EffectStackModel::currentChanged, this, [=](QModelIndex ix, bool active) {
m_effectsTree->setCurrentIndex(ix);
CollapsibleEffectView *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(ix));
auto *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(ix));
if (w) {
w->slotActivateEffect(active);
}
......@@ -220,7 +220,7 @@ void EffectStackView::changeEnabledState()
if (currentActive < max && currentActive > -1) {
auto item = m_model->getEffectStackRow(currentActive);
QModelIndex ix = m_model->getIndexFromItem(item);
CollapsibleEffectView *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(ix));
auto *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(ix));
w->updateScene();
}
emit updateEnabledState();
......@@ -297,7 +297,7 @@ void EffectStackView::loadEffects()
}
if (activeIndex.isValid()) {
m_effectsTree->setCurrentIndex(activeIndex);
CollapsibleEffectView *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(activeIndex));
auto *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(activeIndex));
if (w) {
w->slotActivateEffect(true);
}
......
......@@ -60,7 +60,7 @@ LayoutManagement::LayoutManagement(QObject *parent)
m_container = new QWidget(main);
m_containerGrp = new QButtonGroup(m_container);
connect(m_containerGrp, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &LayoutManagement::activateLayout);
QVBoxLayout *l1 = new QVBoxLayout;
auto *l1 = new QVBoxLayout;
l1->addStretch();
m_containerLayout = new QHBoxLayout;
m_containerLayout->setSpacing(0);
......@@ -156,7 +156,7 @@ void LayoutManagement::initializeLayouts()
QString translatedName = translatedLayoutNames.contains(layoutName) ? translatedLayoutNames.value(layoutName) : layoutName;
load->setText(i18n("Layout %1: %2", i, translatedName));
if (i < 6) {
QPushButton *lab = new QPushButton(translatedName, m_container);
auto *lab = new QPushButton(translatedName, m_container);
lab->setProperty("layoutid", layoutName);
lab->setFocusPolicy(Qt::NoFocus);
lab->setCheckable(true);
......@@ -447,7 +447,7 @@ void LayoutManagement::slotManageLayouts()
std::pair<QString, QString> names = saveLayout(state, suggestedName);
if(names.first != nullptr && names.second != nullptr && list.findItems(names.first, Qt::MatchFlag::MatchExactly).length() == 0) {
QListWidgetItem *item = new QListWidgetItem(names.first, &list);
auto *item = new QListWidgetItem(names.first, &list);
item->setData(Qt::UserRole, names.second);
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
}
......@@ -520,7 +520,7 @@ void LayoutManagement::slotManageLayouts()
} else {
visibleName = name;
}
QListWidgetItem *item = new QListWidgetItem(visibleName, &list);
auto *item = new QListWidgetItem(visibleName, &list);
item->setData(Qt::UserRole, name);
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
}
......
......@@ -260,7 +260,7 @@ void MainWindow::init()
fr->setLineWidth(1);
ctnLay->addWidget(fr);
setupActions();
LayoutManagement *layoutManager = new LayoutManagement(this);
auto *layoutManager = new LayoutManagement(this);
QDockWidget *libraryDock = addDock(i18n("Library"), QStringLiteral("library"), pCore->library());
QDockWidget *subtitlesDock = addDock(i18n("Subtitles"), QStringLiteral("Subtitles"), pCore->subtitleWidget());
......@@ -308,15 +308,15 @@ void MainWindow::init()
// Screen grab widget
QWidget *grabWidget = new QWidget(this);
QVBoxLayout *grabLayout = new QVBoxLayout;
auto *grabLayout = new QVBoxLayout;
grabWidget->setLayout(grabLayout);
QToolBar *recToolbar = new QToolBar(grabWidget);
auto *recToolbar = new QToolBar(grabWidget);
grabLayout->addWidget(recToolbar);
grabLayout->addStretch(10);
// Check number of monitors for FFmpeg screen capture
int screens = QApplication::screens().count();
if (screens > 1) {
QComboBox *screenCombo = new QComboBox(recToolbar);
auto *screenCombo = new QComboBox(recToolbar);
for (int ix = 0; ix < screens; ix++) {
screenCombo->addItem(i18n("Monitor %1", ix));
}
......@@ -350,7 +350,7 @@ void MainWindow::init()
pCore->bin()->dockWidgetInit(clipDockWidget);
// Online resources widget
ResourceWidget *onlineResources = new ResourceWidget(this);
auto *onlineResources = new ResourceWidget(this);
m_onlineResourcesDock = addDock(i18n("Online Resources"), QStringLiteral("onlineresources"), onlineResources);
connect(onlineResources, &ResourceWidget::previewClip, [&](const QString &path, const QString &title) {
m_clipMonitor->slotPreviewResource(path, title);
......@@ -489,7 +489,7 @@ void MainWindow::init()
auto *scmanager = new ScopeManager(this);
HideTitleBars *titleBars = new HideTitleBars(this);
auto *titleBars = new HideTitleBars(this);
connect(layoutManager, &LayoutManagement::updateTitleBars, titleBars, &HideTitleBars::updateTitleBars);
new DockAreaOrientationManager(this);
m_extraFactory = new KXMLGUIClient(this);
......@@ -575,7 +575,7 @@ void MainWindow::init()
loadClipActions();
// Timeline clip menu
QMenu *timelineClipMenu = new QMenu(this);
auto *timelineClipMenu = new QMenu(this);
timelineClipMenu->addAction(actionCollection()->action(QStringLiteral("edit_copy")));
timelineClipMenu->addAction(actionCollection()->action(QStringLiteral("paste_effects")));
timelineClipMenu->addAction(actionCollection()->action(QStringLiteral("delete_effects")));
......@@ -598,13 +598,13 @@ void MainWindow::init()
timelineClipMenu->addAction(actionCollection()->action(QStringLiteral("cut_timeline_clip")));
// Timeline composition menu
QMenu *compositionMenu = new QMenu(this);
auto *compositionMenu = new QMenu(this);
compositionMenu->addAction(actionCollection()->action(QStringLiteral("edit_item_duration")));
compositionMenu->addAction(actionCollection()->action(QStringLiteral("edit_copy")));
compositionMenu->addAction(actionCollection()->action(QStringLiteral("delete_timeline_clip")));
// Timeline main menu
QMenu *timelineMenu = new QMenu(this);
auto *timelineMenu = new QMenu(this);
timelineMenu->addAction(actionCollection()->action(QStringLiteral("edit_paste")));
timelineMenu->addAction(actionCollection()->action(QStringLiteral("insert_space")));
timelineMenu->addAction(actionCollection()->action(QStringLiteral("delete_space")));
......@@ -615,7 +615,7 @@ void MainWindow::init()
timelineMenu->addMenu(guideMenu);
// Timeline ruler menu
QMenu *timelineRulerMenu = new QMenu(this);
auto *timelineRulerMenu = new QMenu(this);
timelineRulerMenu->addAction(actionCollection()->action(QStringLiteral("add_guide")));
timelineRulerMenu->addAction(actionCollection()->action(QStringLiteral("edit_guide")));
timelineRulerMenu->addMenu(guideMenu);
......@@ -623,12 +623,12 @@ void MainWindow::init()
timelineRulerMenu->addAction(actionCollection()->action(QStringLiteral("add_subtitle")));
//Timeline subtitle menu
QMenu *timelineSubtitleMenu = new QMenu(this);
auto *timelineSubtitleMenu = new QMenu(this);
timelineSubtitleMenu->addAction(actionCollection()->action(QStringLiteral("edit_copy")));
timelineSubtitleMenu->addAction(actionCollection()->action(QStringLiteral("delete_subtitle_clip")));
// Timeline headers menu
QMenu *timelineHeadersMenu = new QMenu(this);
auto *timelineHeadersMenu = new QMenu(this);
timelineHeadersMenu->addAction(actionCollection()->action(QStringLiteral("insert_track")));
timelineHeadersMenu->addAction(actionCollection()->action(QStringLiteral("delete_track")));
timelineHeadersMenu->addAction(actionCollection()->action(QStringLiteral("show_track_record")));
......@@ -648,7 +648,7 @@ void MainWindow::init()
timelineHeadersMenu->addAction(normalize_channels);
QMenu *thumbsMenu = new QMenu(i18n("Thumbnails"), this);
QActionGroup *thumbGroup = new QActionGroup(this);
auto *thumbGroup = new QActionGroup(this);
QAction *inFrame = new QAction(i18n("In Frame"), thumbGroup);
inFrame->setData(QStringLiteral("2"));
inFrame->setCheckable(true);
......@@ -1142,7 +1142,7 @@ void MainWindow::setupActions()
tlsettings->addAction(splitView);
tlsettings->addAction(splitView2);
QToolButton *timelineSett = new QToolButton(this);
auto *timelineSett = new QToolButton(this);
timelineSett->setPopupMode(QToolButton::InstantPopup);
timelineSett->setMenu(tlsettings);
timelineSett->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
......
......@@ -431,7 +431,7 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
// Proxy
QString proxy = m_properties->get("kdenlive:proxy");
m_originalProperties.insert(QStringLiteral("kdenlive:proxy"), proxy);
QHBoxLayout *hlay = new QHBoxLayout;
auto *hlay = new QHBoxLayout;
auto *bg = new QGroupBox(this);
bg->setCheckable(false);
bg->setFlat(true);
......@@ -697,7 +697,7 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
QMapIterator<int, QString> i(audioStreamsInfo);
while (i.hasNext()) {
i.next();
QListWidgetItem *item = new QListWidgetItem(i.value(), m_audioStreamsView);
auto *item = new QListWidgetItem(i.value(), m_audioStreamsView);
// Store stream index
item->setData(Qt::UserRole, i.key());
// Store oringinal name
......@@ -815,7 +815,7 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
// Audio effects
m_audioEffectGroup = new QGroupBox(this);
m_audioEffectGroup->setEnabled(false);
QVBoxLayout *vbox = new QVBoxLayout;
auto *vbox = new QVBoxLayout;
// Normalize
m_normalize = new QCheckBox(i18n("Normalize"), this);
connect(m_normalize, &QCheckBox::stateChanged, this, [this] (int state) {
......@@ -852,7 +852,7 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
});
vbox->addWidget(m_swapChannels);
// Copy channel
QHBoxLayout *copyLay = new QHBoxLayout;
auto *copyLay = new QHBoxLayout;
copyLay->addWidget(new QLabel(i18n("Copy Channel"), this));
m_copyChannel1 = new QCheckBox(i18n("1"), this);
m_copyChannel2 = new QCheckBox(i18n("2"), this);
......@@ -883,7 +883,7 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
updateStreamIcon(m_audioStreamsView->currentRow(), m_activeAudioStreams);
});
// Gain
QHBoxLayout *gainLay = new QHBoxLayout;
auto *gainLay = new QHBoxLayout;
gainLay->addWidget(new QLabel(i18n("Gain"), this));
m_gain = new QSpinBox(this);
m_gain->setRange(-100, 60);
......
......@@ -103,7 +103,7 @@ GLWidget::GLWidget(int id, QObject *parent)
{
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setupEngine(engine());
KLocalizedContext *localizedContextObject = new KLocalizedContext(engine());
auto *localizedContextObject = new KLocalizedContext(engine());
engine()->rootContext()->setContextObject(localizedContextObject);
m_texture[0] = m_texture[1] = m_texture[2] = 0;
......
......@@ -196,7 +196,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
QSize iconSize(size, size);
m_toolbar->setIconSize(iconSize);
QComboBox *scalingAction = new QComboBox(this);
auto *scalingAction = new QComboBox(this);
scalingAction->setToolTip(i18n("Preview resolution - lower resolution means faster preview"));
// Combobox padding is bad, so manually add a space before text
scalingAction->addItems({QStringLiteral(" ") + i18n("1:1"),QStringLiteral(" ") + i18n("720p"),QStringLiteral(" ") + i18n("540p"),QStringLiteral(" ") + i18n("360p"),QStringLiteral(" ") + i18n("270p")});
......
......@@ -190,11 +190,11 @@ mlt_image_format native_format = get_image_format();
const char* formatName = mlt_image_format_name( format );
// Convert to non-const so that the cache can be accessed/modified while
// under lock.
FrameData* nonConstData = const_cast<FrameData*>(d.data());
auto* nonConstData = const_cast<FrameData*>(d.data());
nonConstData->m.lock();
Mlt::Frame* cacheFrame = static_cast<Mlt::Frame*>(nonConstData->f.get_data(formatName));
auto* cacheFrame = static_cast<Mlt::Frame*>(nonConstData->f.get_data(formatName));
if (cacheFrame == nullptr) {
// A cached image does not exist, create one.
// Make a non-deep clone of the frame (including convert function)
......
......@@ -394,7 +394,7 @@ void ProviderModel::slotStartSearch(const QString &searchText, const int page)
if(m_search["req"].toObject()["method"].toString() == "GET") {
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
auto *manager = new QNetworkAccessManager(this);
QNetworkRequest request(uri);
......@@ -529,7 +529,7 @@ void ProviderModel::slotFetchFiles(const QString &id) {
if(m_download["req"].toObject()["method"].toString() == "GET") {
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
auto *manager = new QNetworkAccessManager(this);
QNetworkRequest request(uri);
......
......@@ -648,7 +648,7 @@ void TemporaryData::buildGlobalCacheDialog(int minHeight)
lay->addWidget(sep);
// Proxy data
QHBoxLayout *hLay = new QHBoxLayout;
auto *hLay = new QHBoxLayout;
lab = new QLabel(i18n("Total Proxy Data"), this);
hLay->addWidget(lab);
m_totalProxySize = new QLabel(i18n("Calculating..."), this);
......@@ -714,7 +714,7 @@ void TemporaryData::buildGlobalCacheDialog(int minHeight)
// Config cleanup age
hLay = new QHBoxLayout;
hLay->addWidget(new QLabel(i18n("Cleanup will delete data older than"), this));
QSpinBox *age = new QSpinBox(this);
auto *age = new QSpinBox(this);
age->setRange(1, 48);
age->setSuffix(i18np(" month", " months", KdenliveSettings::cleanCacheMonths()));
age->setValue(KdenliveSettings::cleanCacheMonths());
......
......@@ -2191,7 +2191,7 @@ bool TimelineModel::requestGroupMove(int itemId, int groupId, int delta_track, i
// Move subtitles
if (!sorted_subtitles.empty()) {
std::vector<std::pair<int, GenTime>>::iterator ptr;
std::vector<std::pair<int, GenTime>>::iterator last = std::prev(sorted_subtitles.end());
auto last = std::prev(sorted_subtitles.end());
for (ptr = sorted_subtitles.begin(); ptr < sorted_subtitles.end(); ptr++) {
requestSubtitleMove((*ptr).first, (*ptr).second.frames(pCore->getCurrentFps()) + delta_pos, updateView, ptr == sorted_subtitles.begin(), ptr == last, finalMove, local_undo, local_redo);
}
......@@ -3217,7 +3217,7 @@ int TimelineModel::requestClipsGroup(const std::unordered_set<int> &ids, Fun &un
}
if (ids.size() == 2 && clipsCount == 2 && type == GroupType::Normal) {
// Check if we are grouping an AVSplit
std::unordered_set<int>::const_iterator it = ids.begin();
auto it = ids.begin();
int firstId = *it;
std::advance(it, 1);
int secondId = *it;
......
......@@ -60,7 +60,7 @@ SpeedDialog::SpeedDialog(QWidget *parent, double speed, int duration, double min
}
// Info widget
KMessageWidget *infoMessage = new KMessageWidget(this);
auto *infoMessage = new KMessageWidget(this);
ui->infoLayout->addWidget(infoMessage);
infoMessage->hide();
ui->speedSpin->setFocus();
......
......@@ -79,7 +79,7 @@ void TrackDialog::buildCombo()
}
const QString trackName = m_model->getTrackFullName(tid);
if (m_deleteMode) {
QListWidgetItem *track = new QListWidgetItem(audioTrack ? audioIcon : videoIcon,trackName);
auto *track = new QListWidgetItem(audioTrack ? audioIcon : videoIcon,trackName);
m_idByTrackname.insert(trackName,tid);
track->setFlags(track->flags() | Qt::ItemIsUserCheckable);
track->setCheckState(Qt::Unchecked);
......
......@@ -2682,7 +2682,7 @@ void TimelineController::alignAudio(int clipId)
}
processed ++;
// Perform audio calculation