Fix automatic playback of file with space in name

BUG: 369653
parent 2c7f4bca
......@@ -285,6 +285,9 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
if (!m_dualpass && !m_player.isEmpty()) {
QStringList args = m_player.split(QLatin1Char(' '));
QString exec = args.takeFirst();
// Decode url
QString url = QUrl::fromEncoded(args.takeLast().toUtf8()).path();
args << url;
QProcess::startDetached(exec, args);
}
if (m_dualpass) {
......
......@@ -1125,7 +1125,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
QMimeDatabase db;
QMimeType mime = db.mimeTypeForFile(dest);
KService::Ptr serv = KMimeTypeTrader::self()->preferredService(mime.name());
KIO::DesktopExecParser parser(*serv, QList <QUrl>() << QUrl::fromLocalFile(dest));
KIO::DesktopExecParser parser(*serv, QList <QUrl>() << QUrl::fromLocalFile(QUrl::toPercentEncoding(dest)));
render_process_args << parser.resultingArguments().join(QStringLiteral(" "));
}
else render_process_args << QStringLiteral("-");
......
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