Commit 4bce0432 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent 6ad30dae
......@@ -141,7 +141,7 @@ void RenderJob::receivedStderr()
if (seconds == m_seconds) return;
if (seconds < 0) seconds += 24*60*60;
m_jobUiserver->call(QStringLiteral("setDescriptionField"), (uint) 0,
QString(), tr("Remaining time: ") + QTime(0, 0, 0).addSecs((int) (seconds * (100 - m_progress) / m_progress)).toString("hh:mm:ss"));
QString(), tr("Remaining time: ") + QTime(0, 0, 0).addSecs((int) (seconds * (100 - m_progress) / m_progress)).toString(QStringLiteral("hh:mm:ss")));
//m_jobUiserver->call("setSpeed", (frame - m_frame) / (seconds - m_seconds));
m_frame = frame;
m_seconds = seconds;
......@@ -169,7 +169,7 @@ void RenderJob::start()
if (interface->isServiceRegistered(QStringLiteral("org.kde.JobViewServer"))) {
QDBusInterface kuiserver(QStringLiteral("org.kde.JobViewServer"), QStringLiteral("/JobViewServer"), QStringLiteral("org.kde.JobViewServer"));
QDBusReply<QDBusObjectPath> objectPath = kuiserver.asyncCall(QLatin1String("requestView"),QLatin1String("kdenlive"), QLatin1String("kdenlive"), 0x0001);
QDBusReply<QDBusObjectPath> objectPath = kuiserver.asyncCall(QStringLiteral("requestView"),QLatin1String("kdenlive"), QLatin1String("kdenlive"), 0x0001);
QString reply = ((QDBusObjectPath) objectPath).path();
// Use of the KDE JobViewServer is an ugly hack, it is not reliable
......@@ -180,7 +180,7 @@ void RenderJob::start()
if (!m_args.contains(QStringLiteral("pass=2")))
m_jobUiserver->call(QStringLiteral("setPercent"), (uint) 0);
m_jobUiserver->call("setInfoMessage", tr("Rendering %1").arg(QFileInfo(m_dest).fileName()));
m_jobUiserver->call(QStringLiteral("setInfoMessage"), tr("Rendering %1").arg(QFileInfo(m_dest).fileName()));
QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.JobViewServer"), reply, dbusView, QStringLiteral("cancelRequested"), this, SLOT(slotAbort()));
}
}
......
......@@ -415,7 +415,7 @@ Bin::Bin(QWidget* parent) :
m_renameFolderAction = new QAction(i18n("Rename Folder"), this);
connect(m_renameFolderAction, SIGNAL(triggered(bool)), this, SLOT(slotRenameFolder()));
m_renameFolderAction->setData("rename_folder");
pCore->window()->actionCollection()->addAction("rename_folder", m_renameFolderAction);
pCore->window()->actionCollection()->addAction(QStringLiteral("rename_folder"), m_renameFolderAction);
listType->setToolBarMode(KSelectAction::MenuMode);
connect(listType, SIGNAL(triggered(QAction*)), this, SLOT(slotInitView(QAction*)));
......@@ -913,16 +913,16 @@ void Bin::slotDuplicateClip()
QDomDocument doc;
QDomElement xml = currentItem->toXml(doc);
if (!xml.isNull()) {
QString currentName = EffectsList::property(xml, "kdenlive:clipname");
QString currentName = EffectsList::property(xml, QStringLiteral("kdenlive:clipname"));
if (currentName.isEmpty()) {
QUrl url = QUrl::fromLocalFile(EffectsList::property(xml, "resource"));
QUrl url = QUrl::fromLocalFile(EffectsList::property(xml, QStringLiteral("resource")));
if (url.isValid()) {
QString currentName = url.fileName();
}
}
if (!currentName.isEmpty()) {
currentName.append(i18nc("append to clip name to indicate a copied idem", " (copy)"));
EffectsList::setProperty(xml, "kdenlive:clipname", currentName);
EffectsList::setProperty(xml, QStringLiteral("kdenlive:clipname"), currentName);
}
ClipCreationDialog::createClipFromXml(m_doc, xml, folderInfo, this);
}
......@@ -1526,7 +1526,7 @@ void Bin::rebuildMenu()
m_menu->insertMenu(m_reloadAction, m_extractAudioAction);
m_menu->insertMenu(m_reloadAction, m_transcodeAction);
m_menu->insertMenu(m_reloadAction, m_clipsActionsMenu);
m_inTimelineAction = m_menu->insertMenu(m_reloadAction, static_cast<QMenu*>(pCore->window()->factory()->container("clip_in_timeline", pCore->window())));
m_inTimelineAction = m_menu->insertMenu(m_reloadAction, static_cast<QMenu*>(pCore->window()->factory()->container(QStringLiteral("clip_in_timeline"), pCore->window())));
}
......@@ -1596,7 +1596,7 @@ void Bin::contextMenuEvent(QContextMenuEvent *event)
}
}
// Enable / disable clip actions
m_proxyAction->setEnabled(m_doc->getDocumentProperty("enableproxy").toInt() && enableClipActions);
m_proxyAction->setEnabled(m_doc->getDocumentProperty(QStringLiteral("enableproxy")).toInt() && enableClipActions);
m_openAction->setEnabled(type == Image || type == Audio || type == TextTemplate || type == Text);
m_reloadAction->setEnabled(enableClipActions);
m_locateAction->setEnabled(enableClipActions);
......@@ -1990,7 +1990,7 @@ void Bin::setupGeneratorMenu()
m_clipsActionsMenu = addMenu;
}
addMenu = qobject_cast<QMenu*>(pCore->window()->factory()->container("clip_in_timeline", pCore->window()));
addMenu = qobject_cast<QMenu*>(pCore->window()->factory()->container(QStringLiteral("clip_in_timeline"), pCore->window()));
if (addMenu) {
m_inTimelineAction = m_menu->addMenu(addMenu);
m_inTimelineAction->setEnabled(!addMenu->isEmpty());
......@@ -2038,7 +2038,7 @@ void Bin::setupMenu(QMenu *addMenu, QAction *defaultAction, QHash <QString, QAct
m_addButton->setPopupMode(QToolButton::MenuButtonPopup);
m_toolbar->insertWidget(folder, m_addButton);
m_menu = new QMenu(this);
m_propertiesDock = pCore->window()->addDock(i18n("Clip Properties"), "clip_properties", m_propertiesPanel);
m_propertiesDock = pCore->window()->addDock(i18n("Clip Properties"), QStringLiteral("clip_properties"), m_propertiesPanel);
m_propertiesDock->close();
//m_menu->addActions(addMenu->actions());
}
......@@ -2532,8 +2532,8 @@ void Bin::slotExpandUrl(ItemInfo info, QUrl url, QUndoCommand *command)
if (doc.documentElement().isNull()) {
invalid = true;
}
QDomNodeList producers = doc.documentElement().elementsByTagName("producer");
QDomNodeList tracks = doc.documentElement().elementsByTagName("track");
QDomNodeList producers = doc.documentElement().elementsByTagName(QStringLiteral("producer"));
QDomNodeList tracks = doc.documentElement().elementsByTagName(QStringLiteral("track"));
if (invalid || producers.isEmpty()) {
doDisplayMessage(i18n("Playlist clip %1 is invalid.", url.fileName()), KMessageWidget::Warning);
delete command;
......@@ -2768,7 +2768,7 @@ void Bin::addClipCut(const QString&id, int in, int out)
}
sub = new ProjectSubClip(clip, in, out, m_doc->timecode().getDisplayTimecodeFromFrames(in, KdenliveSettings::frametimecode()));
QStringList markersComment = clip->markersText(GenTime(in, m_doc->fps()), GenTime(out, m_doc->fps()));
sub->setDescription(markersComment.join(";"));
sub->setDescription(markersComment.join(QStringLiteral(";")));
QList <int> missingThumbs;
missingThumbs << in;
clip->slotExtractImage(missingThumbs);
......@@ -2851,7 +2851,7 @@ void Bin::updateTimecodeFormat()
void Bin::slotGotFilterJobResults(QString id, int startPos, int track, stringMap results, stringMap filterInfo)
{
if (filterInfo.contains("finalfilter")) {
if (filterInfo.contains(QStringLiteral("finalfilter"))) {
if (filterInfo.contains(QStringLiteral("storedata"))) {
// Store returned data as clip extra data
ProjectClip *clip = getBinClip(id);
......@@ -2867,9 +2867,9 @@ void Bin::slotGotFilterJobResults(QString id, int startPos, int track, stringMap
if (!currentItem) return;
ClipController *ctl = currentItem->controller();
EffectsList list = ctl->effectList();
QDomElement effect = list.effectById(filterInfo.value("finalfilter"));
QDomElement effect = list.effectById(filterInfo.value(QStringLiteral("finalfilter")));
QDomDocument doc;
QDomElement e = doc.createElement("test");
QDomElement e = doc.createElement(QStringLiteral("test"));
doc.appendChild(e);
e.appendChild(doc.importNode(effect, true));
if (!effect.isNull()) {
......@@ -2879,7 +2879,7 @@ void Bin::slotGotFilterJobResults(QString id, int startPos, int track, stringMap
EffectsList::setParameter(newEffect, i.key(), i.value());
++i;
}
ctl->updateEffect(pCore->monitorManager()->projectMonitor()->profileInfo(), newEffect, effect.attribute("kdenlive_ix").toInt());
ctl->updateEffect(pCore->monitorManager()->projectMonitor()->profileInfo(), newEffect, effect.attribute(QStringLiteral("kdenlive_ix")).toInt());
emit masterClipUpdated(ctl, m_monitor);
// TODO use undo / redo for bin clip edit effect
/*EditEffectCommand *command = new EditEffectCommand(this, clip->track(), clip->startPos(), effect, newEffect, clip->selectedEffectIndex(), true, true);
......@@ -3442,8 +3442,8 @@ void Bin::reloadAllProducers()
QDomDocument doc;
QDomElement xml = clip->toXml(doc);
// Make sure we reload clip length
xml.removeAttribute("out");
EffectsList::removeProperty(xml, "length");
xml.removeAttribute(QStringLiteral("out"));
EffectsList::removeProperty(xml, QStringLiteral("length"));
if (!xml.isNull()) {
clip->setClipStatus(AbstractProjectItem::StatusWaiting);
clip->discardAudioThumb();
......@@ -3488,10 +3488,10 @@ void Bin::getBinStats(uint *used, uint *unused, qint64 *usedSize, qint64 *unused
foreach(ProjectClip *clip, clipList) {
if (clip->refCount() == 0) {
*unused += 1;
*unusedSize += clip->getProducerInt64Property("kdenlive:file_size");
*unusedSize += clip->getProducerInt64Property(QStringLiteral("kdenlive:file_size"));
} else {
*used += 1;
*usedSize += clip->getProducerInt64Property("kdenlive:file_size");
*usedSize += clip->getProducerInt64Property(QStringLiteral("kdenlive:file_size"));
}
}
}
......@@ -3520,7 +3520,7 @@ bool Bin::addClip(QDomElement elem, const QString &clipId)
const QString producerId = clipId.section('_', 0, 0);
elem.setAttribute(QStringLiteral("id"), producerId);
if ((KdenliveSettings::default_profile().isEmpty() || KdenliveSettings::checkfirstprojectclip()) && isEmpty()) {
elem.setAttribute("checkProfile", 1);
elem.setAttribute(QStringLiteral("checkProfile"), 1);
}
createClip(elem);
m_doc->getFileProperties(elem, producerId, 150, true);
......
......@@ -337,7 +337,7 @@ bool ProjectClip::setProducer(ClipController *controller, bool replaceProducer)
bool isNewProducer = true;
if (m_controller) {
// Replace clip for this controller
resetProducerProperty("kdenlive:file_hash");
resetProducerProperty(QStringLiteral("kdenlive:file_hash"));
isNewProducer = false;
}
else if (controller) {
......@@ -594,8 +594,8 @@ void ProjectClip::setProperties(QMap <QString, QString> properties, bool refresh
bool reload = false;
// Some properties also need to be passed to track producers
QStringList timelineProperties;
if (properties.contains(QLatin1String("templatetext"))) {
m_description = properties.value(QLatin1String("templatetext"));
if (properties.contains(QStringLiteral("templatetext"))) {
m_description = properties.value(QStringLiteral("templatetext"));
bin()->emitItemUpdated(this);
refreshPanel = true;
}
......@@ -957,7 +957,7 @@ const QString ProjectClip::getAudioThumbPath(AudioStreamInfo *audioInfo)
audioPath.append("_" + QString::number(audioInfo->audio_index()));
}
int roundedFps = (int) m_controller->profile()->fps();
audioPath.append(QString("_%1_audio.png").arg(roundedFps));
audioPath.append(QStringLiteral("_%1_audio.png").arg(roundedFps));
return audioPath;
}
......@@ -1012,32 +1012,32 @@ void ProjectClip::slotCreateAudioThumbs()
// Output progress info
args << QStringLiteral("-progress") << QStringLiteral("/dev/stdout");
bool isFFmpeg = KdenliveSettings::ffmpegpath().contains("ffmpeg");
bool isFFmpeg = KdenliveSettings::ffmpegpath().contains(QLatin1String("ffmpeg"));
if (channels == 1) {
if (isFFmpeg) {
args << QStringLiteral("-filter_complex:a") << QStringLiteral("aformat=channel_layouts=mono,aresample=async=100");
args << QStringLiteral("-map") << QStringLiteral("0:a%1").arg(audioStream > 0 ? ":" + QString::number(audioStream) : "") << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("data")<< channelFiles[0]->fileName();
args << QStringLiteral("-map") << QStringLiteral("0:a%1").arg(audioStream > 0 ? ":" + QString::number(audioStream) : QLatin1String("")) << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("data")<< channelFiles[0]->fileName();
} else {
args << QStringLiteral("-filter_complex:a") << QStringLiteral("aformat=channel_layouts=mono:sample_rates=100");
args << QStringLiteral("-map") << QStringLiteral("0:a%1").arg(audioStream > 0 ? ":" + QString::number(audioStream) : "") << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("s16le")<< channelFiles[0]->fileName();
args << QStringLiteral("-map") << QStringLiteral("0:a%1").arg(audioStream > 0 ? ":" + QString::number(audioStream) : QLatin1String("")) << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("s16le")<< channelFiles[0]->fileName();
}
} else if (channels == 2) {
if (isFFmpeg) {
args << QStringLiteral("-filter_complex:a") << QStringLiteral("[0:a%1]aresample=async=100,channelsplit=channel_layout=stereo[0:0][0:1]").arg(audioStream > 0 ? ":" + QString::number(audioStream) : "");
args << QStringLiteral("-filter_complex:a") << QStringLiteral("[0:a%1]aresample=async=100,channelsplit=channel_layout=stereo[0:0][0:1]").arg(audioStream > 0 ? ":" + QString::number(audioStream) : QLatin1String(""));
// Channel 1
args << QStringLiteral("-map") << QStringLiteral("[0:1]") << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("data")<< channelFiles[0]->fileName();
// Channel 2
args << QStringLiteral("-map") << QStringLiteral("[0:0]") << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("data")<< channelFiles[1]->fileName();
} else {
args << QStringLiteral("-filter_complex:a") << QStringLiteral("[0:a%1]aformat=sample_rates=100,channelsplit=channel_layout=stereo[0:0][0:1]").arg(audioStream > 0 ? ":" + QString::number(audioStream) : "");
args << QStringLiteral("-filter_complex:a") << QStringLiteral("[0:a%1]aformat=sample_rates=100,channelsplit=channel_layout=stereo[0:0][0:1]").arg(audioStream > 0 ? ":" + QString::number(audioStream) : QLatin1String(""));
// Channel 1
args << QStringLiteral("-map") << QStringLiteral("[0:1]") << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("s16le")<< channelFiles[0]->fileName();
// Channel 2
args << QStringLiteral("-map") << QStringLiteral("[0:0]") << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("s16le")<< channelFiles[1]->fileName();
}
} else if (channels == 6) {
args << QStringLiteral("-filter_complex:a") << QStringLiteral("[0:a%1]aresample=async=100,channelsplit=channel_layout=5.1[0:0][0:1][0:2][0:3][0:4][0:5]").arg(audioStream > 0 ? ":" + QString::number(audioStream) : "");
args << QStringLiteral("-filter_complex:a") << QStringLiteral("[0:a%1]aresample=async=100,channelsplit=channel_layout=5.1[0:0][0:1][0:2][0:3][0:4][0:5]").arg(audioStream > 0 ? ":" + QString::number(audioStream) : QLatin1String(""));
for (int i = 0; i < channels; i++) {
// Channel 1
args << QStringLiteral("-map") << QStringLiteral("[0:%1]").arg(i) << QStringLiteral("-c:a") << QStringLiteral("pcm_s16le") << QStringLiteral("-y") << QStringLiteral("-f") << QStringLiteral("data")<< channelFiles[i]->fileName();
......
......@@ -143,7 +143,7 @@ const QString MltVideoProfile::descriptiveString()
} else {
fps = QString::number((double)frame_rate_num / frame_rate_den, 'f', 2);
}
data.append(QString("(%1x%2, %3fps)").arg(width).arg(height).arg(fps));
data.append(QStringLiteral("(%1x%2, %3fps)").arg(width).arg(height).arg(fps));
return data;
}
......
......@@ -127,7 +127,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
// Video 4 Linux device detection
for (int i = 0; i < 10; ++i) {
QString path = QLatin1String("/dev/video") + QString::number(i);
QString path = QStringLiteral("/dev/video") + QString::number(i);
if (QFile::exists(path)) {
QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path);
if (!deviceInfo.isEmpty()) {
......
......@@ -1076,16 +1076,16 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
}
bool resizeProfile = false;
if (renderArgs.contains("%dv_standard")) {
if (renderArgs.contains(QLatin1String("%dv_standard"))) {
QString std;
if (fmod((double)m_profile.frame_rate_num / m_profile.frame_rate_den, 30.01) > 27) {
std = "ntsc";
std = QStringLiteral("ntsc");
if (!(m_profile.frame_rate_num == 30000 && m_profile.frame_rate_den == 1001))
forcedfps = 30000.0 / 1001;
if (!(m_profile.width == 720 && m_profile.height == 480))
resizeProfile = true;
} else {
std = "pal";
std = QStringLiteral("pal");
if (!(m_profile.frame_rate_num == 25 && m_profile.frame_rate_den == 1))
forcedfps = 25;
if (!(m_profile.width == 720 && m_profile.height == 576))
......@@ -1093,8 +1093,8 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
}
if ((double) m_profile.display_aspect_num / m_profile.display_aspect_den > 1.5)
std += "_wide";
renderArgs.replace("%dv_standard", std);
std += QLatin1String("_wide");
renderArgs.replace(QLatin1String("%dv_standard"), std);
}
// If there is an fps change, we need to use the producer consumer AND update the in/out points
......@@ -1579,7 +1579,7 @@ void RenderWidget::refreshParams()
QString params = item->data(0, ParamsRole).toString();
errorMessage(ProfileError, item->data(0, ErrorRole).toString());
m_view.advanced_params->setPlainText(params);
if (params.contains(QStringLiteral(" s=")) || params.startsWith(QLatin1String("s=")) || params.contains("%dv_standard")) {
if (params.contains(QStringLiteral(" s=")) || params.startsWith(QLatin1String("s=")) || params.contains(QLatin1String("%dv_standard"))) {
// profile has a fixed size, do not allow resize
m_view.rescale->setEnabled(false);
setRescaleEnabled(false);
......@@ -1780,7 +1780,7 @@ void RenderWidget::parseMltPresets()
root.cdUp();
QTreeWidgetItem *item = loadFromMltPreset(groupName, root.absoluteFilePath(QStringLiteral("GIF")), QStringLiteral("GIF"));
if (item) {
item->setData(0, ParamsRole, QString("properties=GIF"));
item->setData(0, ParamsRole, QStringLiteral("properties=GIF"));
groupItem->addChild(item);
}
}
......@@ -1908,13 +1908,13 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
item->setData(0, RenderRole, "avformat");
item->setData(0, StandardRole, standard);
item->setData(0, ParamsRole, params);
if (params.contains("%quality"))
if (params.contains(QLatin1String("%quality")))
item->setData(0, BitratesRole, profile.attribute(QStringLiteral("qualities")).split(',', QString::SkipEmptyParts));
else if (params.contains("%bitrate"))
else if (params.contains(QLatin1String("%bitrate")))
item->setData(0, BitratesRole, profile.attribute(QStringLiteral("bitrates")).split(',', QString::SkipEmptyParts));
if (params.contains("%audioquality"))
if (params.contains(QLatin1String("%audioquality")))
item->setData(0, AudioBitratesRole, profile.attribute(QStringLiteral("audioqualities")).split(',', QString::SkipEmptyParts));
else if (params.contains("%audiobitrate"))
else if (params.contains(QLatin1String("%audiobitrate")))
item->setData(0, AudioBitratesRole, profile.attribute(QStringLiteral("audiobitrates")).split(',', QString::SkipEmptyParts));
if (profile.hasAttribute(QStringLiteral("speeds")))
item->setData(0, SpeedsRole, profile.attribute(QStringLiteral("speeds")).split(';', QString::SkipEmptyParts));
......@@ -1987,13 +1987,13 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
item->setData(0, RenderRole, renderer);
item->setData(0, StandardRole, standard);
item->setData(0, ParamsRole, params);
if (params.contains("%quality"))
if (params.contains(QLatin1String("%quality")))
item->setData(0, BitratesRole, profileElement.attribute(QStringLiteral("qualities")).split(',', QString::SkipEmptyParts));
else if (params.contains("%bitrate"))
else if (params.contains(QLatin1String("%bitrate")))
item->setData(0, BitratesRole, profileElement.attribute(QStringLiteral("bitrates")).split(',', QString::SkipEmptyParts));
if (params.contains("%audioquality"))
if (params.contains(QLatin1String("%audioquality")))
item->setData(0, AudioBitratesRole, profileElement.attribute(QStringLiteral("audioqualities")).split(',', QString::SkipEmptyParts));
else if (params.contains("%audiobitrate"))
else if (params.contains(QLatin1String("%audiobitrate")))
item->setData(0, AudioBitratesRole, profileElement.attribute(QStringLiteral("audiobitrates")).split(',', QString::SkipEmptyParts));
if (profileElement.hasAttribute(QStringLiteral("speeds")))
item->setData(0, SpeedsRole, profileElement.attribute(QStringLiteral("speeds")).split(';', QString::SkipEmptyParts));
......
......@@ -87,7 +87,7 @@ Wizard::Wizard(bool autoClose, QWidget *parent) :
m_page = new MyWizardPage(this);
m_page->setTitle(i18n("Welcome to Kdenlive %1", QString(kdenlive_version)));
m_page->setSubTitle(i18n("Using MLT %1", mlt_version_get_string()));
setPixmap(QWizard::LogoPixmap, KoIconUtils::themedIcon("kdenlive").pixmap(logoHeight, logoHeight));
setPixmap(QWizard::LogoPixmap, KoIconUtils::themedIcon(QStringLiteral("kdenlive")).pixmap(logoHeight, logoHeight));
m_startLayout = new QVBoxLayout;
m_errorWidget = new KMessageWidget(this);
m_startLayout->addWidget(m_errorWidget);
......
This diff is collapsed.
......@@ -1496,7 +1496,7 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
parsedValues << QString::number(l.key()) + "=" + locale.toString(l.value());
}
}
EffectsList::setProperty(eff, conversionParams.at(2), parsedValues.join(";"));
EffectsList::setProperty(eff, conversionParams.at(2), parsedValues.join(QStringLiteral(";")));
EffectsList::setProperty(eff, QStringLiteral("kdenlive:sync_in_out"), QStringLiteral("1"));
eff.setAttribute(QStringLiteral("out"), out);
}
......@@ -1523,7 +1523,7 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
EffectsList::setProperty(prod, QStringLiteral("warp_resource"), resource.section(QStringLiteral("?"), 0, 0));
EffectsList::setProperty(prod, QStringLiteral("warp_speed"), resource.section(QStringLiteral("?"), 1).section(QStringLiteral(":"), 0, 0));
EffectsList::setProperty(prod, QStringLiteral("resource"), resource.section(QStringLiteral("?"), 1) + ":" + resource.section(QStringLiteral("?"), 0, 0));
EffectsList::setProperty(prod, QStringLiteral("audio_index"), "-1");
EffectsList::setProperty(prod, QStringLiteral("audio_index"), QStringLiteral("-1"));
}
}
}
......@@ -1549,7 +1549,7 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
if (prod.isNull()) continue;
QString id = prod.attribute(QStringLiteral("id")).section(QStringLiteral("_"), 0, 0);
if (id == QLatin1String("black")) {
EffectsList::setProperty(prod, "set.test_audio", "0");
EffectsList::setProperty(prod, QStringLiteral("set.test_audio"), QStringLiteral("0"));
break;
}
}
......@@ -2008,7 +2008,7 @@ void DocumentValidator::checkOrphanedProducers()
QString binId = binProd.attribute(QStringLiteral("id")).section(QStringLiteral("_"), 0, 0);
if (service != QLatin1String("timewarp") && (binId.startsWith(QLatin1String("slowmotion")) || !binProducers.contains(binId))) continue;
QString binService = EffectsList::property(binProd, QStringLiteral("mlt_service"));
qDebug()<<" / /LKNG FOR: "<<service<<" / "<<orphanValue<<", checking: "<<binProd.attribute("id");
qDebug()<<" / /LKNG FOR: "<<service<<" / "<<orphanValue<<", checking: "<<binProd.attribute(QStringLiteral("id"));
if (service != binService) continue;
QString binValue = EffectsList::property(binProd, distinctiveTag);
if (binValue == orphanValue) {
......@@ -2050,7 +2050,7 @@ void DocumentValidator::checkOrphanedProducers()
void DocumentValidator::fixTitleProducerLocale(QDomElement &producer)
{
QString data = EffectsList::property(producer, "xmldata");
QString data = EffectsList::property(producer, QStringLiteral("xmldata"));
QDomDocument doc;
doc.setContent(data);
QDomNodeList nodes = doc.elementsByTagName(QStringLiteral("position"));
......
......@@ -1508,7 +1508,7 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
// We found a known matching profile, switch and inform user
QMap< QString, QString > profileProperties = ProfilesDialog::getSettingsFromFile(matchingProfile);
profile.path = matchingProfile;
profile.description = profileProperties.value("description");
profile.description = profileProperties.value(QStringLiteral("description"));
if (KdenliveSettings::default_profile().isEmpty()) {
// Default project format not yet confirmed, propose
......@@ -1551,7 +1551,7 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
// No known profile, ask user if he wants to use clip profile anyway
if (KMessageBox::warningContinueCancel(QApplication::activeWindow(), i18n("No profile found for your clip.\nCreate and switch to new profile (%1x%2, %3fps)?", profile.width, profile.height, QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2))) == KMessageBox::Continue) {
m_profile = profile;
m_profile.description = QString("%1x%2 %3fps").arg(profile.width).arg(profile.height).arg(QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2));
m_profile.description = QStringLiteral("%1x%2 %3fps").arg(profile.width).arg(profile.height).arg(QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2));
ProfilesDialog::saveProfile(m_profile);
updateProjectProfile(true);
emit docModified(true);
......@@ -1606,13 +1606,13 @@ void KdenliveDoc::selectPreviewProfile()
QMapIterator<QString, QString> i(values);
QStringList matchingProfiles;
QStringList fallBackProfiles;
QString profileSize = QString("%1x%2").arg(m_render->renderWidth()).arg(m_render->renderHeight());
QString profileSize = QStringLiteral("%1x%2").arg(m_render->renderWidth()).arg(m_render->renderHeight());
while (i.hasNext()) {
i.next();
// Check for frame rate
QString params = i.value();
QStringList data = i.value().split(" ");
QStringList data = i.value().split(QStringLiteral(" "));
// Check for size mismatch
if (params.contains(QStringLiteral("s="))) {
QString paramSize = params.section(QStringLiteral("s="), 1).section(QStringLiteral(" "), 0, 0);
......@@ -1644,8 +1644,8 @@ void KdenliveDoc::selectPreviewProfile()
bestMatch = fallBackProfiles.first();
}
if (!bestMatch.isEmpty()) {
setDocumentProperty(QStringLiteral("previewparameters"), bestMatch.section(";", 0, 0));
setDocumentProperty(QStringLiteral("previewextension"), bestMatch.section(";", 1, 1));
setDocumentProperty(QStringLiteral("previewparameters"), bestMatch.section(QStringLiteral(";"), 0, 0));
setDocumentProperty(QStringLiteral("previewextension"), bestMatch.section(QStringLiteral(";"), 1, 1));
} else {
setDocumentProperty(QStringLiteral("previewparameters"), QStringLiteral());
setDocumentProperty(QStringLiteral("previewextension"), QStringLiteral());
......@@ -1679,12 +1679,12 @@ void KdenliveDoc::initCacheDirs()
}
QString basePath = kdenliveCacheDir + "/" + documentId;
QDir dir(basePath);
dir.mkpath(".");
dir.mkdir("preview");
dir.mkdir("audiothumbs");
dir.mkdir("videothumbs");
dir.mkpath(QStringLiteral("."));
dir.mkdir(QStringLiteral("preview"));
dir.mkdir(QStringLiteral("audiothumbs"));
dir.mkdir(QStringLiteral("videothumbs"));
QDir cacheDir(kdenliveCacheDir);
cacheDir.mkdir("proxy");
cacheDir.mkdir(QStringLiteral("proxy"));
}
QDir KdenliveDoc::getCacheDir(CacheType type, bool *ok) const
......
......@@ -909,12 +909,12 @@ void DvdWizard::slotAbort()
void DvdWizard::slotSave()
{
QString projectFolder = KRecentDirs::dir(":KdenliveDvdFolder");
QString projectFolder = KRecentDirs::dir(QStringLiteral(":KdenliveDvdFolder"));
if (projectFolder.isEmpty()) projectFolder = QDir::homePath();
QUrl url = QFileDialog::getSaveFileUrl(this, i18n("Save DVD Project"), QUrl::fromLocalFile(projectFolder), i18n("DVD project (*.kdvd)"));
if (!url.isValid())
return;
KRecentDirs::add(":KdenliveDvdFolder", url.adjusted(QUrl::RemoveFilename).path());
KRecentDirs::add(QStringLiteral(":KdenliveDvdFolder"), url.adjusted(QUrl::RemoveFilename).path());
if (currentId() == 0)
m_pageChapters->setVobFiles(m_pageVob->dvdFormat(), m_pageVob->selectedUrls(), m_pageVob->durations(), m_pageVob->chapters());
......@@ -948,12 +948,12 @@ void DvdWizard::slotSave()
void DvdWizard::slotLoad()
{
QString projectFolder = KRecentDirs::dir(":KdenliveDvdFolder");
QString projectFolder = KRecentDirs::dir(QStringLiteral(":KdenliveDvdFolder"));
if (projectFolder.isEmpty()) projectFolder = QDir::homePath();
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl::fromLocalFile(projectFolder), i18n("DVD project (*.kdvd)"));
if (!url.isValid())
return;
KRecentDirs::add(":KdenliveDvdFolder", url.adjusted(QUrl::RemoveFilename).path());
KRecentDirs::add(QStringLiteral(":KdenliveDvdFolder"), url.adjusted(QUrl::RemoveFilename).path());
QDomDocument doc;
QFile file(url.path());
doc.setContent(&file, false);
......
......@@ -88,7 +88,7 @@ QDomElement EffectsList::effectById(const QString & id) const
QDomNodeList effects = m_baseElement.childNodes();
for (int i = 0; i < effects.count(); ++i) {
QDomElement effect = effects.at(i).toElement();
if (!id.isEmpty() && effect.attribute("id") == id) {
if (!id.isEmpty() && effect.attribute(QStringLiteral("id")) == id) {
return effect;
}
}
......
......@@ -255,7 +255,7 @@ void EffectsListView::filterList()
QString currentSearch = m_search_effect->text();
if (!currentSearch.isEmpty()) {
// There seems to be a problem with KTreeWidgetSearchLine when inserting items, so reset the search
m_search_effect->updateSearch("###");
m_search_effect->updateSearch(QStringLiteral("###"));
m_search_effect->updateSearch(currentSearch);
}
return;
......@@ -280,7 +280,7 @@ void EffectsListView::filterList()
QString currentSearch = m_search_effect->text();
if (!currentSearch.isEmpty()) {
// There seems to be a problem with KTreeWidgetSearchLine when inserting items, so reset the search
m_search_effect->updateSearch("###");
m_search_effect->updateSearch(QStringLiteral("###"));
m_search_effect->updateSearch(currentSearch);
}
return;
......@@ -301,7 +301,7 @@ void EffectsListView::filterList()
QString currentSearch = m_search_effect->text();
if (!currentSearch.isEmpty()) {
// There seems to be a problem with KTreeWidgetSearchLine when inserting items, so reset the search
m_search_effect->updateSearch("###");
m_search_effect->updateSearch(QStringLiteral("###"));
m_search_effect->updateSearch(currentSearch);
}
return;
......
......@@ -634,10 +634,10 @@ void CollapsibleEffect::importKeyframes(const QString &keyframes)
if (keyframes.contains(QLatin1Char('\n'))) {
QStringList params = keyframes.split(QLatin1Char('\n'), QString::SkipEmptyParts);
foreach(const QString &param, params) {
data.insert(param.section("=", 0, 0), param.section("=", 1));
data.insert(param.section(QStringLiteral("="), 0, 0), param.section(QStringLiteral("="), 1));
}
} else {
data.insert(keyframes.section("=", 0, 0), keyframes.section("=", 1));
data.insert(keyframes.section(QStringLiteral("="), 0, 0), keyframes.section(QStringLiteral("="), 1));
}
emit importClipKeyframes(AVWidget, m_itemInfo, m_effect.cloneNode().toElement(), data);
}
......
......@@ -207,10 +207,10 @@ void EffectStackEdit::importKeyframes(const QString &keyframes)
if (keyframes.contains(QLatin1Char('\n'))) {
QStringList params = keyframes.split(QLatin1Char('\n'), QString::SkipEmptyParts);
foreach(const QString &param, params) {
data.insert(param.section("=", 0, 0), param.section("=", 1));
data.insert(param.section(QStringLiteral("="), 0, 0), param.section(QStringLiteral("="), 1));
}
} else {
data.insert(keyframes.section("=", 0, 0), keyframes.section("=", 1));
data.insert(keyframes.section(QStringLiteral("="), 0, 0), keyframes.section(QStringLiteral("="), 1));
}
emit importClipKeyframes(TransitionWidget, data);
}
......@@ -340,7 +340,7 @@ ParameterContainer::ParameterContainer(const QDomElement &effect, const ItemInfo
} else if (type == QLatin1String("switch")) {
Boolval *bval = new Boolval;
bval->setupUi(toFillin);
bval->checkBox->setCheckState(value == pa.attribute("min") ? Qt::Unchecked : Qt::Checked);
bval->checkBox->setCheckState(value == pa.attribute(QStringLiteral("min")) ? Qt::Unchecked : Qt::Checked);
bval->name->setText(paramName);
bval->name->setToolTip(comment);
bval->labelComment->setText(comment);
......@@ -685,7 +685,7 @@ ParameterContainer::ParameterContainer(const QDomElement &effect, const ItemInfo
connect(button, SIGNAL(pressed()), this, SLOT(slotStartFilterJobAction()));
} else if (type == QLatin1String("readonly")) {
QHBoxLayout *lay= new QHBoxLayout(toFillin);
DraggableLabel *lab = new DraggableLabel(QString("<a href=\"%1\">").arg(pa.attribute(QStringLiteral("name"))) + paramName + QStringLiteral("</a>"));
DraggableLabel *lab = new DraggableLabel(QStringLiteral("<a href=\"%1\">").arg(pa.attribute(QStringLiteral("name"))) + paramName + QStringLiteral("</a>"));
lab->setObjectName(pa.attribute(QStringLiteral("name")));
connect(lab, &QLabel::linkActivated, this, &ParameterContainer::copyData);