Commit 5e0b0db0 authored by Laurent Montel's avatar Laurent Montel 😁

Const'ify code

parent 60712fac
......@@ -139,7 +139,7 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action
if (data->hasFormat(QStringLiteral("kdenlive/producerslist"))) {
// Dropping an Bin item
QStringList ids = QString(data->data(QStringLiteral("kdenlive/producerslist"))).split(QLatin1Char(';'));
const QStringList ids = QString(data->data(QStringLiteral("kdenlive/producerslist"))).split(QLatin1Char(';'));
emit itemDropped(ids, parent);
return true;
}
......@@ -152,7 +152,7 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action
}
if (data->hasFormat(QStringLiteral("kdenlive/clip"))) {
QStringList list = QString(data->data(QStringLiteral("kdenlive/clip"))).split(QLatin1Char(';'));
const QStringList list = QString(data->data(QStringLiteral("kdenlive/clip"))).split(QLatin1Char(';'));
emit addClipCut(list.at(0), list.at(1).toInt(), list.at(2).toInt());
}
......
......@@ -366,7 +366,7 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &pa
// without this line a call to mlt_properties_get_int(terminate on pause) for in mlt/src/modules/core/consumer_multi.c is returning 1
// and going into and endless loop.
renderProps->set("mlt_profile", m_activeProfile.toUtf8().constData());
QStringList paramList = params.split(' ', QString::SkipEmptyParts);
const QStringList paramList = params.split(' ', QString::SkipEmptyParts);
for (int i = 0; i < paramList.count(); ++i) {
tmp = qstrdup(paramList.at(i).section(QLatin1Char('='), 0, 0).toUtf8().constData());
QString value = paramList.at(i).section(QLatin1Char('='), 1, 1);
......
......@@ -1219,7 +1219,7 @@ void DocumentValidator::updateProducerInfo(const QDomElement &prod, const QDomEl
}
if (source.hasAttribute(QStringLiteral("cutzones"))) {
QString zoneData = source.attribute(QStringLiteral("cutzones"));
QStringList zoneList = zoneData.split(QLatin1Char(';'));
const QStringList zoneList = zoneData.split(QLatin1Char(';'));
int ct = 1;
foreach (const QString &data, zoneList) {
QString zoneName = data.section(QLatin1Char('-'), 2);
......@@ -1429,7 +1429,7 @@ bool DocumentValidator::checkMovit()
QString DocumentValidator::factorizeGeomValue(const QString &value, double factor)
{
QStringList vals = value.split(QLatin1Char(';'));
const QStringList vals = value.split(QLatin1Char(';'));
QString result;
QLocale locale;
for (int i = 0; i < vals.count(); i++) {
......
......@@ -177,7 +177,7 @@ void DvdWizardVob::slotShowTranscodeInfo()
if (m_duration == 0) {
if (log.contains(QStringLiteral("Duration:"))) {
QString durationstr = log.section(QStringLiteral("Duration:"), 1, 1).section(QLatin1Char(','), 0, 0).simplified();
QStringList numbers = durationstr.split(QLatin1Char(':'));
const QStringList numbers = durationstr.split(QLatin1Char(':'));
if (numbers.size() < 3) {
return;
}
......@@ -192,7 +192,7 @@ void DvdWizardVob::slotShowTranscodeInfo()
int progress;
QString time = log.section(QStringLiteral("time="), 1, 1).simplified().section(QLatin1Char(' '), 0, 0);
if (time.contains(QLatin1Char(':'))) {
QStringList numbers = time.split(QLatin1Char(':'));
const QStringList numbers = time.split(QLatin1Char(':'));
if (numbers.size() < 3) {
return;
}
......@@ -722,7 +722,7 @@ void DvdWizardVob::processTranscoding()
}
bool replaceVfParams = false;
QStringList splitted = params.split(QLatin1Char(' '));
const QStringList splitted = params.split(QLatin1Char(' '));
foreach (QString s, splitted) {
if (replaceVfParams) {
parameters << postParams.at(1);
......
......@@ -174,7 +174,7 @@ void MyTextItem::updateGeometry(int, int, int)
double lineSpacing = data(TitleDocument::LineSpacing).toInt() + metrics.lineSpacing();
// Calculate line width
QStringList lines = text.split(QLatin1Char('\n'));
const QStringList lines = text.split(QLatin1Char('\n'));
double linePos = metrics.ascent();
QRectF bounding = boundingRect();
/*if (lines.count() > 0) {
......
......@@ -54,7 +54,7 @@ void CubicBezierSpline::fromString(const QString &spline)
const QStringList points = bpoint.split(QLatin1Char('#'));
QVector<QPointF> values;
for (const QString &point : points) {
QStringList xy = point.split(QLatin1Char(';'));
const QStringList xy = point.split(QLatin1Char(';'));
if (xy.count() == 2) {
values.append(QPointF(locale.toDouble(xy.at(0)), locale.toDouble(xy.at(1))));
}
......
......@@ -436,7 +436,7 @@ QString KisCubicCurve::toString() const
void KisCubicCurve::fromString(const QString &string)
{
QStringList data = string.split(QLatin1Char(';'));
const QStringList data = string.split(QLatin1Char(';'));
QList<QPointF> points;
QLocale locale;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment