Fix possible crash on rendering with "play after render" option

parent 47858957
......@@ -1178,8 +1178,15 @@ 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(QUrl::toPercentEncoding(dest)));
render_process_args << parser.resultingArguments().join(QLatin1Char(' '));
if (serv) {
KIO::DesktopExecParser parser(*serv, QList<QUrl>() << QUrl::fromLocalFile(QUrl::toPercentEncoding(dest)));
render_process_args << parser.resultingArguments().join(QLatin1Char(' '));
} else {
// no service found to play mime type
//TODO: inform user
//errorMessage(PlaybackError, i18n("No service found to play %1", mime.name()));
render_process_args << QStringLiteral("-");
}
} else {
render_process_args << QStringLiteral("-");
}
......
......@@ -137,7 +137,8 @@ public:
enum RenderError {
CompositeError = 0,
ProfileError = 1,
ProxyWarning = 2
ProxyWarning = 2,
PlaybackError = 3
};
/** @brief Display warning message in render widget. */
......
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