]> git.sesse.net Git - kdenlive/blobdiff - src/renderwidget.cpp
Use char for single character [krazy 1-44] by Mikko Rapeli
[kdenlive] / src / renderwidget.cpp
index 0169ec9f57c7186aef9c41297694e647ebe53e02..0c5b139537a7f711280680e89e5913e92a7cb30a 100644 (file)
@@ -47,6 +47,8 @@
 #include <QThread>
 #include <QScriptEngine>
 
+#include "locale.h"
+
 
 // Render profiles roles
 const int GroupRole = Qt::UserRole;
@@ -457,7 +459,7 @@ void RenderWidget::slotSaveProfile()
     if (customGroup.isEmpty()) customGroup = i18nc("Group Name", "Custom");
     ui.group_name->setText(customGroup);
 
-    QStringList arguments = m_view.advanced_params->toPlainText().split(" ", QString::SkipEmptyParts);
+    QStringList arguments = m_view.advanced_params->toPlainText().split(' ', QString::SkipEmptyParts);
     ui.parameters->setText(arguments.join(" "));
     ui.extension->setText(m_view.size_list->currentItem()->data(ExtensionRole).toString());
     ui.profile_name->setFocus();
@@ -841,7 +843,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
     QString extension = item->data(ExtensionRole).toString();
     if (!dest.endsWith(extension, Qt::CaseInsensitive)) {
         if (KMessageBox::questionYesNo(this, i18n("File has no extension. Add extension (%1)?", extension)) == KMessageBox::Yes) {
-            dest.append("." + extension);
+            dest.append('.' + extension);
         }
     }
 
@@ -869,7 +871,8 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
 
     // Set locale for render process if required
     if (QLocale().decimalPoint() != QLocale::system().decimalPoint()) {
-        render_process_args << QString("-locale:%1").arg(QLocale().name());
+       const QString currentLocale = setlocale(LC_NUMERIC, NULL);
+        render_process_args << QString("-locale:%1").arg(currentLocale);
     }
 
     double guideStart = 0;
@@ -949,7 +952,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
         renderArgs.append(subsize);
     }
     bool resizeProfile = (subsize != currentSize);
-    QStringList paramsList = renderArgs.split(" ", QString::SkipEmptyParts);
+    QStringList paramsList = renderArgs.split(' ', QString::SkipEmptyParts);
 
     QScriptEngine sEngine;
     sEngine.globalObject().setProperty("bitrate", m_view.comboBitrates->currentText());
@@ -991,8 +994,8 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
         }
         QTextStream outStream(&file);
         outStream << "#! /bin/sh" << "\n" << "\n";
-        outStream << "SOURCE=" << "\"" + KUrl(playlistPath).url() + "\"" << "\n";
-        outStream << "TARGET=" << "\"" + KUrl(dest).url() + "\"" << "\n";
+        outStream << "SOURCE=" << "\"" + QUrl(playlistPath).toEncoded() + "\"" << "\n";
+        outStream << "TARGET=" << "\"" + QUrl(dest).toEncoded() + "\"" << "\n";
         outStream << "RENDERER=" << "\"" + m_renderer + "\"" << "\n";
         outStream << "MELT=" << "\"" + KdenliveSettings::rendererpath() + "\"" << "\n";
         outStream << "PARAMETERS=" << "\"" + render_process_args.join(" ") + "\"" << "\n";
@@ -1082,6 +1085,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
             renderItem->setMetadata(url);
         }
     }
+
     renderItem->setData(1, ParametersRole, render_process_args);
     if (exportAudio == false) renderItem->setData(1, ExtraInfoRole, i18n("Video without audio track"));
     else  renderItem->setData(1, ExtraInfoRole, QString());
@@ -1916,7 +1920,7 @@ void RenderWidget::parseScriptFiles()
             item->setData(0, Qt::UserRole, '1');
         } else item->setIcon(0, KIcon("application-x-executable-script"));
         item->setSizeHint(0, QSize(m_view.scripts_list->columnWidth(0), fontMetrics().height() * 2));
-        item->setData(1, Qt::UserRole, KUrl(target).path());
+        item->setData(1, Qt::UserRole, KUrl(QUrl::fromEncoded(target.toUtf8())).pathOrUrl());
         item->setData(1, Qt::UserRole + 1, scriptpath.path());
     }
     QTreeWidgetItem *script = m_view.scripts_list->topLevelItem(0);