Commit 387199e1 authored by Nicolas Carion's avatar Nicolas Carion

Some clang-tidy checks

parent 9ecd76eb
......@@ -120,7 +120,7 @@ int main(int argc, char **argv)
}
qDebug() << "//STARTING RENDERING: " << erase << ',' << usekuiserver << ',' << render << ',' << profile << ',' << rendermodule << ',' << player << ',' << src << ',' << dest << ',' << preargs << ',' << args << ',' << in << ',' << out;
RenderJob *job = new RenderJob(doerase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
auto *job = new RenderJob(doerase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
if (!locale.isEmpty()) {
job->setLocale(locale);
}
......
......@@ -144,7 +144,7 @@ void RenderJob::receivedStderr()
m_progress = 50 + m_progress / 2.0;
}
int frame = result.section(QLatin1Char(','), 1).section(QLatin1Char(' '), -1).toInt();
if (m_kdenliveinterface && m_kdenliveinterface->isValid()) {
if ((m_kdenliveinterface != nullptr) && m_kdenliveinterface->isValid()) {
m_dbusargs[1] = m_progress;
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingProgress"), m_dbusargs);
}
......@@ -169,7 +169,7 @@ void RenderJob::receivedStderr()
void RenderJob::start()
{
QDBusConnectionInterface *interface = QDBusConnection::sessionBus().interface();
if (interface && m_usekuiserver) {
if ((interface != nullptr) && m_usekuiserver) {
if (!interface->isServiceRegistered(QStringLiteral("org.kde.JobViewServer"))) {
qWarning() << "No org.kde.JobViewServer registered, trying to start kuiserver";
if (QProcess::startDetached(QStringLiteral("kuiserver"))) {
......@@ -192,7 +192,7 @@ void RenderJob::start()
// Use of the KDE JobViewServer is an ugly hack, it is not reliable
QString dbusView = QStringLiteral("org.kde.JobViewV2");
m_jobUiserver = new QDBusInterface(QStringLiteral("org.kde.JobViewServer"), reply, dbusView);
if (m_jobUiserver && m_jobUiserver->isValid()) {
if ((m_jobUiserver != nullptr) && m_jobUiserver->isValid()) {
m_startTime = QTime::currentTime();
if (!m_args.contains(QStringLiteral("pass=2"))) {
m_jobUiserver->call(QStringLiteral("setPercent"), (uint) 0);
......@@ -297,7 +297,7 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
QProcess::startDetached(QStringLiteral("kdialog"), args);
qApp->quit();
} else {
if (!m_dualpass && m_kdenliveinterface) {
if (!m_dualpass && (m_kdenliveinterface != nullptr)) {
m_dbusargs[1] = (int) - 1;
m_dbusargs.append(QString());
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingFinished"), m_dbusargs);
......
......@@ -38,7 +38,7 @@ int AbstractTreeModel::columnCount(const QModelIndex &parent) const
{
if (parent.isValid())
return static_cast<TreeItem*>(parent.internalPointer())->columnCount();
else
return rootItem->columnCount();
}
......@@ -94,7 +94,7 @@ QModelIndex AbstractTreeModel::index(int row, int column, const QModelIndex &par
TreeItem *childItem = parentItem->child(row);
if (childItem)
return createIndex(row, column, childItem);
else
return QModelIndex();
}
......
......@@ -38,7 +38,7 @@ TreeItem::~TreeItem()
TreeItem* TreeItem::appendChild(const QList<QVariant> &data)
{
m_model->notifyRowAboutToAppend(this);
TreeItem *child = new TreeItem(data, m_model, this);
auto *child = new TreeItem(data, m_model, this);
child->m_depth = m_depth + 1;
m_childItems.append(child);
m_model->notifyRowAppended();
......@@ -57,7 +57,7 @@ void TreeItem::appendChild(TreeItem *child)
void TreeItem::removeChild(TreeItem *child)
{
m_model->notifyRowAboutToDelete(this, child->row());
bool success = m_childItems.removeAll(child);
bool success = m_childItems.removeAll(child) != 0;
Q_ASSERT(success);
child->m_depth = 0;
child->m_parentItem = nullptr;
......
......@@ -51,9 +51,9 @@ QString AssetTreeModel::getName(const QModelIndex& index) const
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
if (item->depth() == 1) {
return item->dataColumn(0).toString();
} else {
}
return item->dataColumn(AssetTreeModel::nameCol).toString();
}
}
QString AssetTreeModel::getDescription(const QModelIndex& index) const
......@@ -64,7 +64,7 @@ QString AssetTreeModel::getDescription(const QModelIndex& index) const
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
if (item->depth() == 1) {
return QString();
} else {
}
auto id = item->dataColumn(AssetTreeModel::idCol).toString();
if (EffectsRepository::get()->exists(id)){
return EffectsRepository::get()->getDescription(id);
......@@ -73,7 +73,7 @@ QString AssetTreeModel::getDescription(const QModelIndex& index) const
return TransitionsRepository::get()->getDescription(id);
}
return QString();
}
}
......
......@@ -171,7 +171,7 @@ ParamType AssetParameterModel::paramTypeFromStr(const QString & type)
{
if (type == QLatin1String("double") || type == QLatin1String("constant")) {
return ParamType::Double;
} else if (type == QLatin1String("list")) {
} if (type == QLatin1String("list")) {
return ParamType::List;
} else if (type == QLatin1String("bool")) {
return ParamType::Bool;
......@@ -230,9 +230,9 @@ double AssetParameterModel::parseDoubleAttribute(const QString& attribute, const
sEngine.globalObject().setProperty(QStringLiteral("width"), width);
sEngine.globalObject().setProperty(QStringLiteral("height"), height);
return sEngine.evaluate(content.remove('%')).toNumber();
} else {
}
return locale.toDouble(content);
}
return -1;
}
......
......@@ -23,6 +23,7 @@
#include "transitions/view/transitionparameterview.hpp"
#include <QDebug>
#include <utility>
AssetParameterView::AssetParameterView(QWidget *parent)
: QWidget(parent)
{
......@@ -35,7 +36,7 @@ AssetParameterView::AssetParameterView(QWidget *parent)
void AssetParameterView::showTransitionParams(std::shared_ptr<AssetParameterModel> model)
{
m_transitionProperties->setVisible(true);
m_transitionProperties->setModel(model);
m_transitionProperties->setModel(std::move(model));
qDebug() <<"====================================================================="
<< "current size "<<m_transitionProperties->size() << size()
<< m_transitionProperties->sizeHint();
......
......@@ -68,7 +68,7 @@ bool AbstractProjectItem::operator==(const AbstractProjectItem *projectItem) con
{
// FIXME: only works for folders
bool equal = this->m_childItems == projectItem->m_childItems;
equal &= m_parentItem == projectItem->m_parentItem;
equal &= static_cast<int>(m_parentItem == projectItem->m_parentItem);
return equal;
}
......
This diff is collapsed.
......@@ -51,14 +51,14 @@ Generators::Generators(Monitor *monitor, const QString &path, QWidget *parent) :
if (base.tagName() == QLatin1String("generator")) {
QString generatorTag = base.attribute(QStringLiteral("tag"));
setWindowTitle(base.firstChildElement(QStringLiteral("name")).text());
QVBoxLayout *lay = new QVBoxLayout(this);
auto *lay = new QVBoxLayout(this);
m_preview = new QLabel;
m_preview->setMinimumSize(1, 1);
lay->addWidget(m_preview);
m_producer = new Mlt::Producer(*monitor->profile(), generatorTag.toUtf8().constData());
m_pixmap = QPixmap::fromImage(KThumb::getFrame(m_producer, 0, monitor->profile()->width(), monitor->profile()->height()));
m_preview->setPixmap(m_pixmap.scaledToWidth(m_preview->width()));
QHBoxLayout *hlay = new QHBoxLayout;
auto *hlay = new QHBoxLayout;
hlay->addWidget(new QLabel(i18n("Duration")));
m_timePos = new TimecodeDisplay(monitor->timecode(), this);
if (base.hasAttribute(QStringLiteral("updateonduration"))) {
......
......@@ -46,6 +46,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtConcurrent>
#include <KLocalizedString>
#include <KMessageBox>
#include <utility>
ProjectClip::ProjectClip(const QString &id, const QIcon &thumb, ProjectItemModel* model, std::shared_ptr<Mlt::Producer> producer, ProjectFolder *parent) :
AbstractProjectItem(AbstractProjectItem::ClipItem, id, model, parent)
......@@ -165,7 +166,7 @@ ClipType ProjectClip::clipType() const
bool ProjectClip::hasParent(const QString &id) const
{
AbstractProjectItem *par = parent();
while (par) {
while (par != nullptr) {
if (par->clipId() == id) {
return true;
}
......@@ -310,7 +311,7 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl
{
Q_UNUSED(replaceProducer);
updateProducer(producer);
updateProducer(std::move(producer));
// Update info
if (m_name.isEmpty()) {
......@@ -457,10 +458,7 @@ double ProjectClip::getOriginalFps() const
bool ProjectClip::hasProxy() const
{
QString proxy = getProducerProperty(QStringLiteral("kdenlive:proxy"));
if (proxy.isEmpty() || proxy == QLatin1String("-")) {
return false;
}
return true;
return !proxy.isEmpty() || proxy == QLatin1String("-");
}
void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool refreshPanel)
......@@ -879,7 +877,7 @@ void ProjectClip::slotCreateAudioThumbs()
QStringList args;
QList<QTemporaryFile *> channelFiles;
for (int i = 0; i < channels; i++) {
QTemporaryFile *channelTmpfile = new QTemporaryFile;
auto *channelTmpfile = new QTemporaryFile;
if (!channelTmpfile->open()) {
delete channelTmpfile;
static_cast<ProjectItemModel*>(m_model)->bin()->emitMessage(i18n("Cannot create temporary file, check disk space and permissions"), 100, ErrorMessage);
......@@ -995,7 +993,7 @@ void ProjectClip::slotCreateAudioThumbs()
}
}
for (int k = 0; k < channelsData.count(); k++) {
if (steps) {
if (steps != 0) {
channelsData[k] /= steps;
}
audioLevels << channelsData[k] * factor;
......@@ -1055,7 +1053,7 @@ void ProjectClip::slotCreateAudioThumbs()
last_val = val;
}
QScopedPointer<Mlt::Frame> mlt_frame(audioProducer->get_frame());
if (mlt_frame && mlt_frame->is_valid() && !mlt_frame->get_int("test_audio")) {
if ((mlt_frame != nullptr) && mlt_frame->is_valid() && (mlt_frame->get_int("test_audio") == 0)) {
int samples = mlt_sample_calculator(framesPerSecond, frequency, z);
mlt_frame->get_audio(audioFormat, frequency, channels, samples);
for (int channel = 0; channel < channels; ++channel) {
......@@ -1127,10 +1125,7 @@ bool ProjectClip::isTransparent() const
if (m_type == Text) {
return true;
}
if (m_type == Image && getProducerIntProperty(QStringLiteral("kdenlive:transparency")) == 1) {
return true;
}
return false;
return m_type == Image && getProducerIntProperty(QStringLiteral("kdenlive:transparency")) == 1;
}
QStringList ProjectClip::updatedAnalysisData(const QString &name, const QString &data, int offset)
......@@ -1139,7 +1134,7 @@ QStringList ProjectClip::updatedAnalysisData(const QString &name, const QString
// Remove data
return QStringList() << QString("kdenlive:clipanalysis." + name) << QString();
//m_controller->resetProperty("kdenlive:clipanalysis." + name);
} else {
}
QString current = getProducerProperty("kdenlive:clipanalysis." + name);
if (!current.isEmpty()) {
if (KMessageBox::questionYesNo(QApplication::activeWindow(), i18n("Clip already contains analysis data %1", name), QString(), KGuiItem(i18n("Merge")), KGuiItem(i18n("Add"))) == KMessageBox::Yes) {
......@@ -1149,7 +1144,7 @@ QStringList ProjectClip::updatedAnalysisData(const QString &name, const QString
Mlt::Geometry newGeometry(data.toUtf8().data(), duration().frames(profile->fps()), profile->width(), profile->height());
Mlt::GeometryItem item;
int pos = 0;
while (!newGeometry.next_key(&item, pos)) {
while (newGeometry.next_key(&item, pos) == 0) {
pos = item.frame();
item.frame(pos + offset);
pos++;
......@@ -1157,7 +1152,7 @@ QStringList ProjectClip::updatedAnalysisData(const QString &name, const QString
}
return QStringList() << QString("kdenlive:clipanalysis." + name) << geometry.serialise();
//m_controller->setProperty("kdenlive:clipanalysis." + name, geometry.serialise());
} else {
}
// Add data with another name
int i = 1;
QString previous = getProducerProperty("kdenlive:clipanalysis." + name + QString::number(i));
......@@ -1167,12 +1162,12 @@ QStringList ProjectClip::updatedAnalysisData(const QString &name, const QString
}
return QStringList() << QString("kdenlive:clipanalysis." + name + QString::number(i)) << geometryWithOffset(data, offset);
//m_controller->setProperty("kdenlive:clipanalysis." + name + QLatin1Char(' ') + QString::number(i), geometryWithOffset(data, offset));
}
} else {
return QStringList() << QString("kdenlive:clipanalysis." + name) << geometryWithOffset(data, offset);
//m_controller->setProperty("kdenlive:clipanalysis." + name, geometryWithOffset(data, offset));
}
}
}
QMap<QString, QString> ProjectClip::analysisData(bool withPrefix)
......@@ -1190,7 +1185,7 @@ const QString ProjectClip::geometryWithOffset(const QString &data, int offset)
Mlt::Geometry newgeometry(nullptr, duration().frames(profile->fps()), profile->width(), profile->height());
Mlt::GeometryItem item;
int pos = 0;
while (!geometry.next_key(&item, pos)) {
while (geometry.next_key(&item, pos) == 0) {
pos = item.frame();
item.frame(pos + offset);
pos++;
......@@ -1219,7 +1214,7 @@ void ProjectClip::disableEffects(bool disable)
void ProjectClip::registerTimelineClip(std::weak_ptr<TimelineModel> timeline, int clipId)
{
Q_ASSERT(m_registeredClips.count(clipId) == 0);
m_registeredClips[clipId] = timeline;
m_registeredClips[clipId] = std::move(timeline);
}
......
......@@ -85,10 +85,10 @@ QVariant ProjectItemModel::data(const QModelIndex &index, int role) const
qDebug() << "ERROR: invalid icon found";
}
return icon;
} else {
}
AbstractProjectItem *item = static_cast<AbstractProjectItem *>(index.internalPointer());
return item->getData((AbstractProjectItem::DataType) role);
}
}
bool ProjectItemModel::setData(const QModelIndex &index, const QVariant &value, int role)
......@@ -195,9 +195,9 @@ int ProjectItemModel::columnCount(const QModelIndex &parent) const
{
if (parent.isValid()) {
return static_cast<AbstractProjectItem *>(parent.internalPointer())->supportedDataCount();
} else {
}
return static_cast<ProjectFolder*>(rootItem)->supportedDataCount();
}
}
// cppcheck-suppress unusedFunction
......@@ -219,7 +219,7 @@ QMimeData *ProjectItemModel::mimeData(const QModelIndexList &indices) const
// Clip ids are represented like: 2 (where 2 is the clip's id)
// Clip zone ids are represented like: 2/10/200 (where 2 is the clip's id, 10 and 200 are in and out points)
// Folder ids are represented like: #2 (where 2 is the folder's id)
QMimeData *mimeData = new QMimeData();
auto *mimeData = new QMimeData();
QStringList list;
int duration = 0;
for (int i = 0; i < indices.count(); i++) {
......@@ -277,14 +277,14 @@ QStringList ProjectItemModel::getEnclosingFolderInfo(const QModelIndex& index) c
AbstractProjectItem *currentItem = static_cast<AbstractProjectItem *>(index.internalPointer());
auto folder = currentItem->getEnclosingFolder(true);
if (!folder || folder == rootItem) {
if ((folder == nullptr) || folder == rootItem) {
return noInfo;
} else {
}
QStringList folderInfo;
folderInfo << currentItem->clipId();
folderInfo << currentItem->name();
return folderInfo;
}
}
......
......@@ -41,10 +41,7 @@ bool ProjectSortProxyModel::filterAcceptsRow(int sourceRow,
return true;
}
//accept if any of the children is accepted on it's own merits
if (hasAcceptedChildren(sourceRow, sourceParent)) {
return true;
}
return false;
return hasAcceptedChildren(sourceRow, sourceParent);
}
bool ProjectSortProxyModel::filterAcceptsRowItself(int sourceRow,
......
......@@ -45,7 +45,7 @@ ManageCapturesDialog::ManageCapturesDialog(const QList<QUrl> &files, QWidget *pa
KFileItem file(url);
file.setDelayedMimeTypes(true);
text << KIO::convertSize(file.size());
QTreeWidgetItem *item = new QTreeWidgetItem(m_view.treeWidget, text);
auto *item = new QTreeWidgetItem(m_view.treeWidget, text);
item->setData(0, Qt::UserRole, url.toLocalFile());
item->setToolTip(0, url.toLocalFile());
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsEnabled);
......@@ -94,7 +94,7 @@ void ManageCapturesDialog::slotRefreshButtons()
bool enabled = false;
for (int i = 0; i < count; ++i) {
QTreeWidgetItem *item = m_view.treeWidget->topLevelItem(i);
if (item && item->checkState(0) == Qt::Checked) {
if ((item != nullptr) && item->checkState(0) == Qt::Checked) {
enabled = true;
break;
}
......@@ -141,7 +141,7 @@ QList<QUrl> ManageCapturesDialog::importFiles() const
const int count = m_view.treeWidget->topLevelItemCount();
for (int i = 0; i < count; ++i) {
QTreeWidgetItem *item = m_view.treeWidget->topLevelItem(i);
if (item && item->checkState(0) == Qt::Checked) {
if ((item != nullptr) && item->checkState(0) == Qt::Checked) {
result.append(QUrl(item->data(0, Qt::UserRole).toString()));
}
}
......
......@@ -78,7 +78,7 @@ bool MltDeviceCapture::buildConsumer(const QString &profileName)
char *tmp = qstrdup(m_activeProfile.toUtf8().constData());
qputenv("MLT_PROFILE", tmp);
m_mltProfile = new Mlt::Profile(tmp);
m_mltProfile->set_explicit(true);
m_mltProfile->set_explicit(1);
delete[] tmp;
QString videoDriver = KdenliveSettings::videodrivername();
......@@ -186,7 +186,7 @@ void MltDeviceCapture::stop()
m_mltProducer = nullptr;
}
// For some reason, the consumer seems to be deleted by previous stuff when in playlist mode
if (!isPlaylist && m_mltConsumer) {
if (!isPlaylist && (m_mltConsumer != nullptr)) {
delete m_mltConsumer;
}
m_mltConsumer = nullptr;
......@@ -226,7 +226,7 @@ void MltDeviceCapture::showFrame(Mlt::Frame &frame)
memcpy(qimage.scanLine(0), image, width * height * 3);
emit showImageSignal(qimage);
if (sendFrameForAnalysis && frame.get_frame()->convert_image) {
if (sendFrameForAnalysis && (frame.get_frame()->convert_image != nullptr)) {
emit frameUpdated(qimage.rgbSwapped());
}
}
......@@ -358,7 +358,7 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &pa
}
// Create multi consumer setup
Mlt::Properties *renderProps = new Mlt::Properties;
auto *renderProps = new Mlt::Properties;
renderProps->set("mlt_service", "avformat");
renderProps->set("target", path.toUtf8().constData());
renderProps->set("real_time", -KdenliveSettings::mltthreads());
......@@ -383,7 +383,7 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &pa
if (m_livePreview) {
// user wants live preview
Mlt::Properties *previewProps = new Mlt::Properties;
auto *previewProps = new Mlt::Properties;
QString videoDriver = KdenliveSettings::videodrivername();
if (!videoDriver.isEmpty()) {
if (videoDriver == QLatin1String("x11_noaccel")) {
......@@ -488,7 +488,7 @@ void MltDeviceCapture::setOverlay(const QString &path)
// Add overlay clip
char *tmp = qstrdup(path.toUtf8().constData());
Mlt::Producer *clip = new Mlt::Producer(*m_mltProfile, "loader", tmp);
auto *clip = new Mlt::Producer(*m_mltProfile, "loader", tmp);
delete[] tmp;
clip->set_in_and_out(0, 99999);
trackPlaylist.insert_at(0, clip, 1);
......@@ -501,7 +501,7 @@ void MltDeviceCapture::setOverlay(const QString &path)
if (mlt_type != QLatin1String("transition")) {
// transition does not exist, add it
Mlt::Field *field = tractor.field();
Mlt::Transition *transition = new Mlt::Transition(*m_mltProfile, "composite");
auto *transition = new Mlt::Transition(*m_mltProfile, "composite");
transition->set_in_and_out(0, 0);
transition->set("geometry", "0/0:100%x100%:70");
transition->set("fill", 1);
......@@ -530,7 +530,7 @@ void MltDeviceCapture::setOverlayEffect(const QString &tag, const QStringList &p
// delete previous effects
Mlt::Filter *filter;
filter = trackService.filter(0);
if (filter && !tag.isEmpty()) {
if ((filter != nullptr) && !tag.isEmpty()) {
QString currentService = filter->get("mlt_service");
if (currentService == tag) {
// Effect is already there
......@@ -538,7 +538,7 @@ void MltDeviceCapture::setOverlayEffect(const QString &tag, const QStringList &p
return;
}
}
while (filter) {
while (filter != nullptr) {
trackService.detach(*filter);
delete filter;
filter = trackService.filter(0);
......@@ -552,7 +552,7 @@ void MltDeviceCapture::setOverlayEffect(const QString &tag, const QStringList &p
char *tmp = qstrdup(tag.toUtf8().constData());
filter = new Mlt::Filter(*m_mltProfile, tmp);
delete[] tmp;
if (filter && filter->is_valid()) {
if ((filter != nullptr) && filter->is_valid()) {
for (int j = 0; j < parameters.count(); ++j) {
filter->set(parameters.at(j).section(QLatin1Char('='), 0, 0).toUtf8().constData(), parameters.at(j).section(QLatin1Char('='), 1, 1).toUtf8().constData());
}
......@@ -577,7 +577,7 @@ void MltDeviceCapture::mirror(bool activate)
// delete previous effects
Mlt::Filter *filter;
filter = trackService.filter(0);
while (filter) {
while (filter != nullptr) {
trackService.detach(*filter);
delete filter;
filter = trackService.filter(0);
......@@ -589,7 +589,7 @@ void MltDeviceCapture::mirror(bool activate)
}
filter = new Mlt::Filter(*m_mltProfile, "mirror");
if (filter && filter->is_valid()) {
if ((filter != nullptr) && filter->is_valid()) {
filter->set("mirror", "flip");
trackService.attach(*filter);
}
......
......@@ -55,13 +55,13 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
//return nullptr;
} else {
devName = strdup((char *) cap.card);
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0u) {
// Device cannot capture
captureEnabled = 0;
}
}
if (captureEnabled) {
if (captureEnabled != 0) {
struct v4l2_format format;
memset(&format, 0, sizeof(format));
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
......
......@@ -180,7 +180,7 @@ void ClipCreationDialog::createQTextClip(KdenliveDoc *doc, const QStringList &gr
dia_ui.font->setCurrentFont(QFont(titleConfig.readEntry(QStringLiteral("font_family"))));
dia_ui.fontSize->setValue(titleConfig.readEntry(QStringLiteral("font_pixel_size")).toInt());
dia_ui.weight->setValue(titleConfig.readEntry(QStringLiteral("font_weight")).toInt());
dia_ui.italic->setChecked(titleConfig.readEntry(QStringLiteral("font_italic")).toInt());
dia_ui.italic->setChecked(titleConfig.readEntry(QStringLiteral("font_italic")).toInt() != 0);
dia_ui.duration->setText(titleConfig.readEntry(QStringLiteral("title_duration")));
}
if (dia->exec() == QDialog::Accepted) {
......@@ -257,9 +257,9 @@ void ClipCreationDialog::createSlideshowClip(KdenliveDoc *doc, const QStringList
properties.insert(QStringLiteral("kdenlive:clipname"), dia->clipName());
properties.insert(QStringLiteral("resource"), dia->selectedPath());
properties.insert(QStringLiteral("ttl"), QString::number(doc->getFramePos(dia->clipDuration())));
properties.insert(QStringLiteral("loop"), QString::number(dia->loop()));
properties.insert(QStringLiteral("crop"), QString::number(dia->crop()));
properties.insert(QStringLiteral("fade"), QString::number(dia->fade()));
properties.insert(QStringLiteral("loop"), QString::number(static_cast<int>(dia->loop())));
properties.insert(QStringLiteral("crop"), QString::number(static_cast<int>(dia->crop())));
properties.insert(QStringLiteral("fade"), QString::number(static_cast<int>(dia->fade())));
properties.insert(QStringLiteral("luma_duration"), QString::number(doc->getFramePos(dia->lumaDuration())));
properties.insert(QStringLiteral("luma_file"), dia->lumaFile());
properties.insert(QStringLiteral("softness"), QString::number(dia->softness()));
......@@ -374,7 +374,7 @@ void ClipCreationDialog::addXmlProperties(QDomElement &producer, QMap<QString, Q
void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QList<QUrl> &urls, const QStringList &groupInfo, Bin *bin, const QMap<QString, QString> &data)
{
QUndoCommand *addClips = new QUndoCommand();
auto *addClips = new QUndoCommand();
//TODO: check files on removable volume
/*listRemovableVolumes();
......@@ -518,7 +518,7 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QStringList
c->setChecked(KdenliveSettings::autoimagetransparency());
QFrame *f = new QFrame();
f->setFrameShape(QFrame::NoFrame);
QHBoxLayout *l = new QHBoxLayout;
auto *l = new QHBoxLayout;
l->addWidget(b);
l->addWidget(c);
l->addStretch(5);
......@@ -529,7 +529,7 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QStringList
}
QDialog *dlg = new QDialog((QWidget *) doc->parent());
KFileWidget *fileWidget = new KFileWidget(QUrl::fromLocalFile(clipFolder), dlg);
QVBoxLayout *layout = new QVBoxLayout;
auto *layout = new QVBoxLayout;
layout->addWidget(fileWidget);
fileWidget->setCustomWidget(f);
fileWidget->okButton()->show();
......@@ -543,7 +543,7 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QStringList
fileWidget->setMode(KFile::Files | KFile::ExistingOnly | KFile::LocalOnly);
KSharedConfig::Ptr conf = KSharedConfig::openConfig();
QWindow *handle = dlg->windowHandle();
if (handle && conf->hasGroup("FileDialogSize")) {
if ((handle != nullptr) && conf->hasGroup("FileDialogSize")) {
KWindowConfig::restoreWindowSize(handle, conf->group("FileDialogSize"));
dlg->resize(handle->size());
}
......@@ -555,7 +555,7 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QStringList
}
if (b->isChecked() && list.count() == 1) {
// Check for image sequence
QUrl url = list.at(0);
const QUrl& url = list.at(0);
QString fileName = url.fileName().section(QLatin1Char('.'), 0, -2);
if (fileName.at(fileName.size() - 1).isDigit()) {
KFileItem item(url);
......@@ -582,9 +582,9 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QStringList