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 ...@@ -139,7 +139,7 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action
if (data->hasFormat(QStringLiteral("kdenlive/producerslist"))) { if (data->hasFormat(QStringLiteral("kdenlive/producerslist"))) {
// Dropping an Bin item // 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); emit itemDropped(ids, parent);
return true; return true;
} }
...@@ -152,7 +152,7 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action ...@@ -152,7 +152,7 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action
} }
if (data->hasFormat(QStringLiteral("kdenlive/clip"))) { 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()); 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 ...@@ -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 // 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. // and going into and endless loop.
renderProps->set("mlt_profile", m_activeProfile.toUtf8().constData()); 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) { for (int i = 0; i < paramList.count(); ++i) {
tmp = qstrdup(paramList.at(i).section(QLatin1Char('='), 0, 0).toUtf8().constData()); tmp = qstrdup(paramList.at(i).section(QLatin1Char('='), 0, 0).toUtf8().constData());
QString value = paramList.at(i).section(QLatin1Char('='), 1, 1); QString value = paramList.at(i).section(QLatin1Char('='), 1, 1);
......
...@@ -1219,7 +1219,7 @@ void DocumentValidator::updateProducerInfo(const QDomElement &prod, const QDomEl ...@@ -1219,7 +1219,7 @@ void DocumentValidator::updateProducerInfo(const QDomElement &prod, const QDomEl
} }
if (source.hasAttribute(QStringLiteral("cutzones"))) { if (source.hasAttribute(QStringLiteral("cutzones"))) {
QString zoneData = source.attribute(QStringLiteral("cutzones")); QString zoneData = source.attribute(QStringLiteral("cutzones"));
QStringList zoneList = zoneData.split(QLatin1Char(';')); const QStringList zoneList = zoneData.split(QLatin1Char(';'));
int ct = 1; int ct = 1;
foreach (const QString &data, zoneList) { foreach (const QString &data, zoneList) {
QString zoneName = data.section(QLatin1Char('-'), 2); QString zoneName = data.section(QLatin1Char('-'), 2);
...@@ -1429,7 +1429,7 @@ bool DocumentValidator::checkMovit() ...@@ -1429,7 +1429,7 @@ bool DocumentValidator::checkMovit()
QString DocumentValidator::factorizeGeomValue(const QString &value, double factor) QString DocumentValidator::factorizeGeomValue(const QString &value, double factor)
{ {
QStringList vals = value.split(QLatin1Char(';')); const QStringList vals = value.split(QLatin1Char(';'));
QString result; QString result;
QLocale locale; QLocale locale;
for (int i = 0; i < vals.count(); i++) { for (int i = 0; i < vals.count(); i++) {
......
...@@ -177,7 +177,7 @@ void DvdWizardVob::slotShowTranscodeInfo() ...@@ -177,7 +177,7 @@ void DvdWizardVob::slotShowTranscodeInfo()
if (m_duration == 0) { if (m_duration == 0) {
if (log.contains(QStringLiteral("Duration:"))) { if (log.contains(QStringLiteral("Duration:"))) {
QString durationstr = log.section(QStringLiteral("Duration:"), 1, 1).section(QLatin1Char(','), 0, 0).simplified(); 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) { if (numbers.size() < 3) {
return; return;
} }
...@@ -192,7 +192,7 @@ void DvdWizardVob::slotShowTranscodeInfo() ...@@ -192,7 +192,7 @@ void DvdWizardVob::slotShowTranscodeInfo()
int progress; int progress;
QString time = log.section(QStringLiteral("time="), 1, 1).simplified().section(QLatin1Char(' '), 0, 0); QString time = log.section(QStringLiteral("time="), 1, 1).simplified().section(QLatin1Char(' '), 0, 0);
if (time.contains(QLatin1Char(':'))) { if (time.contains(QLatin1Char(':'))) {
QStringList numbers = time.split(QLatin1Char(':')); const QStringList numbers = time.split(QLatin1Char(':'));
if (numbers.size() < 3) { if (numbers.size() < 3) {
return; return;
} }
...@@ -722,7 +722,7 @@ void DvdWizardVob::processTranscoding() ...@@ -722,7 +722,7 @@ void DvdWizardVob::processTranscoding()
} }
bool replaceVfParams = false; bool replaceVfParams = false;
QStringList splitted = params.split(QLatin1Char(' ')); const QStringList splitted = params.split(QLatin1Char(' '));
foreach (QString s, splitted) { foreach (QString s, splitted) {
if (replaceVfParams) { if (replaceVfParams) {
parameters << postParams.at(1); parameters << postParams.at(1);
......
...@@ -174,7 +174,7 @@ void MyTextItem::updateGeometry(int, int, int) ...@@ -174,7 +174,7 @@ void MyTextItem::updateGeometry(int, int, int)
double lineSpacing = data(TitleDocument::LineSpacing).toInt() + metrics.lineSpacing(); double lineSpacing = data(TitleDocument::LineSpacing).toInt() + metrics.lineSpacing();
// Calculate line width // Calculate line width
QStringList lines = text.split(QLatin1Char('\n')); const QStringList lines = text.split(QLatin1Char('\n'));
double linePos = metrics.ascent(); double linePos = metrics.ascent();
QRectF bounding = boundingRect(); QRectF bounding = boundingRect();
/*if (lines.count() > 0) { /*if (lines.count() > 0) {
......
...@@ -54,7 +54,7 @@ void CubicBezierSpline::fromString(const QString &spline) ...@@ -54,7 +54,7 @@ void CubicBezierSpline::fromString(const QString &spline)
const QStringList points = bpoint.split(QLatin1Char('#')); const QStringList points = bpoint.split(QLatin1Char('#'));
QVector<QPointF> values; QVector<QPointF> values;
for (const QString &point : points) { for (const QString &point : points) {
QStringList xy = point.split(QLatin1Char(';')); const QStringList xy = point.split(QLatin1Char(';'));
if (xy.count() == 2) { if (xy.count() == 2) {
values.append(QPointF(locale.toDouble(xy.at(0)), locale.toDouble(xy.at(1)))); values.append(QPointF(locale.toDouble(xy.at(0)), locale.toDouble(xy.at(1))));
} }
......
...@@ -436,7 +436,7 @@ QString KisCubicCurve::toString() const ...@@ -436,7 +436,7 @@ QString KisCubicCurve::toString() const
void KisCubicCurve::fromString(const QString &string) void KisCubicCurve::fromString(const QString &string)
{ {
QStringList data = string.split(QLatin1Char(';')); const QStringList data = string.split(QLatin1Char(';'));
QList<QPointF> points; QList<QPointF> points;
QLocale locale; 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