Commit 698bd746 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QStringLiteral where necessary

parent a4230e44
......@@ -84,19 +84,19 @@ int main(int argc, char **argv)
if (vprepos >= 0) {
vpre=args.at(vprepos);
}
QStringList vprelist = vpre.remove(QLatin1String("vpre=")).split(QLatin1Char(','));
QStringList vprelist = vpre.remove(QStringLiteral("vpre=")).split(QLatin1Char(','));
if (vprelist.size() > 0) {
args.replaceInStrings(QRegExp(QLatin1String("^vpre=.*")), QString::fromLatin1("vpre=%1").arg(vprelist.at(0)));
args.replaceInStrings(QRegExp(QLatin1String("^vpre=.*")), QStringLiteral("vpre=%1").arg(vprelist.at(0)));
}
if (args.contains(QLatin1String("pass=2"))) {
if (args.contains(QStringLiteral("pass=2"))) {
// dual pass encoding
dualpass = true;
doerase = false;
args.replace(args.indexOf(QLatin1String("pass=2")), QLatin1String("pass=1"));
if (args.contains(QLatin1String("vcodec=libx264"))) args << QString::fromLatin1("passlogfile=%1").arg(dest + QLatin1String(".log"));
args.replace(args.indexOf(QStringLiteral("pass=2")), QStringLiteral("pass=1"));
if (args.contains(QStringLiteral("vcodec=libx264"))) args << QStringLiteral("passlogfile=%1").arg(dest + QStringLiteral(".log"));
} else {
args.removeAll(QLatin1String("pass=1"));
args.removeAll(QStringLiteral("pass=1"));
doerase = erase;
}
......@@ -104,7 +104,7 @@ int main(int argc, char **argv)
for (int i = 0; i < args.count(); ++i) {
if (args.at(i).startsWith(QLatin1String("meta.attr"))) {
QString data = args.at(i);
args.replace(i, data.section(QLatin1Char('='), 0, 0) + QLatin1String("=\"") + QUrl::fromPercentEncoding(data.section(QLatin1Char('='), 1).toUtf8()) + QLatin1Char('\"'));
args.replace(i, data.section(QLatin1Char('='), 0, 0) + QStringLiteral("=\"") + QUrl::fromPercentEncoding(data.section(QLatin1Char('='), 1).toUtf8()) + QLatin1Char('\"'));
}
}
......@@ -114,8 +114,8 @@ int main(int argc, char **argv)
job->start();
if (dualpass) {
if (vprelist.size()>1)
args.replaceInStrings(QRegExp(QLatin1String("^vpre=.*")),QString::fromLatin1("vpre=%1").arg(vprelist.at(1)));
args.replace(args.indexOf(QLatin1String("pass=1")), QLatin1String("pass=2"));
args.replaceInStrings(QRegExp(QLatin1String("^vpre=.*")),QStringLiteral("vpre=%1").arg(vprelist.at(1)));
args.replace(args.indexOf(QStringLiteral("pass=1")), QStringLiteral("pass=2"));
RenderJob *dualjob = new RenderJob(erase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
QObject::connect(job, SIGNAL(renderingFinished()), dualjob, SLOT(start()));
}
......
......@@ -62,19 +62,19 @@ RenderJob::RenderJob(bool erase, bool usekuiserver, int pid, const QString& rend
qputenv("MLT_NO_VDPAU", "1");
m_args << scenelist;
if (in != -1) m_args << QLatin1String("in=") + QString::number(in);
if (out != -1) m_args << QLatin1String("out=") + QString::number(out);
if (in != -1) m_args << QStringLiteral("in=") + QString::number(in);
if (out != -1) m_args << QStringLiteral("out=") + QString::number(out);
m_args << preargs;
if (scenelist.startsWith(QLatin1String("consumer:"))) {
// Use MLT's producer_consumer, needs a different syntax for profile:
m_args << QLatin1String("profile=") + profile;
m_args << QStringLiteral("profile=") + profile;
} else {
m_args << QLatin1String("-profile") << profile;
m_args << QStringLiteral("-profile") << profile;
}
m_args << QLatin1String("-consumer") << rendermodule + QLatin1Char(':') + m_dest
<< QLatin1String("progress=1") << args;
m_args << QStringLiteral("-consumer") << rendermodule + QLatin1Char(':') + m_dest
<< QStringLiteral("progress=1") << args;
m_dualpass = args.contains(QLatin1String("pass=1"));
m_dualpass = args.contains(QStringLiteral("pass=1"));
// Create a log of every render process.
if (!m_logfile.open(QIODevice::WriteOnly|QIODevice::Text)) qWarning() << "Unable to log to " << m_logfile.fileName();
......@@ -106,9 +106,9 @@ void RenderJob::slotAbort()
if (m_kdenliveinterface) {
m_dbusargs[1] = -3;
m_dbusargs.append(QString());
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingFinished"), m_dbusargs);
}
if (m_jobUiserver) m_jobUiserver->call(QLatin1String("terminate"), QString());
if (m_jobUiserver) m_jobUiserver->call(QStringLiteral("terminate"), QString());
if (m_erase) QFile(m_scenelist).remove();
QFile(m_dest).remove();
m_logstream << "Job aborted by user" << endl;
......@@ -121,30 +121,30 @@ void RenderJob::receivedStderr()
{
QString result = QString::fromLocal8Bit(m_renderProcess->readAllStandardError()).simplified();
if (!result.startsWith(QLatin1String("Current Frame"))) {
m_errorMessage.append(result + QLatin1String("<br>"));
m_errorMessage.append(result + QStringLiteral("<br>"));
} else {
m_logstream << "melt: " << result << endl;
int pro = result.section(QLatin1Char(' '), -1).toInt();
if (pro <= m_progress || pro <= 0 || pro > 100) return;
m_progress = pro;
if (m_args.contains(QLatin1String("pass=1"))) {
if (m_args.contains(QStringLiteral("pass=1"))) {
m_progress /= 2.0;
} else if (m_args.contains(QLatin1String("pass=2"))) {
} else if (m_args.contains(QStringLiteral("pass=2"))) {
m_progress = 50 + m_progress / 2.0;
}
int frame = result.section(QLatin1Char(','), 1).section(QLatin1Char(' '), -1).toInt();
if (m_kdenliveinterface && m_kdenliveinterface->isValid()) {
m_dbusargs[1] = m_progress;
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingProgress"), m_dbusargs);
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingProgress"), m_dbusargs);
}
if (m_jobUiserver) {
m_jobUiserver->call(QLatin1String("setPercent"), (uint) m_progress);
m_jobUiserver->call(QStringLiteral("setPercent"), (uint) m_progress);
int seconds = m_startTime.secsTo(QTime::currentTime());
if (seconds == m_seconds) return;
if (seconds < 0) seconds += 24*60*60;
m_jobUiserver->call("setDescriptionField", (uint) 1,
m_jobUiserver->call(QStringLiteral("setDescriptionField"), (uint) 1,
tr("Remaining time"),
QTime().addSecs(seconds * (100 - m_progress) / m_progress).toString("hh:mm:ss"));
QTime().addSecs(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;
......@@ -156,13 +156,13 @@ void RenderJob::start()
{
QDBusConnectionInterface* interface = QDBusConnection::sessionBus().interface();
if (interface && m_usekuiserver) {
if (!interface->isServiceRegistered(QLatin1String("org.kde.JobViewServer"))) {
if (!interface->isServiceRegistered(QStringLiteral("org.kde.JobViewServer"))) {
qWarning() << "No org.kde.JobViewServer registered, trying to start kuiserver";
if (QProcess::startDetached(QLatin1String("kuiserver"))) {
if (QProcess::startDetached(QStringLiteral("kuiserver"))) {
// Give it a couple of seconds to start
QTime t;
t.start();
while (!interface->isServiceRegistered(QLatin1String("org.kde.JobViewServer")) && t.elapsed() < 3000) {
while (!interface->isServiceRegistered(QStringLiteral("org.kde.JobViewServer")) && t.elapsed() < 3000) {
SleepThread::msleep(100); //Sleep 100 ms
}
} else {
......@@ -170,22 +170,22 @@ void RenderJob::start()
}
}
if (interface->isServiceRegistered(QLatin1String("org.kde.JobViewServer"))) {
QDBusInterface kuiserver(QLatin1String("org.kde.JobViewServer"), QLatin1String("/JobViewServer"), QLatin1String("org.kde.JobViewServer"));
QDBusReply<QDBusObjectPath> objectPath = kuiserver.call(QLatin1String("requestView"),QLatin1String("Kdenlive"), QLatin1String("kdenlive"), 0x0001);
if (interface->isServiceRegistered(QStringLiteral("org.kde.JobViewServer"))) {
QDBusInterface kuiserver(QStringLiteral("org.kde.JobViewServer"), QStringLiteral("/JobViewServer"), QStringLiteral("org.kde.JobViewServer"));
QDBusReply<QDBusObjectPath> objectPath = kuiserver.call(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
QString dbusView = QLatin1String("org.kde.JobViewV2");
m_jobUiserver = new QDBusInterface(QLatin1String("org.kde.JobViewServer"), reply, dbusView);
QString dbusView = QStringLiteral("org.kde.JobViewV2");
m_jobUiserver = new QDBusInterface(QStringLiteral("org.kde.JobViewServer"), reply, dbusView);
if (m_jobUiserver && m_jobUiserver->isValid()) {
m_startTime = QTime::currentTime();
if (!m_args.contains(QLatin1String("pass=2")))
m_jobUiserver->call(QLatin1String("setPercent"), (uint) 0);
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(QLatin1String("setDescriptionField"), (uint) 0, tr("Rendering"), m_dest);
QDBusConnection::sessionBus().connect(QLatin1String("org.kde.JobViewServer"), reply, dbusView, QLatin1String("cancelRequested"), this, SLOT(slotAbort()));
m_jobUiserver->call(QStringLiteral("setDescriptionField"), (uint) 0, tr("Rendering"), m_dest);
QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.JobViewServer"), reply, dbusView, QStringLiteral("cancelRequested"), this, SLOT(slotAbort()));
}
}
}
......@@ -201,7 +201,7 @@ void RenderJob::start()
// Because of the logging, we connect to stderr in all cases.
connect(m_renderProcess, SIGNAL(readyReadStandardError()), this, SLOT(receivedStderr()));
m_renderProcess->start(m_prog, m_args);
m_logstream << "Started render process: " << m_prog << ' ' << m_args.join(QLatin1String(" ")) << endl;
m_logstream << "Started render process: " << m_prog << ' ' << m_args.join(QStringLiteral(" ")) << endl;
}
......@@ -210,7 +210,7 @@ void RenderJob::initKdenliveDbusInterface()
QString kdenliveId;
QDBusConnection connection = QDBusConnection::sessionBus();
QDBusConnectionInterface* ibus = connection.interface();
kdenliveId = QString("org.kde.kdenlive-%1").arg(m_pid);
kdenliveId = QStringLiteral("org.kde.kdenlive-%1").arg(m_pid);
if (!ibus->isServiceRegistered(kdenliveId)) {
kdenliveId.clear();
const QStringList services = ibus->registeredServiceNames();
......@@ -224,16 +224,16 @@ void RenderJob::initKdenliveDbusInterface()
m_dbusargs.clear();
if (kdenliveId.isEmpty()) return;
m_kdenliveinterface = new QDBusInterface(kdenliveId,
QLatin1String("/kdenlive/MainWindow_1"),
QLatin1String("org.kde.kdenlive.rendering"),
QStringLiteral("/kdenlive/MainWindow_1"),
QStringLiteral("org.kde.kdenlive.rendering"),
connection,
this);
if (m_kdenliveinterface) {
m_dbusargs.append(m_dest);
m_dbusargs.append((int) 0);
if (!m_args.contains(QLatin1String("pass=2")))
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingProgress"), m_dbusargs);
if (!m_args.contains(QStringLiteral("pass=2")))
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingProgress"), m_dbusargs);
connect(m_kdenliveinterface, SIGNAL(abortRenderJob(QString)),
this, SLOT(slotAbort(QString)));
}
......@@ -249,15 +249,15 @@ void RenderJob::slotCheckProcess(QProcess::ProcessState state)
void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
{
if (m_jobUiserver) m_jobUiserver->call(QLatin1String("terminate"), QString());
if (m_jobUiserver) m_jobUiserver->call(QStringLiteral("terminate"), QString());
if (!isWritable) {
QString error = tr("Cannot write to %1, check permissions.").arg(m_dest);
if (m_kdenliveinterface) {
m_dbusargs[1] = (int) - 2;
m_dbusargs.append(error);
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingFinished"), m_dbusargs);
}
QProcess::startDetached("kdialog", QStringList() << "--error" << error);
QProcess::startDetached(QStringLiteral("kdialog"), QStringList() << QStringLiteral("--error") << error);
m_logstream << error << endl;
qApp->quit();
}
......@@ -267,19 +267,19 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
if (m_kdenliveinterface) {
m_dbusargs[1] = (int) - 2;
m_dbusargs.append(m_errorMessage);
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingFinished"), m_dbusargs);
}
QStringList args;
QString error = tr("Rendering of %1 aborted, resulting video will probably be corrupted.").arg(m_dest);
args << QLatin1String("--error") << error;
args << QStringLiteral("--error") << error;
m_logstream << error << endl;
QProcess::startDetached(QLatin1String("kdialog"), args);
QProcess::startDetached(QStringLiteral("kdialog"), args);
qApp->quit();
} else {
if (!m_dualpass && m_kdenliveinterface) {
m_dbusargs[1] = (int) - 1;
m_dbusargs.append(QString());
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingFinished"), m_dbusargs);
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingFinished"), m_dbusargs);
}
m_logstream << "Rendering of " << m_dest << " finished" << endl;
if (!m_dualpass && m_player != QLatin1String("-"))
......
......@@ -44,7 +44,7 @@ AbstractProjectItem::AbstractProjectItem(PROJECTITEMTYPE type, const QString &id
AbstractProjectItem::AbstractProjectItem(PROJECTITEMTYPE type, const QDomElement& description, AbstractProjectItem* parent) :
QObject()
, m_parent(parent)
, m_id(description.attribute("id"))
, m_id(description.attribute(QStringLiteral("id")))
, m_clipStatus(StatusReady)
, m_jobType(AbstractClipJob::NOJOBTYPE)
, m_jobProgress(0)
......
This diff is collapsed.
......@@ -60,7 +60,7 @@ ProjectClip::ProjectClip(const QString &id, QIcon thumb, ClipController *control
// Make sure we have a hash for this clip
hash();
setParent(parent);
bin()->loadSubClips(id, m_controller->getPropertiesFromPrefix("kdenlive:clipzone."));
bin()->loadSubClips(id, m_controller->getPropertiesFromPrefix(QStringLiteral("kdenlive:clipzone.")));
if (KdenliveSettings::audiothumbnails()) {
m_audioThumbsThread = QtConcurrent::run(this, &ProjectClip::slotCreateAudioThumbs);
}
......@@ -77,11 +77,11 @@ ProjectClip::ProjectClip(const QDomElement& description, QIcon thumb, ProjectFol
Q_ASSERT(description.hasAttribute("id"));
m_clipStatus = StatusWaiting;
m_thumbnail = thumb;
if (description.hasAttribute("type")) {
m_type = (ClipType) description.attribute("type").toInt();
if (description.hasAttribute(QStringLiteral("type"))) {
m_type = (ClipType) description.attribute(QStringLiteral("type")).toInt();
}
m_temporaryUrl = QUrl::fromLocalFile(getXmlProperty(description, "resource"));
QString clipName = getXmlProperty(description, "kdenlive:clipname");
m_temporaryUrl = QUrl::fromLocalFile(getXmlProperty(description, QStringLiteral("resource")));
QString clipName = getXmlProperty(description, QStringLiteral("kdenlive:clipname"));
if (!clipName.isEmpty()) {
m_name = clipName;
}
......@@ -108,9 +108,9 @@ QString ProjectClip::getToolTip() const
QString ProjectClip::getXmlProperty(const QDomElement &producer, const QString &propertyName, const QString &defaultValue)
{
QString value = defaultValue;
QDomNodeList props = producer.elementsByTagName("property");
QDomNodeList props = producer.elementsByTagName(QStringLiteral("property"));
for (int i = 0; i < props.count(); ++i) {
if (props.at(i).toElement().attribute("name") == propertyName) {
if (props.at(i).toElement().attribute(QStringLiteral("name")) == propertyName) {
value = props.at(i).firstChild().nodeValue();
break;
}
......@@ -225,7 +225,7 @@ void ProjectClip::reloadProducer(bool thumbnailOnly)
QDomElement xml = toXml(doc);
if (thumbnailOnly) {
// set a special flag to request thumbnail only
xml.setAttribute("thumbnailOnly", "1");
xml.setAttribute(QStringLiteral("thumbnailOnly"), QStringLiteral("1"));
}
bin()->reloadProducer(m_id, xml);
}
......@@ -243,7 +243,7 @@ QDomElement ProjectClip::toXml(QDomDocument& document)
{
if (m_controller) {
m_controller->getProducerXML(document);
return document.documentElement().firstChildElement("producer");
return document.documentElement().firstChildElement(QStringLiteral("producer"));
}
return QDomElement();
}
......@@ -363,8 +363,8 @@ bool ProjectClip::isReady() const
QPoint ProjectClip::zone() const
{
int x = getProducerIntProperty("kdenlive:zone_in");
int y = getProducerIntProperty("kdenlive:zone_out");
int x = getProducerIntProperty(QStringLiteral("kdenlive:zone_in"));
int y = getProducerIntProperty(QStringLiteral("kdenlive:zone_out"));
return QPoint(x, y);
}
......@@ -439,7 +439,7 @@ QString ProjectClip::getProducerProperty(const QString &key) const
const QString ProjectClip::hash()
{
if (m_controller) {
QString clipHash = m_controller->property("kdenlive:file_hash");
QString clipHash = m_controller->property(QStringLiteral("kdenlive:file_hash"));
if (!clipHash.isEmpty()) {
return clipHash;
}
......@@ -457,11 +457,11 @@ const QString ProjectClip::getFileHash() const
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
break;
case Text:
fileData = m_controller ? m_controller->property("xmldata").toUtf8() : name().toUtf8();
fileData = m_controller ? m_controller->property(QStringLiteral("xmldata")).toUtf8() : name().toUtf8();
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
break;
case Color:
fileData = m_controller ? m_controller->property("resource").toUtf8() : name().toUtf8();
fileData = m_controller ? m_controller->property(QStringLiteral("resource")).toUtf8() : name().toUtf8();
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
break;
default:
......@@ -478,7 +478,7 @@ const QString ProjectClip::getFileHash() const
} else
fileData = file.readAll();
file.close();
if (m_controller) m_controller->setProperty("kdenlive:file_size", QString::number(file.size()));
if (m_controller) m_controller->setProperty(QStringLiteral("kdenlive:file_size"), QString::number(file.size()));
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
}
break;
......@@ -486,7 +486,7 @@ const QString ProjectClip::getFileHash() const
if (fileHash.isEmpty()) return QString();
QString result = fileHash.toHex();
if (m_controller) {
m_controller->setProperty("kdenlive:file_hash", result);
m_controller->setProperty(QStringLiteral("kdenlive:file_hash"), result);
}
return result;
}
......@@ -499,8 +499,8 @@ double ProjectClip::getOriginalFps() const
bool ProjectClip::hasProxy() const
{
QString proxy = getProducerProperty("kdenlive:proxy");
if (proxy.isEmpty() || proxy == "-") return false;
QString proxy = getProducerProperty(QStringLiteral("kdenlive:proxy"));
if (proxy.isEmpty() || proxy == QLatin1String("-")) return false;
return true;
}
......@@ -513,24 +513,24 @@ void ProjectClip::setProperties(QMap <QString, QString> properties, bool refresh
bool reload = false;
// Some properties also need to be passed to track producers
QStringList timelineProperties;
timelineProperties << "force_aspect_ratio" << "video_index" << "audio_index" << "set.force_full_luma"<< "full_luma" <<"threads" <<"force_colorspace"<<"force_tff"<<"force_progressive"<<"force_fps";
timelineProperties << QStringLiteral("force_aspect_ratio") << QStringLiteral("video_index") << QStringLiteral("audio_index") << QStringLiteral("set.force_full_luma")<< QStringLiteral("full_luma") <<QStringLiteral("threads") <<QStringLiteral("force_colorspace")<<QStringLiteral("force_tff")<<QStringLiteral("force_progressive")<<QStringLiteral("force_fps");
QStringList keys;
keys << "luma_duration" << "luma_file" << "fade" << "ttl" << "softness" << "crop" << "animation";
keys << QStringLiteral("luma_duration") << QStringLiteral("luma_file") << QStringLiteral("fade") << QStringLiteral("ttl") << QStringLiteral("softness") << QStringLiteral("crop") << QStringLiteral("animation");
while (i.hasNext()) {
i.next();
setProducerProperty(i.key(), i.value());
if (m_type == SlideShow && keys.contains(i.key())) {
reload = true;
}
if (i.key().startsWith("kdenlive:clipanalysis")) refreshAnalysis = true;
if (i.key().startsWith(QLatin1String("kdenlive:clipanalysis"))) refreshAnalysis = true;
if (timelineProperties.contains(i.key())) {
passProperties.insert(i.key(), i.value());
}
}
if (properties.contains("kdenlive:proxy")) {
QString value = properties.value("kdenlive:proxy");
if (properties.contains(QStringLiteral("kdenlive:proxy"))) {
QString value = properties.value(QStringLiteral("kdenlive:proxy"));
// If value is "-", that means user manually disabled proxy on this clip
if (value.isEmpty() || value == "-") {
if (value.isEmpty() || value == QLatin1String("-")) {
// reset proxy
if (bin()->hasPendingJob(m_id, AbstractClipJob::PROXYJOB)) {
bin()->discardJobs(m_id, AbstractClipJob::PROXYJOB);
......@@ -541,28 +541,28 @@ void ProjectClip::setProperties(QMap <QString, QString> properties, bool refresh
}
else {
// A proxy was requested, make sure to keep original url
setProducerProperty("kdenlive:originalurl", url().toLocalFile());
setProducerProperty(QStringLiteral("kdenlive:originalurl"), url().toLocalFile());
bin()->startJob(m_id, AbstractClipJob::PROXYJOB);
}
}
else if (properties.contains("resource")) {
else if (properties.contains(QStringLiteral("resource"))) {
// Clip resource changed, update thumbnail
if (m_type != Color) {
reloadProducer();
}
reload = true;
}
if (properties.contains("xmldata") || !passProperties.isEmpty()) {
if (properties.contains(QStringLiteral("xmldata")) || !passProperties.isEmpty()) {
refreshProducer = true;
}
if (refreshAnalysis) emit refreshAnalysisPanel();
if (properties.contains("length")) {
if (properties.contains(QStringLiteral("length"))) {
m_duration = m_controller->getStringDuration();
bin()->emitItemUpdated(this);
}
if (properties.contains("kdenlive:clipname")) {
m_name = properties.value("kdenlive:clipname");
if (properties.contains(QStringLiteral("kdenlive:clipname"))) {
m_name = properties.value(QStringLiteral("kdenlive:clipname"));
bin()->emitItemUpdated(this);
}
if (refreshPanel) {
......@@ -608,7 +608,7 @@ ClipPropertiesController *ProjectClip::buildProperties(QWidget *parent)
void ProjectClip::updateParentInfo(const QString &folderid, const QString &foldername)
{
Q_UNUSED(foldername)
m_controller->setProperty("kdenlive:folderid", folderid);
m_controller->setProperty(QStringLiteral("kdenlive:folderid"), folderid);
}
bool ProjectClip::matches(QString condition)
......@@ -633,16 +633,16 @@ bool ProjectClip::rename(const QString &name, int column)
case 0:
if (m_name == name) return false;
// Rename clip
oldProperites.insert("kdenlive:clipname", m_name);
newProperites.insert("kdenlive:clipname", name);
oldProperites.insert(QStringLiteral("kdenlive:clipname"), m_name);
newProperites.insert(QStringLiteral("kdenlive:clipname"), name);
m_name = name;
edited = true;
break;
case 2:
if (m_description == name) return false;
// Rename clip
oldProperites.insert("kdenlive:description", m_description);
newProperites.insert("kdenlive:description", name);
oldProperites.insert(QStringLiteral("kdenlive:description"), m_description);
newProperites.insert(QStringLiteral("kdenlive:description"), name);
m_description = name;
edited = true;
break;
......@@ -826,10 +826,10 @@ void ProjectClip::slotCreateAudioThumbs()
return;
}
QString service = prod->get("mlt_service");
if (service == "avformat-novalidate")
service = "avformat";
else if (service.startsWith("xml"))
service = "xml-nogl";
if (service == QLatin1String("avformat-novalidate"))
service = QStringLiteral("avformat");
else if (service.startsWith(QLatin1String("xml")))
service = QStringLiteral("xml-nogl");
Mlt::Producer *audioProducer = new Mlt::Producer(*prod->profile(), service.toUtf8().constData(), prod->get("resource"));
if (!audioProducer->is_valid()) {
delete audioProducer;
......@@ -906,7 +906,7 @@ void ProjectClip::slotCreateAudioThumbs()
bool ProjectClip::isTransparent() const
{
if (m_type == Text) return true;
if (m_type == Image && m_controller->int_property("kdenlive:transparency") == 1) return true;
if (m_type == Image && m_controller->int_property(QStringLiteral("kdenlive:transparency")) == 1) return true;
return false;
}
......@@ -957,7 +957,7 @@ QStringList ProjectClip::updatedAnalysisData(const QString &name, const QString
QMap <QString, QString> ProjectClip::analysisData(bool withPrefix)
{
return m_controller->getPropertiesFromPrefix("kdenlive:clipanalysis.", withPrefix);
return m_controller->getPropertiesFromPrefix(QStringLiteral("kdenlive:clipanalysis."), withPrefix);
}
const QString ProjectClip::geometryWithOffset(const QString &data, int offset)
......
......@@ -34,7 +34,7 @@ ProjectFolder::ProjectFolder(const QString &id, const QString &name, ProjectFold
{
m_name = name;
m_clipStatus = StatusReady;
m_thumbnail = KoIconUtils::themedIcon("folder");
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("folder"));
setParent(parent);
}
......@@ -42,7 +42,7 @@ ProjectFolder::ProjectFolder(Bin *bin) :
AbstractProjectItem(AbstractProjectItem::FolderItem, QString::number(-1))
, m_bin(bin)
{
m_name = "root";
m_name = QStringLiteral("root");
setParent(NULL);
}
......@@ -120,8 +120,8 @@ Bin* ProjectFolder::bin()
QDomElement ProjectFolder::toXml(QDomDocument& document)
{
QDomElement folder = document.createElement("folder");
folder.setAttribute("name", name());
QDomElement folder = document.createElement(QStringLiteral("folder"));
folder.setAttribute(QStringLiteral("name"), name());
for (int i = 0; i < count(); ++i) {
folder.appendChild(at(i)->toXml(document));
}
......
......@@ -31,7 +31,7 @@ ProjectFolderUp::ProjectFolderUp(AbstractProjectItem* parent) :
AbstractProjectItem(AbstractProjectItem::FolderUpItem, QString(), parent)
, m_bin(NULL)
{
m_thumbnail = KoIconUtils::themedIcon("go-previous");
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("go-previous"));
m_name = i18n("Back");
setParent(parent);
}
......
......@@ -138,22 +138,22 @@ bool ProjectItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action
return true;
}
if (data->hasFormat("kdenlive/producerslist")) {
if (data->hasFormat(QStringLiteral("kdenlive/producerslist"))) {
// Dropping an Bin item
QStringList ids = QString(data->data("kdenlive/producerslist")).split(';');
QStringList ids = QString(data->data(QStringLiteral("kdenlive/producerslist"))).split(';');
emit itemDropped(ids, parent);
return true;
}
if (data->hasFormat("kdenlive/effectslist")) {
if (data->hasFormat(QStringLiteral("kdenlive/effectslist"))) {
// Dropping effect on a Bin item
const QString effect = QString::fromUtf8(data->data("kdenlive/effectslist"));
const QString effect = QString::fromUtf8(data->data(QStringLiteral("kdenlive/effectslist")));