Fix incorrect arguments parsing on app restart.

Should fix #913
parent 92a64e79
......@@ -134,7 +134,7 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, QString projectFolder, QUndoGroup *und
QFile file(url.toLocalFile());
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
// The file cannot be opened
if (KMessageBox::warningContinueCancel(parent, i18n("Cannot open the project file,\nDo you want to open a backup file?"),
if (KMessageBox::warningContinueCancel(parent, i18n("Cannot open the project file %1,\nDo you want to open a backup file?", file.fileName()),
i18n("Error opening file"), KGuiItem(i18n("Open Backup"))) == KMessageBox::Continue) {
*openBackup = true;
}
......
......@@ -288,13 +288,13 @@ int main(int argc, char *argv[])
}
}
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList progArgs = QString(*argv).split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList progArgs = QString(*argv).split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
// Remove app name
progArgs.takeFirst();
QStringList progArgs;
if (argc > 1) {
// Start at 1 to remove app name
for (int i = 1; i < argc; i++) {
progArgs << QString(argv[i]);
}
}
auto *restart = new QProcess;
restart->start(app.applicationFilePath(), progArgs);
restart->waitForReadyRead();
......
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