From f9dbfa756b78f336576b42f041de325c98aa48e8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 3 Mar 2009 15:21:55 +0000 Subject: [PATCH] krazy code fixes svn path=/branches/KDE4/; revision=3090 --- src/abstractclipitem.cpp | 2 +- src/clipitem.cpp | 88 +++++++++++++++++----------------- src/clipmanager.cpp | 5 +- src/clipproperties.cpp | 4 +- src/customtrackview.cpp | 4 +- src/dvdwizard.cpp | 12 ++--- src/editkeyframecommand.cpp | 4 +- src/effectslistview.cpp | 2 +- src/effectstackedit.cpp | 20 ++++---- src/guide.cpp | 6 +-- src/initeffects.cpp | 2 +- src/kdenlivedoc.cpp | 10 ++-- src/kdenlivesettingsdialog.cpp | 26 +++++----- src/mainwindow.cpp | 12 ++--- src/managecapturesdialog.cpp | 2 +- src/profilesdialog.cpp | 34 ++++++------- src/projectlist.cpp | 2 +- src/projectsettings.cpp | 8 ++-- src/recmonitor.cpp | 6 +-- src/renderer.cpp | 58 +++++++++++----------- src/renderwidget.cpp | 9 ++-- src/timecode.cpp | 62 ++++++++++++------------ src/titledocument.cpp | 6 +-- src/titlewidget.cpp | 2 +- src/trackview.cpp | 8 ++-- src/transition.cpp | 2 +- src/wizard.cpp | 12 ++--- 27 files changed, 205 insertions(+), 203 deletions(-) diff --git a/src/abstractclipitem.cpp b/src/abstractclipitem.cpp index 9076051e..b2b90e77 100644 --- a/src/abstractclipitem.cpp +++ b/src/abstractclipitem.cpp @@ -290,7 +290,7 @@ int AbstractClipItem::mouseOverKeyFrames(QPointF pos) { x1 = br.x() + maxw * (i.key() - m_cropStart.frames(m_fps)); y1 = br.bottom() - i.value() * maxh; if (qAbs(pos.x() - x1) < 6 && qAbs(pos.y() - y1) < 6) { - setToolTip("[" + QString::number((GenTime(i.key(), m_fps) - m_cropStart).seconds(), 'f', 2) + i18n("seconds") + ", " + QString::number(i.value(), 'f', 1) + "%]"); + setToolTip('[' + QString::number((GenTime(i.key(), m_fps) - m_cropStart).seconds(), 'f', 2) + i18n("seconds") + ", " + QString::number(i.value(), 'f', 1) + "%]"); return i.key(); } else if (x1 > pos.x()) break; ++i; diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 5d10de57..3f7c3d8d 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -48,7 +48,7 @@ ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double fps, double speed, b if (m_speed == 1.0) m_clipName = clip->name(); else { - m_clipName = clip->name() + " - " + QString::number(m_speed * 100, 'f', 0) + "%"; + m_clipName = clip->name() + " - " + QString::number(m_speed * 100, 'f', 0) + '%'; m_cropDuration = m_cropDuration * m_speed; } m_producer = clip->getId(); @@ -148,7 +148,7 @@ void ClipItem::initEffect(QDomElement effect) { QString def = e.attribute("default"); // Effect has a keyframe type parameter, we need to set the values if (e.attribute("keyframes").isEmpty()) { - e.setAttribute("keyframes", QString::number(m_cropStart.frames(m_fps)) + ":" + def + ";" + QString::number((m_cropStart + m_cropDuration).frames(m_fps)) + ":" + def); + e.setAttribute("keyframes", QString::number(m_cropStart.frames(m_fps)) + ':' + def + ';' + QString::number((m_cropStart + m_cropDuration).frames(m_fps)) + ':' + def); //kDebug() << "///// EFFECT KEYFRAMES INITED: " << e.attribute("keyframes"); break; } @@ -160,17 +160,17 @@ void ClipItem::initEffect(QDomElement effect) { int end = (duration() + cropStart()).frames(m_fps); int start = end; if (effect.attribute("id") == "fadeout") { - if (m_effectList.hasEffect("", "fade_to_black") == -1) { + if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) { start -= EffectsList::parameter(effect, "in").toInt(); } else { - QDomElement fadeout = m_effectList.getEffectByTag("", "fade_to_black"); + QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black"); start -= EffectsList::parameter(fadeout, "out").toInt() - EffectsList::parameter(fadeout, "in").toInt(); } } else if (effect.attribute("id") == "fade_to_black") { - if (m_effectList.hasEffect("", "fadeout") == -1) { + if (m_effectList.hasEffect(QString(), "fadeout") == -1) { start -= EffectsList::parameter(effect, "in").toInt(); } else { - QDomElement fadeout = m_effectList.getEffectByTag("", "fadeout"); + QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout"); start -= EffectsList::parameter(fadeout, "out").toInt() - EffectsList::parameter(fadeout, "in").toInt(); } } @@ -180,15 +180,15 @@ void ClipItem::initEffect(QDomElement effect) { int start = cropStart().frames(m_fps); int end = start; if (effect.attribute("id") == "fadein") { - if (m_effectList.hasEffect("", "fade_from_black") == -1) + if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) end += EffectsList::parameter(effect, "out").toInt(); else - end += EffectsList::parameter(m_effectList.getEffectByTag("", "fade_from_black"), "out").toInt(); + end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fade_from_black"), "out").toInt(); } else if (effect.attribute("id") == "fade_from_black") { - if (m_effectList.hasEffect("", "fadein") == -1) + if (m_effectList.hasEffect(QString(), "fadein") == -1) end += EffectsList::parameter(effect, "out").toInt(); else - end += EffectsList::parameter(m_effectList.getEffectByTag("", "fadein"), "out").toInt(); + end += EffectsList::parameter(m_effectList.getEffectByTag(QString(), "fadein"), "out").toInt(); } EffectsList::setParameter(effect, "in", QString::number(start)); EffectsList::setParameter(effect, "out", QString::number(end)); @@ -201,7 +201,7 @@ bool ClipItem::checkKeyFrames() { for (int ix = 0; ix < m_effectList.count(); ix ++) { QString kfr = keyframes(ix); if (!kfr.isEmpty()) { - const QStringList keyframes = kfr.split(";", QString::SkipEmptyParts); + const QStringList keyframes = kfr.split(';', QString::SkipEmptyParts); QStringList newKeyFrames; bool cutKeyFrame = false; bool modified = false; @@ -209,9 +209,9 @@ bool ClipItem::checkKeyFrames() { double lastValue = -1; int start = m_cropStart.frames(m_fps); int end = (m_cropStart + m_cropDuration).frames(m_fps); - foreach(const QString str, keyframes) { - int pos = str.section(":", 0, 0).toInt(); - double val = str.section(":", 1, 1).toDouble(); + foreach(const QString &str, keyframes) { + int pos = str.section(':', 0, 0).toInt(); + double val = str.section(':', 1, 1).toDouble(); if (pos - start < 0) { // a keyframe is defined before the start of the clip cutKeyFrame = true; @@ -221,7 +221,7 @@ bool ClipItem::checkKeyFrames() { int diff = pos - lastPos; double ratio = (double)(start - lastPos) / diff; double newValue = lastValue + (val - lastValue) * ratio; - newKeyFrames.append(QString::number(start) + ":" + QString::number(newValue)); + newKeyFrames.append(QString::number(start) + ':' + QString::number(newValue)); modified = true; } cutKeyFrame = false; @@ -233,12 +233,12 @@ bool ClipItem::checkKeyFrames() { if (diff != 0) { double ratio = (double)(end - lastPos) / diff; double newValue = lastValue + (val - lastValue) * ratio; - newKeyFrames.append(QString::number(end) + ":" + QString::number(newValue)); + newKeyFrames.append(QString::number(end) + ':' + QString::number(newValue)); modified = true; } break; } else { - newKeyFrames.append(QString::number(pos) + ":" + QString::number(val)); + newKeyFrames.append(QString::number(pos) + ':' + QString::number(val)); } } lastPos = pos; @@ -269,10 +269,10 @@ void ClipItem::setKeyframes(const int ix, const QString keyframes) { m_keyframeFactor = 100.0 / (max - min); m_keyframeDefault = e.attribute("default").toDouble(); // parse keyframes - const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts); - foreach(const QString str, keyframes) { - int pos = str.section(":", 0, 0).toInt(); - double val = str.section(":", 1, 1).toDouble(); + const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts); + foreach(const QString &str, keyframes) { + int pos = str.section(':', 0, 0).toInt(); + double val = str.section(':', 1, 1).toDouble(); m_keyframes[pos] = val; } update(); @@ -298,10 +298,10 @@ void ClipItem::setSelectedEffect(const int ix) { m_keyframeFactor = 100.0 / (max - min); m_keyframeDefault = e.attribute("default").toDouble(); // parse keyframes - const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts); - foreach(const QString str, keyframes) { - int pos = str.section(":", 0, 0).toInt(); - double val = str.section(":", 1, 1).toDouble(); + const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts); + foreach(const QString &str, keyframes) { + int pos = str.section(':', 0, 0).toInt(); + double val = str.section(':', 1, 1).toDouble(); m_keyframes[pos] = val; } update(); @@ -344,7 +344,7 @@ void ClipItem::updateKeyframeEffect() { double x1; double y1; while (i != m_keyframes.constEnd()) { - keyframes.append(QString::number(i.key()) + ":" + QString::number(i.value()) + ";"); + keyframes.append(QString::number(i.key()) + ':' + QString::number(i.value()) + ';'); ++i; } } @@ -1029,13 +1029,13 @@ void ClipItem::checkEffectsKeyframesPos(const int previous, const int current, b QDomElement e = params.item(i).toElement(); if (e.attribute("type") == "keyframe") { // parse keyframes and adjust values - const QStringList keyframes = e.attribute("keyframes").split(";", QString::SkipEmptyParts); + const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts); QMap kfr; int pos; double val; - foreach(const QString str, keyframes) { - pos = str.section(":", 0, 0).toInt(); - val = str.section(":", 1, 1).toDouble(); + foreach(const QString &str, keyframes) { + pos = str.section(':', 0, 0).toInt(); + val = str.section(':', 1, 1).toDouble(); if (pos == previous) kfr[current] = val; else { if (fromStart && pos >= current) kfr[pos] = val; @@ -1045,7 +1045,7 @@ void ClipItem::checkEffectsKeyframesPos(const int previous, const int current, b QString newkfr; QMap::const_iterator k = kfr.constBegin(); while (k != kfr.constEnd()) { - newkfr.append(QString::number(k.key()) + ":" + QString::number(k.value()) + ";"); + newkfr.append(QString::number(k.key()) + ':' + QString::number(k.value()) + ';'); ++k; } e.setAttribute("keyframes", newkfr); @@ -1208,41 +1208,41 @@ EffectsParameterList ClipItem::addEffect(QDomElement effect, bool animate) { // check if it is a fade effect if (effectId == "fadein") { needRepaint = true; - if (m_effectList.hasEffect("", "fade_from_black") == -1) { + if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) { if (e.attribute("name") == "out") fade += e.attribute("value").toInt(); else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt(); } else { - QDomElement fadein = m_effectList.getEffectByTag("", "fade_from_black"); + QDomElement fadein = m_effectList.getEffectByTag(QString(), "fade_from_black"); if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt(); else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt(); } } else if (effectId == "fade_from_black") { needRepaint = true; - if (m_effectList.hasEffect("", "fadein") == -1) { + if (m_effectList.hasEffect(QString(), "fadein") == -1) { if (e.attribute("name") == "out") fade += e.attribute("value").toInt(); else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt(); } else { - QDomElement fadein = m_effectList.getEffectByTag("", "fadein"); + QDomElement fadein = m_effectList.getEffectByTag(QString(), "fadein"); if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt(); else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt(); } } else if (effectId == "fadeout") { needRepaint = true; - if (m_effectList.hasEffect("", "fade_to_black") == -1) { + if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) { if (e.attribute("name") == "out") fade -= e.attribute("value").toInt(); else if (e.attribute("name") == "in") fade += e.attribute("value").toInt(); } else { - QDomElement fadeout = m_effectList.getEffectByTag("", "fade_to_black"); + QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black"); if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt(); else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt(); } } else if (effectId == "fade_to_black") { needRepaint = true; - if (m_effectList.hasEffect("", "fadeout") == -1) { + if (m_effectList.hasEffect(QString(), "fadeout") == -1) { if (e.attribute("name") == "out") fade -= e.attribute("value").toInt(); else if (e.attribute("name") == "in") fade += e.attribute("value").toInt(); } else { - QDomElement fadeout = m_effectList.getEffectByTag("", "fadeout"); + QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout"); if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt(); else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt(); } @@ -1293,7 +1293,7 @@ EffectsParameterList ClipItem::getEffectArgs(QDomElement effect) { parameters.addParam("factor", e.attribute("factor", "1")); parameters.addParam("starttag", e.attribute("starttag", "start")); parameters.addParam("endtag", e.attribute("endtag", "end")); - } else if (e.attribute("namedesc").contains(";")) { + } else if (e.attribute("namedesc").contains(';')) { QString format = e.attribute("format"); QStringList separators = format.split("%d", QString::SkipEmptyParts); QStringList values = e.attribute("value").split(QRegExp("[,:;x]")); @@ -1325,12 +1325,12 @@ void ClipItem::deleteEffect(QString index) { ix = m_effectList.at(i).attribute("kdenlive_ix"); if (ix == index) { QString effectId = m_effectList.at(i).attribute("id"); - if ((effectId == "fadein" && hasEffect("", "fade_from_black") == -1) || - (effectId == "fade_from_black" && hasEffect("", "fadein") == -1)) { + if ((effectId == "fadein" && hasEffect(QString(), "fade_from_black") == -1) || + (effectId == "fade_from_black" && hasEffect(QString(), "fadein") == -1)) { m_startFade = 0; needRepaint = true; - } else if ((effectId == "fadeout" && hasEffect("", "fade_to_black") == -1) || - (effectId == "fade_to_black" && hasEffect("", "fadeout") == -1)) { + } else if ((effectId == "fadeout" && hasEffect(QString(), "fade_to_black") == -1) || + (effectId == "fade_to_black" && hasEffect(QString(), "fadeout") == -1)) { m_endFade = 0; needRepaint = true; } diff --git a/src/clipmanager.cpp b/src/clipmanager.cpp index d3b8453a..d701639c 100644 --- a/src/clipmanager.cpp +++ b/src/clipmanager.cpp @@ -204,7 +204,7 @@ void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, co QUndoCommand *addClips = new QUndoCommand(); addClips->setText(i18n("Add clips")); - foreach(const KUrl file, urls) { + foreach(const KUrl &file, urls) { if (KIO::NetAccess::exists(file, KIO::NetAccess::SourceSide, NULL)) { QDomDocument doc; QDomElement prod = doc.createElement("producer"); @@ -335,4 +335,5 @@ void ClipManager::addFolder(const QString &id, const QString &name) { void ClipManager::deleteFolder(const QString &id) { m_folderList.remove(id); -} \ No newline at end of file +} + diff --git a/src/clipproperties.cpp b/src/clipproperties.cpp index dc187f28..0d811028 100644 --- a/src/clipproperties.cpp +++ b/src/clipproperties.cpp @@ -130,7 +130,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg m_view.tabWidget->removeTab(AUDIOTAB); m_view.tabWidget->removeTab(VIDEOTAB); m_view.clip_thumb->setHidden(true); - m_view.clip_color->setColor(QColor("#" + props.value("colour").right(8).left(6))); + m_view.clip_color->setColor(QColor('#' + props.value("colour").right(8).left(6))); } else if (t == SLIDESHOW) { m_view.clip_path->setText(url.directory()); m_view.tabWidget->removeTab(METATAB); @@ -347,7 +347,7 @@ QMap ClipProperties::properties() { if (t == COLOR) { QString new_color = m_view.clip_color->color().name(); - if (new_color != QString("#" + old_props.value("colour").right(8).left(6))) { + if (new_color != QString('#' + old_props.value("colour").right(8).left(6))) { m_clipNeedsRefresh = true; props["colour"] = "0x" + new_color.right(6) + "ff"; } diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 16a167fc..49647d3c 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -956,7 +956,7 @@ void CustomTrackView::activateMonitor() { void CustomTrackView::dragEnterEvent(QDragEnterEvent * event) { if (event->mimeData()->hasFormat("kdenlive/clip")) { resetSelectionGroup(); - QStringList list = QString(event->mimeData()->data("kdenlive/clip")).split(";"); + QStringList list = QString(event->mimeData()->data("kdenlive/clip")).split(';'); m_selectionGroup = new AbstractGroupItem(m_document->fps()); QPoint pos = QPoint(); DocClipBase *clip = m_document->getBaseClip(list.at(0)); @@ -977,7 +977,7 @@ void CustomTrackView::dragEnterEvent(QDragEnterEvent * event) { scene()->addItem(m_selectionGroup); event->acceptProposedAction(); } else if (event->mimeData()->hasFormat("kdenlive/producerslist")) { - QStringList ids = QString(event->mimeData()->data("kdenlive/producerslist")).split(";"); + QStringList ids = QString(event->mimeData()->data("kdenlive/producerslist")).split(';'); m_scene->clearSelection(); resetSelectionGroup(false); diff --git a/src/dvdwizard.cpp b/src/dvdwizard.cpp index 91f840a0..f35aab08 100644 --- a/src/dvdwizard.cpp +++ b/src/dvdwizard.cpp @@ -218,11 +218,11 @@ void DvdWizard::generateDvd() { while (it.hasNext()) { it.next(); QDomElement but = doc.createElement("button"); - but.setAttribute("name", "b" + QString::number(i)); - if (i < max) but.setAttribute("down", "b" + QString::number(i + 1)); + but.setAttribute("name", 'b' + QString::number(i)); + if (i < max) but.setAttribute("down", 'b' + QString::number(i + 1)); else but.setAttribute("down", "b0"); - if (i > 0) but.setAttribute("up", "b" + QString::number(i - 1)); - else but.setAttribute("up", "b" + QString::number(max)); + if (i > 0) but.setAttribute("up", 'b' + QString::number(i - 1)); + else but.setAttribute("up", 'b' + QString::number(max)); QRect r = it.value(); int target = it.key(); // TODO: solve play all button @@ -317,8 +317,8 @@ void DvdWizard::generateDvd() { menus.appendChild(pgc); for (int i = 0; i < buttons.count(); i++) { QDomElement button = dvddoc.createElement("button"); - button.setAttribute("name", "b" + QString::number(i)); - QDomText nametext = dvddoc.createTextNode("jump title " + buttonsTarget.at(i) + ";"); + button.setAttribute("name", 'b' + QString::number(i)); + QDomText nametext = dvddoc.createTextNode("jump title " + buttonsTarget.at(i) + ';'); button.appendChild(nametext); pgc.appendChild(button); } diff --git a/src/editkeyframecommand.cpp b/src/editkeyframecommand.cpp index e9624471..8e4d397e 100644 --- a/src/editkeyframecommand.cpp +++ b/src/editkeyframecommand.cpp @@ -20,8 +20,8 @@ #include "customtrackview.h" EditKeyFrameCommand::EditKeyFrameCommand(CustomTrackView *view, const int track, GenTime pos, const int effectIndex, const QString& oldkeyframes, const QString& newkeyframes, bool doIt) : m_view(view), m_track(track), m_pos(pos), m_index(effectIndex), m_oldkfr(oldkeyframes), m_newkfr(newkeyframes), m_doIt(doIt) { - int prev = m_oldkfr.split(";", QString::SkipEmptyParts).count(); - int next = m_newkfr.split(";", QString::SkipEmptyParts).count(); + int prev = m_oldkfr.split(';', QString::SkipEmptyParts).count(); + int next = m_newkfr.split(';', QString::SkipEmptyParts).count(); if (prev == next) setText(i18n("Edit keyframe")); else if (prev > next) setText(i18n("Delete keyframe")); else setText(i18n("Add keyframe")); diff --git a/src/effectslistview.cpp b/src/effectslistview.cpp index d1b4abbe..90060c62 100644 --- a/src/effectslistview.cpp +++ b/src/effectslistview.cpp @@ -113,7 +113,7 @@ void EffectsListView::slotRemoveEffect() { filter << "*.xml"; const QStringList fileList = directory.entryList(filter, QDir::Files); QString itemName; - foreach(const QString filename, fileList) { + foreach(const QString &filename, fileList) { itemName = KUrl(path + filename).path(); QDomDocument doc; QFile file(itemName); diff --git a/src/effectstackedit.cpp b/src/effectstackedit.cpp index a5d35e82..0a4967bc 100644 --- a/src/effectstackedit.cpp +++ b/src/effectstackedit.cpp @@ -120,8 +120,8 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d, int in, int out) { } else if (type == "list") { Ui::Listval_UI *lsval = new Ui::Listval_UI; lsval->setupUi(toFillin); - QStringList listitems = pa.attribute("paramlist").split(","); - QStringList listitemsdisplay = pa.attribute("paramlistdisplay").split(","); + QStringList listitems = pa.attribute("paramlist").split(','); + QStringList listitemsdisplay = pa.attribute("paramlistdisplay").split(','); if (listitemsdisplay.count() != listitems.count()) listitemsdisplay = listitems; //lsval->list->addItems(listitems); for (int i = 0;i < listitems.count();i++) { @@ -153,10 +153,10 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d, int in, int out) { valueItems[paramName] = bval; uiItems.append(bval); } else if (type == "complex") { - /*QStringList names=nodeAtts.namedItem("name").nodeValue().split(";"); - QStringList max=nodeAtts.namedItem("max").nodeValue().split(";"); - QStringList min=nodeAtts.namedItem("min").nodeValue().split(";"); - QStringList val=value.split(";"); + /*QStringList names=nodeAtts.namedItem("name").nodeValue().split(';'); + QStringList max=nodeAtts.namedItem("max").nodeValue().split(';'); + QStringList min=nodeAtts.namedItem("min").nodeValue().split(';'); + QStringList val=value.split(';'); kDebug() << "in complex"<fontMetrics(); - m_width = metric.width(" " + m_label + " ") + 2; + m_width = metric.width(' ' + m_label + ' ') + 2; prepareGeometryChange(); } } @@ -114,7 +114,7 @@ void Guide::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi //QGraphicsLineItem::paint(painter, option, w); if (KdenliveSettings::showmarkers()) { QPointF p1 = guideline.p1() + QPointF(1, 0); - QRectF txtBounding = painter->boundingRect(p1.x(), p1.y() + 10, m_width, 50, Qt::AlignLeft | Qt::AlignTop, " " + m_label + " "); + QRectF txtBounding = painter->boundingRect(p1.x(), p1.y() + 10, m_width, 50, Qt::AlignLeft | Qt::AlignTop, ' ' + m_label + ' '); QPainterPath path; path.addRoundedRect(txtBounding, 3, 3); painter->fillPath(path, QBrush(pen().color())); diff --git a/src/initeffects.cpp b/src/initeffects.cpp index 42d542a4..9d86caea 100644 --- a/src/initeffects.cpp +++ b/src/initeffects.cpp @@ -225,7 +225,7 @@ void initEffects::parseCustomEffectsFile() { filter << "*.xml"; const QStringList fileList = directory.entryList(filter, QDir::Files); QString itemName; - foreach(const QString filename, fileList) { + foreach(const QString &filename, fileList) { itemName = KUrl(path + filename).path(); QDomDocument doc; QFile file(itemName); diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp index 20255581..b4681891 100644 --- a/src/kdenlivedoc.cpp +++ b/src/kdenlivedoc.cpp @@ -403,7 +403,7 @@ bool KdenliveDoc::convertDocument(double version) { if (version == 0.5 || version == 0.7 || version > 0.81) { kDebug() << "Unable to open document with version " << version; // TODO: convert 0.7 (0.5?) files to the new document format. - return FALSE; + return false; } if (version == 0.8) { @@ -427,7 +427,7 @@ bool KdenliveDoc::convertDocument(double version) { if (t.attribute("producer") != "black_track") tracksinfo.appendChild(trackinfo); } infoXml.appendChild(tracksinfo); - return TRUE; + return true; } QDomNode westley = m_document.elementsByTagName("westley").at(1); @@ -877,7 +877,7 @@ bool KdenliveDoc::convertDocument(double version) { //kDebug() << "ready to set additional 's attributes (id =" << id << ")"; kproducer.setAttribute("channels", avfile.attribute("channels")); kproducer.setAttribute("duration", avfile.attribute("duration")); - kproducer.setAttribute("frame_size", avfile.attribute("width") + "x" + avfile.attribute("height")); + kproducer.setAttribute("frame_size", avfile.attribute("width") + 'x' + avfile.attribute("height")); kproducer.setAttribute("frequency", avfile.attribute("frequency")); if (kproducer.attribute("description").isEmpty() && !avfile.attribute("description").isEmpty()) kproducer.setAttribute("description", avfile.attribute("description")); @@ -899,7 +899,7 @@ bool KdenliveDoc::convertDocument(double version) { */ //kDebug() << "///////////////// END CONVERTED DOC:"; - return TRUE; + return true; } QString KdenliveDoc::colorToString(const QColor& c) { @@ -1354,7 +1354,7 @@ void KdenliveDoc::setNewClipResource(const QString &id, const QString &path) { for (int i = 0; i < maxprod; i++) { QDomNode m = prods.at(i); QString prodId = m.toElement().attribute("id"); - if (prodId == id || prodId.startsWith(id + "_")) { + if (prodId == id || prodId.startsWith(id + '_')) { QDomNodeList params = m.childNodes(); for (int j = 0; j < params.count(); j++) { QDomElement e = params.item(j).toElement(); diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index 3d006380..73dc108e 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -232,12 +232,12 @@ void KdenliveSettingsDialog::initDevices() { while (!stream.atEnd()) { line = stream.readLine(); if (line.contains("playback")) { - deviceId = line.section(":", 0, 0); - m_configSdl.kcfg_audio_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt())); + deviceId = line.section(':', 0, 0); + m_configSdl.kcfg_audio_device->addItem(line.section(':', 1, 1), "plughw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt())); } if (line.contains("capture")) { - deviceId = line.section(":", 0, 0); - m_configCapture.kcfg_rmd_alsa_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt())); + deviceId = line.section(':', 0, 0); + m_configCapture.kcfg_rmd_alsa_device->addItem(line.section(':', 1, 1), "plughw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt())); } } file.close(); @@ -263,13 +263,13 @@ void KdenliveSettingsDialog::slotReadAudioDevices() { kDebug() << "// / / / / / READING APLAY: "; kDebug() << result; QStringList lines = result.split('\n'); - foreach(QString data, lines) { + foreach(const QString &data, lines) { kDebug() << "// READING LINE: " << data; if (data.simplified().startsWith("card")) { - QString card = data.section(":", 0, 0).section(" ", -1); - QString device = data.section(":", 1, 1).section(" ", -1); - m_configSdl.kcfg_audio_device->addItem(data.section(":", -1), "plughw:" + card + "," + device); - m_configCapture.kcfg_rmd_alsa_device->addItem(data.section(":", -1), "plughw:" + card + "," + device); + QString card = data.section(':', 0, 0).section(' ', -1); + QString device = data.section(':', 1, 1).section(' ', -1); + m_configSdl.kcfg_audio_device->addItem(data.section(':', -1), "plughw:" + card + ',' + device); + m_configCapture.kcfg_rmd_alsa_device->addItem(data.section(':', -1), "plughw:" + card + ',' + device); } } } @@ -414,10 +414,10 @@ void KdenliveSettingsDialog::updateSettings() { void KdenliveSettingsDialog::slotUpdateDisplay() { QString currentProfile = m_configMisc.kcfg_profiles_list->itemData(m_configMisc.kcfg_profiles_list->currentIndex()).toString(); QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile); - m_configMisc.p_size->setText(values.value("width") + "x" + values.value("height")); - m_configMisc.p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den")); - m_configMisc.p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den")); - m_configMisc.p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den")); + m_configMisc.p_size->setText(values.value("width") + 'x' + values.value("height")); + m_configMisc.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den")); + m_configMisc.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den")); + m_configMisc.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den")); if (values.value("progressive").toInt() == 0) m_configMisc.p_progressive->setText(i18n("Interlaced")); else m_configMisc.p_progressive->setText(i18n("Progressive")); m_defaultProfile = m_configMisc.kcfg_profiles_list->itemText(m_configMisc.kcfg_profiles_list->currentIndex()); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 61023a80..431584d6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -246,7 +246,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent effectsList.insert(effectInfo.at(0).toLower(), effectInfo); } - foreach(QStringList value, effectsList) { + foreach(const QStringList &value, effectsList) { action = new QAction(value.at(0), this); action->setData(value); videoEffectsMenu->addAction(action); @@ -261,7 +261,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent effectsList.insert(effectInfo.at(0).toLower(), effectInfo); } - foreach(QStringList value, effectsList) { + foreach(const QStringList &value, effectsList) { action = new QAction(value.at(0), this); action->setData(value); audioEffectsMenu->addAction(action); @@ -278,7 +278,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent effectsList.insert(effectInfo.at(0).toLower(), effectInfo); } - foreach(QStringList value, effectsList) { + foreach(const QStringList &value, effectsList) { action = new QAction(value.at(0), this); action->setData(value); m_customEffectsMenu->addAction(action); @@ -312,7 +312,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent effectInfo = transitions.effectIdInfo(ix); effectsList.insert(effectInfo.at(0).toLower(), effectInfo); } - foreach(QStringList value, effectsList) { + foreach(const QStringList &value, effectsList) { action = new QAction(value.at(0), this); action->setData(value); transitionsMenu->addAction(action); @@ -406,7 +406,7 @@ void MainWindow::loadPlugins() { foreach(const QString &folder, directories) { kDebug() << "// PARSING FIOLER: " << folder; QDir pluginsDir(folder); - foreach(QString fileName, pluginsDir.entryList(filters, QDir::Files)) { + foreach(const QString &fileName, pluginsDir.entryList(filters, QDir::Files)) { kDebug() << "// FOUND PLUGIN: " << fileName << "= " << pluginsDir.absoluteFilePath(fileName); QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); @@ -431,7 +431,7 @@ void MainWindow::addToMenu(QObject *plugin, const QStringList &texts, QMenu *menu, const char *member, QActionGroup *actionGroup) { kDebug() << "// ADD to MENU" << texts; - foreach(QString text, texts) { + foreach(const QString &text, texts) { QAction *action = new QAction(text, plugin); action->setData(text); connect(action, SIGNAL(triggered()), this, member); diff --git a/src/managecapturesdialog.cpp b/src/managecapturesdialog.cpp index 9c963d17..fbd32451 100644 --- a/src/managecapturesdialog.cpp +++ b/src/managecapturesdialog.cpp @@ -39,7 +39,7 @@ ManageCapturesDialog::ManageCapturesDialog(KUrl::List files, QWidget * parent): m_importButton = m_view.buttonBox->button(QDialogButtonBox::Ok); m_importButton->setText(i18n("import")); m_view.treeWidget->setIconSize(QSize(70, 50)); - foreach(const KUrl url, files) { + foreach(const KUrl &url, files) { QStringList text; text << url.fileName(); KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true); diff --git a/src/profilesdialog.cpp b/src/profilesdialog.cpp index e215ab83..965f8f68 100644 --- a/src/profilesdialog.cpp +++ b/src/profilesdialog.cpp @@ -125,7 +125,7 @@ bool ProfilesDialog::slotSaveProfile() { if (ix != -1) { // this profile name already exists const QString path = m_view.profiles_list->itemData(ix).toString(); - if (!path.contains("/")) { + if (!path.contains('/')) { KMessageBox::sorry(this, i18n("A profile with same name already exists in MLT's default profiles, please choose another description for your custom profile.")); return false; } @@ -160,7 +160,7 @@ void ProfilesDialog::saveProfile(const QString path) { void ProfilesDialog::slotDeleteProfile() { const QString path = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString(); - if (path.contains("/")) { + if (path.contains('/')) { KIO::NetAccess::del(KUrl(path), this); fillList(); } else kDebug() << "//// Cannot delete profile " << path << ", does not seem to be custom one"; @@ -180,7 +180,7 @@ MltVideoProfile ProfilesDialog::getVideoProfile(QString name) { if (!isCustom) { // List the Mlt profiles profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); - if (profilesFiles.contains(name)) path = KdenliveSettings::mltpath() + "/" + name; + if (profilesFiles.contains(name)) path = KdenliveSettings::mltpath() + '/' + name; } if (isCustom || path.isEmpty()) { path = name; @@ -220,7 +220,7 @@ QString ProfilesDialog::getProfileDescription(QString name) { // List the Mlt profiles profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); if (profilesFiles.contains(name)) { - KConfig confFile(KdenliveSettings::mltpath() + "/" + name, KConfig::SimpleConfig); + KConfig confFile(KdenliveSettings::mltpath() + '/' + name, KConfig::SimpleConfig); return confFile.entryMap().value("description"); } @@ -229,7 +229,7 @@ QString ProfilesDialog::getProfileDescription(QString name) { for (int i = 0; i < customProfiles.size(); ++i) { profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files); if (profilesFiles.contains(name)) { - KConfig confFile(customProfiles.at(i) + "/" + name, KConfig::SimpleConfig); + KConfig confFile(customProfiles.at(i) + '/' + name, KConfig::SimpleConfig); return confFile.entryMap().value("description"); } } @@ -246,7 +246,7 @@ QMap ProfilesDialog::getProfilesInfo() { // List the Mlt profiles QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { - KConfig confFile(KdenliveSettings::mltpath() + "/" + profilesFiles.at(i), KConfig::SimpleConfig); + KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig); QString desc = confFile.entryMap().value("description"); if (!desc.isEmpty()) result.insert(desc, profilesFiles.at(i)); } @@ -256,9 +256,9 @@ QMap ProfilesDialog::getProfilesInfo() { for (int i = 0; i < customProfiles.size(); ++i) { profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files); for (int j = 0; j < profilesFiles.size(); ++j) { - KConfig confFile(customProfiles.at(i) + "/" + profilesFiles.at(j), KConfig::SimpleConfig); + KConfig confFile(customProfiles.at(i) + '/' + profilesFiles.at(j), KConfig::SimpleConfig); QString desc = confFile.entryMap().value("description"); - if (!desc.isEmpty()) result.insert(desc, customProfiles.at(i) + "/" + profilesFiles.at(j)); + if (!desc.isEmpty()) result.insert(desc, customProfiles.at(i) + '/' + profilesFiles.at(j)); } } return result; @@ -271,9 +271,9 @@ QMap< QString, QString > ProfilesDialog::getSettingsFromFile(const QString path) QStringList profilesFilter; profilesFilter << "*"; - if (!path.contains("/")) { + if (!path.contains('/')) { // This is an MLT profile - KConfig confFile(KdenliveSettings::mltpath() + "/" + path, KConfig::SimpleConfig); + KConfig confFile(KdenliveSettings::mltpath() + '/' + path, KConfig::SimpleConfig); return confFile.entryMap(); } else { // This is a custom profile @@ -292,7 +292,7 @@ QMap< QString, QString > ProfilesDialog::getSettingsForProfile(const QString pro // List the Mlt profiles profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { - KConfig confFile(KdenliveSettings::mltpath() + "/" + profilesFiles.at(i), KConfig::SimpleConfig); + KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig); QMap< QString, QString > values = confFile.entryMap(); if (values.value("description") == profileName) { values.insert("path", profilesFiles.at(i)); @@ -305,10 +305,10 @@ QMap< QString, QString > ProfilesDialog::getSettingsForProfile(const QString pro for (int i = 0; i < customProfiles.size(); ++i) { QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profiles.size(); ++i) { - KConfig confFile(customProfiles.at(i) + "/" + profiles.at(i), KConfig::SimpleConfig); + KConfig confFile(customProfiles.at(i) + '/' + profiles.at(i), KConfig::SimpleConfig); QMap< QString, QString > values = confFile.entryMap(); if (values.value("description") == profileName) { - values.insert("path", customProfiles.at(i) + "/" + profiles.at(i)); + values.insert("path", customProfiles.at(i) + '/' + profiles.at(i)); return values; } } @@ -326,7 +326,7 @@ QString ProfilesDialog::getPathFromDescription(const QString profileDesc) { // List the Mlt profiles profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profilesFiles.size(); ++i) { - KConfig confFile(KdenliveSettings::mltpath() + "/" + profilesFiles.at(i), KConfig::SimpleConfig); + KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig); QMap< QString, QString > values = confFile.entryMap(); if (values.value("description") == profileDesc) return profilesFiles.at(i); } @@ -336,9 +336,9 @@ QString ProfilesDialog::getPathFromDescription(const QString profileDesc) { for (int i = 0; i < customProfiles.size(); ++i) { QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files); for (int i = 0; i < profiles.size(); ++i) { - KConfig confFile(customProfiles.at(i) + "/" + profiles.at(i), KConfig::SimpleConfig); + KConfig confFile(customProfiles.at(i) + '/' + profiles.at(i), KConfig::SimpleConfig); QMap< QString, QString > values = confFile.entryMap(); - if (values.value("description") == profileDesc) return customProfiles.at(i) + "/" + profiles.at(i); + if (values.value("description") == profileDesc) return customProfiles.at(i) + '/' + profiles.at(i); } } return QString(); @@ -355,7 +355,7 @@ void ProfilesDialog::slotUpdateDisplay() { m_selectedProfileIndex = m_view.profiles_list->currentIndex(); QString currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString(); - m_isCustomProfile = currentProfile.contains("/"); + m_isCustomProfile = currentProfile.contains('/'); m_view.button_delete->setEnabled(m_isCustomProfile); m_view.properties->setEnabled(m_isCustomProfile); m_view.button_save->setEnabled(m_isCustomProfile); diff --git a/src/projectlist.cpp b/src/projectlist.cpp index 5ace98c1..b07f8a62 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -60,7 +60,7 @@ ProjectList::ProjectList(QWidget *parent) listView = new ProjectListView(this);; QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins(0, 0, 0, 0); - // mbd: I think this has died at some point: m_clipIdCounter = 0; + // setup toolbar searchView = new KTreeWidgetSearchLine(this); m_toolbar = new QToolBar("projectToolBar", this); diff --git a/src/projectsettings.cpp b/src/projectsettings.cpp index bf7fca0e..7f1cea7d 100644 --- a/src/projectsettings.cpp +++ b/src/projectsettings.cpp @@ -65,10 +65,10 @@ ProjectSettings::ProjectSettings(int videotracks, int audiotracks, const QString void ProjectSettings::slotUpdateDisplay() { QString currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString(); QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile); - m_view.p_size->setText(values.value("width") + "x" + values.value("height")); - m_view.p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den")); - m_view.p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den")); - m_view.p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den")); + m_view.p_size->setText(values.value("width") + 'x' + values.value("height")); + m_view.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den")); + m_view.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den")); + m_view.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den")); if (values.value("progressive").toInt() == 0) m_view.p_progressive->setText(i18n("Interlaced")); else m_view.p_progressive->setText(i18n("Progressive")); } diff --git a/src/recmonitor.cpp b/src/recmonitor.cpp index 3f7c853c..ea57ca3a 100644 --- a/src/recmonitor.cpp +++ b/src/recmonitor.cpp @@ -406,7 +406,7 @@ void RecMonitor::slotRecord() { int i = 1; while (QFile::exists(path)) { QString num = QString::number(i).rightJustified(4, '0', false); - path = KdenliveSettings::capturefolder() + "/capture" + num + "." + extension; + path = KdenliveSettings::capturefolder() + "/capture" + num + '.' + extension; i++; } @@ -567,7 +567,7 @@ void RecMonitor::manageCapturedFiles() { filters << "capture*" + extension; const QStringList result = dir.entryList(filters, QDir::Files, QDir::Time); KUrl::List capturedFiles; - foreach(QString name, result) { + foreach(const QString &name, result) { KUrl url = KUrl(dir.filePath(name)); if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) { KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true); @@ -581,7 +581,7 @@ void RecMonitor::manageCapturedFiles() { ManageCapturesDialog *d = new ManageCapturesDialog(capturedFiles, this); if (d->exec() == QDialog::Accepted) { capturedFiles = d->importFiles(); - foreach(KUrl url, capturedFiles) { + foreach(const KUrl &url, capturedFiles) { emit addProjectClip(url); } } diff --git a/src/renderer.cpp b/src/renderer.cpp index a4559e7c..503f02ff 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -270,7 +270,7 @@ QPixmap Render::getImageThumbnail(KUrl url, int width, int height) { filter << "*." + fileType; filter << "*." + fileType.toUpper(); more = dir.entryList(filter, QDir::Files); - im.load(url.directory() + "/" + more.at(0)); + im.load(url.directory() + '/' + more.at(0)); } else im.load(url.path()); //pixmap = im.scaled(width, height); return pixmap; @@ -352,8 +352,8 @@ void Render::getImage(KUrl url, int frame_position, QPoint size) more = dir.entryList( QDir::Files ); for ( it = more.begin() ; it != more.end() ; ++it ) { if ((*it).endsWith("."+fileType, Qt::CaseInsensitive)) { - if (!im.load(url.directory() + "/" + *it)) - kDebug()<<"++ ERROR LOADIN IMAGE: "<get("source_fps"); if (frame && frame->is_valid()) { - filePropertyMap["frame_size"] = QString::number(frame->get_int("width")) + "x" + QString::number(frame->get_int("height")); + filePropertyMap["frame_size"] = QString::number(frame->get_int("width")) + 'x' + QString::number(frame->get_int("height")); filePropertyMap["frequency"] = QString::number(frame->get_int("frequency")); filePropertyMap["channels"] = QString::number(frame->get_int("channels")); filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio"); @@ -1324,7 +1324,7 @@ void Render::mltInsertClip(ItemInfo info, QDomElement element, Mlt::Producer *pr // We want a slowmotion producer double speed = element.attribute("speed", "1.0").toDouble(); QString url = prod->get("resource"); - url.append("?" + QString::number(speed)); + url.append('?' + QString::number(speed)); Mlt::Producer *slowprod = m_slowmotionProducers.value(url); if (!slowprod || slowprod->get_producer() == NULL) { char *tmp = decodedString(url); @@ -1332,7 +1332,7 @@ void Render::mltInsertClip(ItemInfo info, QDomElement element, Mlt::Producer *pr delete[] tmp; QString id = prod->get("id"); if (id.contains('_')) id = id.section('_', 0, 0); - QString producerid = "slowmotion:" + id + ":" + QString::number(speed); + QString producerid = "slowmotion:" + id + ':' + QString::number(speed); tmp = decodedString(producerid); slowprod->set("id", tmp); delete[] tmp; @@ -1374,7 +1374,7 @@ void Render::mltCutClip(int track, GenTime position) { int blankDuration = trackPlaylist.clip_length(i) - 1; QString blk; if (trackPlaylist.is_blank(i)) blk = "(blank)"; - kDebug()<<"CLIP "<get_producer() == NULL) { char *tmp = decodedString(url); slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp); delete[] tmp; - QString producerid = "slowmotion:" + id + ":" + QString::number(speed); + QString producerid = "slowmotion:" + id + ':' + QString::number(speed); tmp = decodedString(producerid); slowprod->set("id", tmp); delete[] tmp; @@ -1714,14 +1714,14 @@ int Render::mltChangeClipSpeed(ItemInfo info, double speed, double oldspeed, Mlt } else if (serv == "framebuffer") { mlt_service_lock(service.get_service()); QString url = clipparent.get("resource"); - url = url.section("?", 0, 0); - url.append("?" + QString::number(speed)); + url = url.section('?', 0, 0); + url.append('?' + QString::number(speed)); Mlt::Producer *slowprod = m_slowmotionProducers.value(url); if (!slowprod || slowprod->get_producer() == NULL) { char *tmp = decodedString(url); slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp); delete[] tmp; - QString producerid = "slowmotion:" + id.section(":", 1, 1) + ":" + QString::number(speed); + QString producerid = "slowmotion:" + id.section(':', 1, 1) + ':' + QString::number(speed); tmp = decodedString(producerid); slowprod->set("id", tmp); delete[] tmp; @@ -1827,7 +1827,7 @@ bool Render::mltAddEffect(int track, GenTime position, EffectsParameterList para QString kfr = params.paramValue("keyframes"); if (!kfr.isEmpty()) { - QStringList keyFrames = kfr.split(";", QString::SkipEmptyParts); + QStringList keyFrames = kfr.split(';', QString::SkipEmptyParts); kDebug() << "// ADDING KEYFRAME EFFECT: " << params.paramValue("keyframes"); char *starttag = decodedString(params.paramValue("starttag", "start")); char *endtag = decodedString(params.paramValue("endtag", "end")); @@ -1847,10 +1847,10 @@ bool Render::mltAddEffect(int track, GenTime position, EffectsParameterList para Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, filterTag); if (filter && filter->is_valid()) { filter->set("kdenlive_id", filterId); - int x1 = keyFrames.at(i).section(":", 0, 0).toInt() + offset; - double y1 = keyFrames.at(i).section(":", 1, 1).toDouble(); - int x2 = keyFrames.at(i + 1).section(":", 0, 0).toInt(); - double y2 = keyFrames.at(i + 1).section(":", 1, 1).toDouble(); + int x1 = keyFrames.at(i).section(':', 0, 0).toInt() + offset; + double y1 = keyFrames.at(i).section(':', 1, 1).toDouble(); + int x2 = keyFrames.at(i + 1).section(':', 0, 0).toInt(); + double y2 = keyFrames.at(i + 1).section(':', 1, 1).toDouble(); if (x2 == -1) x2 = duration; for (int j = 0; j < params.count(); j++) { @@ -2084,7 +2084,7 @@ bool Render::mltResizeClipEnd(ItemInfo info, GenTime clipDuration) { int blankDuration = trackPlaylist.clip_length(i) - 1; QString blk; if (trackPlaylist.is_blank(i)) blk = "(blank)"; - kDebug()<<"CLIP "<= old_pos) { mlt_transition_set_in_and_out(tr, new_in, new_out); if (newTrack - startTrack != 0) { - kDebug() << "///// TRANSITION CHANGE TRACK. CUrrent (b): " << currentTrack << "x" << mlt_transition_get_a_track(tr) << ", NEw: " << newTrack << "x" << newTransitionTrack; + kDebug() << "///// TRANSITION CHANGE TRACK. CUrrent (b): " << currentTrack << 'x' << mlt_transition_get_a_track(tr) << ", NEw: " << newTrack << 'x' << newTransitionTrack; mlt_properties properties = MLT_TRANSITION_PROPERTIES(tr); mlt_properties_set_int(properties, "a_track", newTransitionTrack); mlt_properties_set_int(properties, "b_track", newTrack); - //kDebug() << "set new start & end :" << new_in << new_out<< "TR OFFSET: "< map = mltGetTransitionParamsFromXml(xml); @@ -2547,7 +2547,7 @@ QMap Render::mltGetTransitionParamsFromXml(QDomElement xml) { //map[name]=map[name].replace(".",","); //FIXME how to solve locale conversion of . , } - if (e.attribute("namedesc").contains(";")) { + if (e.attribute("namedesc").contains(';')) { QString format = e.attribute("format"); QStringList separators = format.split("%d", QString::SkipEmptyParts); QStringList values = e.attribute("value").split(QRegExp("[,:;x]")); @@ -2633,16 +2633,16 @@ void Render::mltResizeTransparency(int oldStart, int newStart, int newEnd, int t mlt_properties properties = MLT_SERVICE_PROPERTIES(nextservice); QString mlt_type = mlt_properties_get(properties, "mlt_type"); QString resource = mlt_properties_get(properties, "mlt_service"); - kDebug() << "// resize transpar from: " << oldStart << ", TO: " << newStart << "x" << newEnd << ", " << track << ", " << id; + kDebug() << "// resize transpar from: " << oldStart << ", TO: " << newStart << 'x' << newEnd << ", " << track << ", " << id; while (mlt_type == "transition") { mlt_transition tr = (mlt_transition) nextservice; int currentTrack = mlt_transition_get_b_track(tr); int currentIn = (int) mlt_transition_get_in(tr); //mlt_properties props = MLT_TRANSITION_PROPERTIES(tr); int transitionId = QString(mlt_properties_get(properties, "transparency")).toInt(); - kDebug() << "// resize transpar current in: " << currentIn << ", Track: " << currentTrack << ", id: " << id << "x" << transitionId ; + kDebug() << "// resize transpar current in: " << currentIn << ", Track: " << currentTrack << ", id: " << id << 'x' << transitionId ; if (resource == "composite" && track == currentTrack && currentIn == oldStart && transitionId == id) { - kDebug() << " / / / / /RESIZE TRANS TO: " << newStart << "x" << newEnd; + kDebug() << " / / / / /RESIZE TRANS TO: " << newStart << 'x' << newEnd; mlt_transition_set_in_and_out(tr, newStart, newEnd); break; } @@ -2681,7 +2681,7 @@ void Render::mltMoveTransparency(int startTime, int endTime, int startTrack, int int currentOut = (int) mlt_transition_get_out(tr); //mlt_properties properties = MLT_TRANSITION_PROPERTIES(tr); int transitionId = QString(mlt_properties_get(properties, "transparency")).toInt(); - //kDebug()<<" + TRANSITION "<currentIndex() == 1) renderArgs.append(" progressive=1"); @@ -858,8 +858,8 @@ void RenderWidget::parseProfiles(QString meta, QString group, QString profile) { // We should parse customprofiles.xml in last position, so that user profiles // can also override profiles installed by KNewStuff fileList.removeAll("customprofiles.xml"); - foreach(const QString filename, fileList) - parseFile(exportFolder + '/' + filename, true); + foreach(const QString &filename, fileList) + parseFile(exportFolder + '/' + filename, true); if (QFile::exists(exportFolder + "/customprofiles.xml")) parseFile(exportFolder + "/customprofiles.xml", true); if (!meta.isEmpty()) { @@ -1209,4 +1209,5 @@ void RenderWidget::slotDeleteScript() { void RenderWidget::slotGenerateScript() { slotExport(true); -} \ No newline at end of file +} + diff --git a/src/timecode.cpp b/src/timecode.cpp index 554311fd..8baf2ac6 100644 --- a/src/timecode.cpp +++ b/src/timecode.cpp @@ -47,8 +47,8 @@ int Timecode::getFrameCount(const QString duration, double fps) const { // Number of actual frames in a 10 minute interval : int tenMinutes = (normalMinuteFrames * 9) + tenthMinuteFrames; - frames = 6 * duration.section(":", 0, 0).toInt() * tenMinutes; - int minutes = duration.section(":", 1, 1).toInt(); + frames = 6 * duration.section(':', 0, 0).toInt() * tenMinutes; + int minutes = duration.section(':', 1, 1).toInt(); frames += ((int) minutes / 10) * tenMinutes; int mins = minutes % 10; if (mins > 0) { @@ -57,10 +57,10 @@ int Timecode::getFrameCount(const QString duration, double fps) const { if (mins > 0) frames += mins * normalMinuteFrames; } if (minutes % 10 > 0) frames -= perMinute; - frames += duration.section(":", 2, 2).toInt() * m_displayedFramesPerSecond + duration.section(":", 3, 3).toInt(); + frames += duration.section(':', 2, 2).toInt() * m_displayedFramesPerSecond + duration.section(':', 3, 3).toInt(); return frames; } - return (int)((duration.section(":", 0, 0).toInt()*3600.0 + duration.section(":", 1, 1).toInt()*60.0 + duration.section(":", 2, 2).toInt()) * fps + duration.section(":", 3, 3).toInt()); + return (int)((duration.section(':', 0, 0).toInt()*3600.0 + duration.section(':', 1, 1).toInt()*60.0 + duration.section(':', 2, 2).toInt()) * fps + duration.section(':', 3, 3).toInt()); } QString Timecode::getTimecode(const GenTime & time, double fps) const { @@ -105,29 +105,29 @@ QString Timecode::getEasyTimecode(const GenTime & time, const double &fps) { bool trim = false; if (hours != 0) { - text.append(QString::number(hours).rightJustified(2, '0', FALSE)); - text.append(" " + i18n("hour") + " "); + text.append(QString::number(hours).rightJustified(2, '0', false)); + text.append(' ' + i18n("hour") + ' '); trim = true; } if (minutes != 0 || trim) { if (!trim) { text.append(QString::number(minutes)); } else - text.append(QString::number(minutes).rightJustified(2, '0', FALSE)); - text.append(" " + i18n("min.") + " "); + text.append(QString::number(minutes).rightJustified(2, '0', false)); + text.append(' ' + i18n("min.") + ' '); trim = true; } if (seconds != 0 || trim) { if (!trim) { text.append(QString::number(seconds)); } else - text.append(QString::number(seconds).rightJustified(2, '0', FALSE)); - text.append(" " + i18n("sec.")); + text.append(QString::number(seconds).rightJustified(2, '0', false)); + text.append(' ' + i18n("sec.")); trim = true; } if (!trim) { text.append(QString::number(frames)); - text.append(" " + i18n("frames")); + text.append(' ' + i18n("frames")); } return text; @@ -152,13 +152,13 @@ QString Timecode::getTimecodeHH_MM_SS_FF(int frames) const { QString text; - text.append(QString::number(hours).rightJustified(2, '0', FALSE)); - text.append(":"); - text.append(QString::number(minutes).rightJustified(2, '0', FALSE)); - text.append(":"); - text.append(QString::number(seconds).rightJustified(2, '0', FALSE)); - text.append(":"); - text.append(QString::number(frames).rightJustified(2, '0', FALSE)); + text.append(QString::number(hours).rightJustified(2, '0', false)); + text.append(':'); + text.append(QString::number(minutes).rightJustified(2, '0', false)); + text.append(':'); + text.append(QString::number(seconds).rightJustified(2, '0', false)); + text.append(':'); + text.append(QString::number(frames).rightJustified(2, '0', false)); return text; } @@ -174,13 +174,13 @@ QString Timecode::getTimecodeHH_MM_SS_HH(const GenTime & time) const { QString text; - text.append(QString::number(hours).rightJustified(2, '0', FALSE)); - text.append(":"); - text.append(QString::number(minutes).rightJustified(2, '0', FALSE)); - text.append(":"); - text.append(QString::number(seconds).rightJustified(2, '0', FALSE)); - text.append(":"); - text.append(QString::number(hundredths).rightJustified(2, '0', FALSE)); + text.append(QString::number(hours).rightJustified(2, '0', false)); + text.append(':'); + text.append(QString::number(minutes).rightJustified(2, '0', false)); + text.append(':'); + text.append(QString::number(seconds).rightJustified(2, '0', false)); + text.append(':'); + text.append(QString::number(hundredths).rightJustified(2, '0', false)); return text; } @@ -240,14 +240,14 @@ QString Timecode::getTimecodeDropFrame(const GenTime & time, double fps) const { // THANK FUCK FOR THAT. QString text; - text.append(QString::number(hours).rightJustified(2, '0', FALSE)); - text.append(":"); + text.append(QString::number(hours).rightJustified(2, '0', false)); + text.append(':'); text.append(QString::number(tenMinuteIntervals)); text.append(QString::number(numMinutes)); - text.append(":"); - text.append(QString::number(seconds).rightJustified(2, '0', FALSE)); - text.append(":"); - text.append(QString::number(frames).rightJustified(2, '0', FALSE)); + text.append(':'); + text.append(QString::number(seconds).rightJustified(2, '0', false)); + text.append(':'); + text.append(QString::number(frames).rightJustified(2, '0', false)); return text; } diff --git a/src/titledocument.cpp b/src/titledocument.cpp index 9b5c5823..39d40ed6 100644 --- a/src/titledocument.cpp +++ b/src/titledocument.cpp @@ -272,20 +272,20 @@ QString TitleDocument::rectFToString(const QRectF& c) { QRectF TitleDocument::stringToRect(const QString & s) { - QStringList l = s.split(","); + QStringList l = s.split(','); if (l.size() < 4) return QRectF(); return QRectF(l[0].toDouble(), l[1].toDouble(), l[2].toDouble(), l[3].toDouble()); } QColor TitleDocument::stringToColor(const QString & s) { - QStringList l = s.split(","); + QStringList l = s.split(','); if (l.size() < 4) return QColor(); return QColor(l[0].toInt(), l[1].toInt(), l[2].toInt(), l[3].toInt());; } QTransform TitleDocument::stringToTransform(const QString& s) { - QStringList l = s.split(","); + QStringList l = s.split(','); if (l.size() < 9) return QTransform(); return QTransform( diff --git a/src/titlewidget.cpp b/src/titlewidget.cpp index 3f92cb11..f0e43c3d 100644 --- a/src/titlewidget.cpp +++ b/src/titlewidget.cpp @@ -336,7 +336,7 @@ void TitleWidget::initViewports() { void TitleWidget::slotUpdateZoom(int pos) { m_scene->setZoom((double) pos / 100); - zoom_label->setText(QString::number(pos) + "%"); + zoom_label->setText(QString::number(pos) + '%'); } void TitleWidget::slotZoom(bool up) { diff --git a/src/trackview.cpp b/src/trackview.cpp index 67cf01cd..e160ea79 100644 --- a/src/trackview.cpp +++ b/src/trackview.cpp @@ -395,8 +395,8 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool locked) { QString id = idString; double speed = 1.0; if (idString.startsWith("slowmotion")) { - id = idString.section(":", 1, 1); - speed = idString.section(":", 2, 2).toDouble(); + id = idString.section(':', 1, 1); + speed = idString.section(':', 2, 2).toDouble(); } else id = id.section('_', 0, 0); DocClipBase *clip = m_doc->clipManager()->getClipById(id); if (clip != NULL) { @@ -488,7 +488,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool locked) { endvalue = effectparam.text().toDouble() * factor; } // add first keyframe - keyframes.append(QString::number(effectin) + ":" + QString::number(startvalue) + ";" + QString::number(effectout) + ":" + QString::number(endvalue) + ";"); + keyframes.append(QString::number(effectin) + ':' + QString::number(startvalue) + ';' + QString::number(effectout) + ':' + QString::number(endvalue) + ';'); QDomNode lastParsedEffect; ix++; QDomNode n2 = effects.at(ix); @@ -513,7 +513,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool locked) { } } if (continueParsing) { - keyframes.append(QString::number(effectout) + ":" + QString::number(endvalue) + ";"); + keyframes.append(QString::number(effectout) + ':' + QString::number(endvalue) + ';'); ix++; } } diff --git a/src/transition.cpp b/src/transition.cpp index fce62db6..d574e5f6 100644 --- a/src/transition.cpp +++ b/src/transition.cpp @@ -162,7 +162,7 @@ void Transition::paint(QPainter *painter, //painter->drawPixmap(painter->matrix().map(p1) + QPointF(5, 0), transitionPixmap()); QString text = transitionName(); if (m_forceTransitionTrack) text.append("|>"); - QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignHCenter | Qt::AlignVCenter, " " + text + " "); + QRectF txtBounding = painter->boundingRect(mapped, Qt::AlignHCenter | Qt::AlignVCenter, ' ' + text + ' '); painter->fillRect(txtBounding, QBrush(QColor(50, 50, 0, 150))); txtBounding.translate(QPointF(1, 1)); painter->setPen(QColor(255, 255, 255, 255)); diff --git a/src/wizard.cpp b/src/wizard.cpp index fdd947f8..c6865623 100644 --- a/src/wizard.cpp +++ b/src/wizard.cpp @@ -164,7 +164,7 @@ void Wizard::checkMltComponents() { } else { checkProcess.waitForFinished(); QString mltVersion = checkProcess.readAllStandardError(); - mltVersion = mltVersion.section("\n", 0, 0).simplified(); + mltVersion = mltVersion.section('\n', 0, 0).simplified(); mltVersion = mltVersion.section(' ', -1).simplified(); version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt(); kDebug() << "// FOUND MLT version: " << version; @@ -184,7 +184,7 @@ void Wizard::checkMltComponents() { QByteArray codecList = checkProcess2.readAllStandardError(); QString acodecList(codecList); QStringList result; - QStringList alist = acodecList.split("\n", QString::SkipEmptyParts); + QStringList alist = acodecList.split('\n', QString::SkipEmptyParts); for (int i = 0; i < alist.count(); i++) { if (alist.at(i).contains("- ")) result.append(alist.at(i).section("- ", 1).simplified().toLower()); } @@ -201,7 +201,7 @@ void Wizard::checkMltComponents() { QByteArray codecList = checkProcess2.readAllStandardError(); QString vcodecList(codecList); QStringList result; - QStringList vlist = vcodecList.split("\n", QString::SkipEmptyParts); + QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts); for (int i = 0; i < vlist.count(); i++) { if (vlist.at(i).contains("- ")) result.append(vlist.at(i).section("- ", 1).simplified().toLower()); } @@ -218,7 +218,7 @@ void Wizard::checkMltComponents() { QByteArray codecList = checkProcess2.readAllStandardError(); QString vcodecList(codecList); QStringList result; - QStringList vlist = vcodecList.split("\n", QString::SkipEmptyParts); + QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts); for (int i = 0; i < vlist.count(); i++) { if (vlist.at(i).contains("- ")) { QString format = vlist.at(i).section("- ", 1).simplified().toLower(); @@ -456,12 +456,12 @@ void Wizard::slotCheckMlt() { QProcess checkProcess2; checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer"); if (!checkProcess2.waitForStarted()) - errorMessage.append(i18n("Error starting MLT's command line player (inigo).") + "\n"); + errorMessage.append(i18n("Error starting MLT's command line player (inigo).") + '\n'); checkProcess2.waitForFinished(); QByteArray result = checkProcess2.readAllStandardError(); - if (!result.contains("sdl") || !result.contains("sdl_preview")) errorMessage.append(i18n("MLT's SDL module not found. Please check your MLT install. Kdenlive will not work until this issue is fixed.") + "\n"); + if (!result.contains("sdl") || !result.contains("sdl_preview")) errorMessage.append(i18n("MLT's SDL module not found. Please check your MLT install. Kdenlive will not work until this issue is fixed.") + '\n'); if (!errorMessage.isEmpty()) { errorMessage.prepend(QString("%1
").arg(i18n("Fatal Error"))); -- 2.39.2