Commit 3086e185 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more QStringLiteral

parent e6f89c53
......@@ -81,7 +81,7 @@ int main(int argc, char **argv)
}
QString src = srcurl.toLocalFile();
// The QUrl path() strips the consumer: protocol, so re-add it if necessary
if (srcString.startsWith("consumer:")) {
if (srcString.startsWith(QStringLiteral("consumer:"))) {
src.prepend(QLatin1String("consumer:"));
}
QString dest = QFileInfo(QUrl::fromEncoded(args.takeFirst().toUtf8()).toLocalFile()).absoluteFilePath();
......
......@@ -45,7 +45,7 @@ RenderJob::RenderJob(bool erase, bool usekuiserver, int pid, const QString &rend
m_jobUiserver(nullptr),
m_kdenliveinterface(nullptr),
m_usekuiserver(usekuiserver),
m_logfile(dest + ".txt"),
m_logfile(dest + QStringLiteral(".txt")),
m_erase(erase),
m_seconds(0),
m_frame(0),
......
......@@ -76,7 +76,7 @@ ProjectClip::ProjectClip(const QDomElement &description, const QIcon &thumb, Pro
, m_type(Unknown)
, m_thumbsProducer(nullptr)
{
Q_ASSERT(description.hasAttribute("id"));
Q_ASSERT(description.hasAttribute(QStringLiteral("id")));
m_clipStatus = StatusWaiting;
m_thumbnail = thumb;
if (description.hasAttribute(QStringLiteral("type"))) {
......
......@@ -940,7 +940,7 @@ void KdenliveSettingsDialog::loadTranscodeProfiles()
void KdenliveSettingsDialog::saveTranscodeProfiles()
{
QString transcodeFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/kdenlivetranscodingrc";
QString transcodeFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/kdenlivetranscodingrc");
KSharedConfigPtr config = KSharedConfig::openConfig(transcodeFile);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
......
......@@ -1031,7 +1031,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
if (imageSequences.contains(extension)) {
// format string for counter?
if (!QRegExp(QStringLiteral(".*%[0-9]*d.*")).exactMatch(dest)) {
dest = dest.section(QLatin1Char('.'), 0, -2) + "_%05d." + extension;
dest = dest.section(QLatin1Char('.'), 0, -2) + QStringLiteral("_%05d.") + extension;
}
}
......@@ -1662,7 +1662,7 @@ void RenderWidget::refreshParams()
// else path = path.left(pos) + extension;
// m_view.out_file->setUrl(QUrl(path));
// } else {
// m_view.out_file->setUrl(QUrl(QDir::homePath() + "/untitled." + extension));
// m_view.out_file->setUrl(QUrl(QDir::homePath() + QStringLiteral("/untitled.") + extension));
// }
m_view.out_file->setFilter("*." + extension);
QString edit = item->data(0, EditableRole).toString();
......@@ -2517,7 +2517,7 @@ bool RenderWidget::startWaitingRenderJobs()
QString RenderWidget::getFreeScriptName(const QUrl &projectName, const QString &prefix)
{
int ix = 0;
QString scriptsFolder = m_projectFolder + "scripts/";
QString scriptsFolder = m_projectFolder + QStringLiteral("scripts/");
QDir dir(m_projectFolder);
dir.mkdir(QStringLiteral("scripts"));
QString path;
......@@ -2529,7 +2529,7 @@ QString RenderWidget::getFreeScriptName(const QUrl &projectName, const QString &
}
while (path.isEmpty() || QFile::exists(path)) {
++ix;
path = scriptsFolder + prefix + fileName + QString::number(ix).rightJustified(3, '0', false) + ".sh";
path = scriptsFolder + prefix + fileName + QString::number(ix).rightJustified(3, '0', false) + QStringLiteral(".sh");
}
return path;
}
......
......@@ -82,7 +82,7 @@ DvdWizard::DvdWizard(MonitorManager *manager, const QString &url, QWidget *paren
m_status.error_box->setHidden(true);
m_status.tmp_folder->setUrl(QUrl::fromLocalFile(KdenliveSettings::currenttmpfolder()));
m_status.tmp_folder->setMode(KFile::Directory | KFile::ExistingOnly);
m_status.iso_image->setUrl(QUrl::fromLocalFile(QDir::homePath() + "/untitled.iso"));
m_status.iso_image->setUrl(QUrl::fromLocalFile(QDir::homePath() + QStringLiteral("/untitled.iso")));
m_status.iso_image->setFilter(QStringLiteral("*.iso"));
m_status.iso_image->setMode(KFile::File);
......@@ -769,9 +769,9 @@ void DvdWizard::slotRenderFinished(int exitCode, QProcess::ExitStatus status)
m_dvdauthor = nullptr;
// Check if DVD structure has the necessary info
if (!QFile::exists(m_status.tmp_folder->url().toLocalFile() + "/DVD/VIDEO_TS/VIDEO_TS.IFO")) {
if (!QFile::exists(m_status.tmp_folder->url().toLocalFile() + QStringLiteral("/DVD/VIDEO_TS/VIDEO_TS.IFO"))) {
errorMessage(i18n("DVD structure broken"));
m_status.error_log->append(m_creationLog + "<a name=\"result\" /><br /><strong>" + i18n("DVD structure broken"));
m_status.error_log->append(m_creationLog + QStringLiteral("<a name=\"result\" /><br /><strong>") + i18n("DVD structure broken"));
m_status.error_log->scrollToAnchor(QStringLiteral("result"));
m_status.error_box->setHidden(false);
m_status.menu_file->setPlainText(m_menuFile.readAll());
......
......@@ -44,7 +44,7 @@ void initEffects::refreshLumas()
MainWindow::m_lumaFiles.clear();
fileFilters << QStringLiteral("*.png") << QStringLiteral("*.pgm");
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
customLumas.append(QString(mlt_environment("MLT_DATA")) + "/lumas");
customLumas.append(QString(mlt_environment("MLT_DATA")) + QStringLiteral("/lumas"));
foreach (const QString &folder, customLumas) {
QDir topDir(folder);
QStringList folders = topDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
......@@ -394,7 +394,7 @@ void initEffects::parseCustomEffectsFile()
* cannot be sure about it.
*/
QMap<QString, QDomElement> effectsMap;
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/effects";
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/effects");
QDir directory = QDir(path);
QStringList filter;
filter << QStringLiteral("*.xml");
......@@ -854,12 +854,22 @@ void initEffects::fillTransitionsList(std::unique_ptr<Mlt::Repository> &reposito
}
// Add some virtual transitions.
QString slidetrans = "<ktransition tag=\"composite\" id=\"slide\"><name>" + i18n("Slide") + QStringLiteral("</name><description>") + i18n("Slide image from one side to another.") + "</description><parameter tag=\"geometry\" type=\"wipe\" default=\"-100%,0%:100%x100%;-1=0%,0%:100%x100%\" name=\"geometry\"><name>" + i18n("Direction") + "</name> </parameter><parameter tag=\"aligned\" default=\"0\" type=\"bool\" name=\"aligned\" ><name>" + i18n("Align") + "</name></parameter><parameter tag=\"progressive\" default=\"1\" type=\"bool\" name=\"progressive\" ><name>" + i18n("Force Progressive Rendering") + "</name></parameter><parameter tag=\"deinterlace\" default=\"0\" type=\"bool\" name=\"deinterlace\" ><name>" + i18n("Force Deinterlace Overlay") + "</name></parameter><parameter tag=\"invert\" default=\"0\" type=\"bool\" name=\"invert\" ><name>" + i18nc("@property: means that the image is inverted", "Invert") + "</name></parameter></ktransition>";
QString slidetrans = QStringLiteral("<ktransition tag=\"composite\" id=\"slide\"><name>") + i18n("Slide") +
QStringLiteral("</name><description>") + i18n("Slide image from one side to another.")
+ QStringLiteral("</description><parameter tag=\"geometry\" type=\"wipe\" default=\"-100%,0%:100%x100%;-1=0%,0%:100%x100%\" name=\"geometry\"><name>")
+ i18n("Direction") + QStringLiteral("</name> </parameter><parameter tag=\"aligned\" default=\"0\" type=\"bool\" name=\"aligned\" ><name>")
+ i18n("Align") + QStringLiteral("</name></parameter><parameter tag=\"progressive\" default=\"1\" type=\"bool\" name=\"progressive\" ><name>")
+ i18n("Force Progressive Rendering") + QStringLiteral("</name></parameter><parameter tag=\"deinterlace\" default=\"0\" type=\"bool\" name=\"deinterlace\" ><name>")
+ i18n("Force Deinterlace Overlay") + QStringLiteral("</name></parameter><parameter tag=\"invert\" default=\"0\" type=\"bool\" name=\"invert\" ><name>")
+ i18nc("@property: means that the image is inverted", "Invert") + QStringLiteral("</name></parameter></ktransition>");
QDomDocument ret;
ret.setContent(slidetrans);
transitions->append(ret.documentElement());
QString dissolve = "<ktransition tag=\"luma\" id=\"dissolve\"><name>" + i18n("Dissolve") + QStringLiteral("</name><description>") + i18n("Fade out one video while fading in the other video.") + "</description><parameter tag=\"reverse\" default=\"0\" type=\"bool\" name=\"reverse\" ><name>" + i18n("Reverse") + "</name></parameter></ktransition>";
QString dissolve = QStringLiteral("<ktransition tag=\"luma\" id=\"dissolve\"><name>")
+ i18n("Dissolve") + QStringLiteral("</name><description>") + i18n("Fade out one video while fading in the other video.")
+ QStringLiteral("</description><parameter tag=\"reverse\" default=\"0\" type=\"bool\" name=\"reverse\" ><name>")
+ i18n("Reverse") + QStringLiteral("</name></parameter></ktransition>");
ret.setContent(dissolve);
transitions->append(ret.documentElement());
......
......@@ -344,7 +344,7 @@ ParameterContainer::ParameterContainer(const QDomElement &effect, const ItemInfo
m_geometryWidget->setupParam(pa, minFrame, maxFrame);
}
m_vbox->addWidget(m_geometryWidget);
m_valueItems[paramName+"geometry"] = m_geometryWidget;
m_valueItems[paramName+QStringLiteral("geometry")] = m_geometryWidget;
connect(m_geometryWidget, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
connect(m_geometryWidget, SIGNAL(importClipKeyframes()), this, SIGNAL(importClipKeyframes()));
connect(this, SIGNAL(syncEffectsPos(int)), m_geometryWidget, SLOT(slotSyncPosition(int)));
......@@ -377,7 +377,7 @@ ParameterContainer::ParameterContainer(const QDomElement &effect, const ItemInfo
m_conditionalWidgets << geo;
}
m_vbox->addWidget(geo);
m_valueItems[paramName + "keyframe"] = geo;
m_valueItems[paramName + QStringLiteral("keyframe")] = geo;
m_keyframeEditor = geo;
connect(geo, &KeyframeEdit::valueChanged, this, &ParameterContainer::slotCollectAllParameters);
connect(geo, &KeyframeEdit::seekToPos, this, &ParameterContainer::seekTimeline);
......@@ -422,7 +422,7 @@ ParameterContainer::ParameterContainer(const QDomElement &effect, const ItemInfo
m_conditionalWidgets << posedit;
}
m_vbox->addWidget(posedit);
m_valueItems[paramName + "position"] = posedit;
m_valueItems[paramName + QStringLiteral("position")] = posedit;
connect(posedit, &PositionWidget::valueChanged,
this, &ParameterContainer::slotCollectAllParameters);
} else if (type == QLatin1String("curve")) {
......@@ -1184,7 +1184,7 @@ QString ParameterContainer::getWipeString(wipeInfo info)
break;
}
end.append(':' + QString::number(info.endTransparency));
return QString(start + ";-1=" + end);
return QString(start + QStringLiteral(";-1=") + end);
}
void ParameterContainer::updateParameter(const QString &key, const QString &value)
......
......@@ -65,7 +65,7 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent) :
QToolButton *button = new QToolButton(this);
button->setIcon(KoIconUtils::themedIcon(QStringLiteral("color-picker")));
button->setToolTip("<p>" + i18n("Pick a color on the screen. By pressing the mouse button and then moving your mouse you can select a section of the screen from which to get an average color.") + "</p>");
button->setToolTip(QStringLiteral("<p>") + i18n("Pick a color on the screen. By pressing the mouse button and then moving your mouse you can select a section of the screen from which to get an average color.") + QStringLiteral("</p>"));
button->setAutoRaise(true);
connect(button, &QAbstractButton::clicked, this, &ColorPickerWidget::slotSetupEventFilter);
......
......@@ -53,13 +53,13 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
KdenliveSettings::setMltpath(profilePath);
#ifdef Q_OS_WIN
QString meltPath = QDir::cleanPath(profilePath).section(QLatin1Char('/'), 0, -3) + "melt.exe";
QString meltPath = QDir::cleanPath(profilePath).section(QLatin1Char('/'), 0, -3) + QStringLiteral("melt.exe");
if (!QFile::exists(meltPath) || profilePath.isEmpty()) {
QString env = qgetenv("MLT_PREFIX");
if (env.isEmpty()) {
env = qApp->applicationDirPath() + QStringLiteral("/");
}
meltPath = env + "melt.exe";
meltPath = env + QStringLiteral("melt.exe");
}
#else
QString meltPath = QDir::cleanPath(profilePath).section(QLatin1Char('/'), 0, -3) + QStringLiteral("/bin/melt");
......@@ -137,4 +137,4 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
std::unique_ptr<Mlt::Repository>& MltConnection::getMltRepository()
{
return m_repository;
};
}
......@@ -964,7 +964,7 @@ void ClipPropertiesController::slotFillMeta(QTreeWidget *tree)
} else if (KdenliveSettings::use_exiftool()) {
QString url = m_controller->clipUrl();
//Check for Canon THM file
url = url.section(QLatin1Char('.'), 0, -2) + ".THM";
url = url.section(QLatin1Char('.'), 0, -2) + QStringLiteral(".THM");
if (QFile::exists(url)) {
// Read the exif metadata embedded in the THM file
QProcess p;
......@@ -1043,7 +1043,7 @@ void ClipPropertiesController::slotFillMeta(QTreeWidget *tree)
}
} else if (m_type != Image && KdenliveSettings::use_magicLantern()) {
QString url = m_controller->clipUrl();
url = url.section(QLatin1Char('.'), 0, -2) + ".LOG";
url = url.section(QLatin1Char('.'), 0, -2) + QStringLiteral(".LOG");
if (QFile::exists(url)) {
QFile file(url);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
......
......@@ -189,7 +189,7 @@ void RecManager::slotRecord(bool record)
if (cutPosition > -1) {
endParam.remove(0, cutPosition);
}
v4lparameters = QString(v4lparameters.section(QStringLiteral("acodec"), 0, 0) + "an=1 " + endParam).simplified();
v4lparameters = QString(v4lparameters.section(QStringLiteral("acodec"), 0, 0) + QStringLiteral("an=1 ") + endParam).simplified();
}
}
Mlt::Producer *prod = createV4lProducer();
......
......@@ -630,11 +630,11 @@ void RecMonitor::slotRecord()
} else if (device_selector->currentIndex() == BlackMagic) {
extension = KdenliveSettings::decklink_extension();
}
QString path = QUrl(m_capturePath).toLocalFile() + QDir::separator() + "capture0000." + extension;
QString path = QUrl(m_capturePath).toLocalFile() + QDir::separator() + QStringLiteral("capture0000.") + extension;
int i = 1;
while (QFile::exists(path)) {
QString num = QString::number(i).rightJustified(4, '0', false);
path = QUrl(m_capturePath).toLocalFile() + QDir::separator() + "capture" + num + QLatin1Char('.') + extension;
path = QUrl(m_capturePath).toLocalFile() + QDir::separator() + QStringLiteral("capture") + num + QLatin1Char('.') + extension;
++i;
}
m_captureFile = QUrl(path);
......@@ -699,7 +699,7 @@ void RecMonitor::slotRecord()
if (cutPosition > -1) {
endParam.remove(0, cutPosition);
}
v4lparameters = QString(v4lparameters.section(QStringLiteral("acodec"), 0, 0) + "an=1 " + endParam).simplified();
v4lparameters = QString(v4lparameters.section(QStringLiteral("acodec"), 0, 0) + QStringLiteral("an=1 ") + endParam).simplified();
}
}
......
......@@ -887,18 +887,19 @@ const QString StopmotionWidget::createProducer(const MltVideoProfile &profile, c
{
Q_UNUSED(profile)
QString playlist = "<mlt title=\"capture\"><producer id=\"producer0\" in=\"0\" out=\"99999\"><property name=\"mlt_type\">producer</property><property name=\"length\">100000</property><property name=\"eof\">pause</property><property name=\"resource\">" + resource + "</property><property name=\"mlt_service\">" + service + "</property></producer>";
QString playlist = QStringLiteral("<mlt title=\"capture\"><producer id=\"producer0\" in=\"0\" out=\"99999\"><property name=\"mlt_type\">producer</property><property name=\"length\">100000</property><property name=\"eof\">pause</property><property name=\"resource\">")
+ resource + QStringLiteral("</property><property name=\"mlt_service\">") + service + QStringLiteral("</property></producer>");
// overlay track
playlist.append("<playlist id=\"playlist0\"></playlist>");
playlist.append(QStringLiteral("<playlist id=\"playlist0\"></playlist>"));
// video4linux track
playlist.append("<playlist id=\"playlist1\"><entry producer=\"producer0\" in=\"0\" out=\"99999\"/></playlist>");
playlist.append(QStringLiteral("<playlist id=\"playlist1\"><entry producer=\"producer0\" in=\"0\" out=\"99999\"/></playlist>"));
playlist.append("<tractor id=\"tractor0\" title=\"video0\" global_feed=\"1\" in=\"0\" out=\"99999\">");
playlist.append("<track producer=\"playlist0\"/>");
playlist.append("<track producer=\"playlist1\"/>");
playlist.append("</tractor></mlt>");
playlist.append(QStringLiteral("<tractor id=\"tractor0\" title=\"video0\" global_feed=\"1\" in=\"0\" out=\"99999\">"));
playlist.append(QStringLiteral("<track producer=\"playlist0\"/>"));
playlist.append(QStringLiteral("<track producer=\"playlist1\"/>"));
playlist.append(QStringLiteral("</tractor></mlt>"));
return playlist;
}
......
......@@ -7002,7 +7002,7 @@ void CustomTrackView::saveThumbnails()
if (item->clipType() != Color && item->clipType() != Audio) {
// Check if we have a cached thumbnail
if (item->clipType() == Image || item->clipType() == Text || item->clipType() == Audio) {
QString thumb = thumbsFolder.absoluteFilePath(item->getBinHash() + "#0.png");
QString thumb = thumbsFolder.absoluteFilePath(item->getBinHash() + QStringLiteral("#0.png"));
if (!QFile::exists(thumb)) {
item->startThumb().save(thumb);
}
......
......@@ -532,7 +532,7 @@ int KeyframeView::mouseOverKeyFrames(const QRectF &br, QPointF pos, double scale
if ((pos - p).manhattanLength() <= m_handleSize / 2) {
//TODO
/*setToolTip(QLatin1Char('[') + QString::number((GenTime(key, m_fps) - cropStart()).seconds(), 'f', 2)
+ i18n("seconds") + ", " + QString::number(value, 'f', 1) + ']');*/
+ i18n("seconds") + QStringLiteral(", ") + QString::number(value, 'f', 1) + ']');*/
activeKeyframe = key;
if (previousEdit != activeKeyframe) {
updateKeyframes();
......
......@@ -557,7 +557,7 @@ void PreviewManager::gotPreviewRender(int frame, const QString &file, int progre
if (file.isEmpty() || progress < 0) {
m_doc->previewProgress(progress);
if (progress < 0) {
m_doc->displayMessage(i18n("Preview rendering failed, check your parameters. %1Show details...%2", QString("<a href=\"" + QString::fromLatin1(QUrl::toPercentEncoding(file)) + "\">"), QStringLiteral("</a>")), MltError);
m_doc->displayMessage(i18n("Preview rendering failed, check your parameters. %1Show details...%2", QString("<a href=\"" + QString::fromLatin1(QUrl::toPercentEncoding(file)) + QStringLiteral("\">")), QStringLiteral("</a>")), MltError);
}
return;
}
......
......@@ -172,7 +172,7 @@ OnlineItemInfo ArchiveOrg::displayItemDetails(QListWidgetItem *item)
m_metaInfo.insert(QStringLiteral("url"), info.itemDownload);
m_metaInfo.insert(QStringLiteral("id"), info.itemId);
QString extraInfoUrl = item->data(infoUrl).toString() + "&output=json";
QString extraInfoUrl = item->data(infoUrl).toString() + QStringLiteral("&output=json");
if (!extraInfoUrl.isEmpty()) {
KJob *resolveJob = KIO::storedGet(QUrl(extraInfoUrl), KIO::NoReload, KIO::HideProgressInfo);
resolveJob->setProperty("id", info.itemId);
......@@ -249,11 +249,13 @@ void ArchiveOrg::slotParseResults(KJob *job)
if (format != QLatin1String("Animated GIF") && format != QLatin1String("Metadata") && format != QLatin1String("Archive BitTorrent") && format != QLatin1String("Thumbnail") && format != QLatin1String("JSON") && format != QLatin1String("JPEG") && format != QLatin1String("JPEG Thumb") && format != QLatin1String("PNG") && format != QLatin1String("Video Index")) {
// the a href url has the tag _import added at the end. This tag is removed by ResourceWidget::slotOpenLink before being used to download the file
html += QStringLiteral("<tr><td>") + format + QStringLiteral(" (") + fileSize + "kb " + minsLong + "min) " + QStringLiteral("</td><td><a href=\"%1\">%2</a></td></tr>").arg(sDownloadUrl + "_import", i18n("Import"));
html += QStringLiteral("<tr><td>") + format + QStringLiteral(" (") + fileSize
+ QStringLiteral("kb ") + minsLong + QStringLiteral("min) ")
+ QStringLiteral("</td><td><a href=\"%1\">%2</a></td></tr>").arg(sDownloadUrl + QStringLiteral("_import"), i18n("Import"));
}
//if (format==QLatin1String("Animated GIF"))// widget does not run through the frames of the animated gif
if (format == QLatin1String("Thumbnail") && !bThumbNailFound) {
sThumbUrl = "https://archive.org/download/" + m_metaInfo.value(QStringLiteral("id")) + j.key();
sThumbUrl = QStringLiteral("https://archive.org/download/") + m_metaInfo.value(QStringLiteral("id")) + j.key();
//m_metaInfo.insert(QStringLiteral("preview"), sPreviewUrl);
// qCDebug(KDENLIVE_LOG)<<" sPreviewUrl: "<<sPreviewUrl;
bThumbNailFound = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment