From f574c37e93d42faa6e820894990075dea79b32eb Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 12 Mar 2013 04:00:43 +0100 Subject: [PATCH] Added encoding flag to ini importer arguments --- apps/launcher/maindialog.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index c478d17fd1..e435bd391c 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include "utils/checkablemessagebox.hpp" #include "playpage.hpp" @@ -210,10 +212,15 @@ bool MainDialog::showFirstRunDialog() // Construct the arguments to run the importer QStringList arguments; + if (msgBox.isChecked()) - arguments.append(QString("-g")); + arguments.append(QString("--game-files")); + arguments.append(QString("--encoding")); + arguments.append(mGameSettings.value(QString("encoding"), QString("win1252"))); + arguments.append(QString("--ini")); arguments.append(iniPaths.first()); + arguments.append(QString("--cfg")); arguments.append(path); if (!startProgram(QString("mwiniimport"), arguments, false)) @@ -666,7 +673,7 @@ bool MainDialog::startProgram(const QString &name, const QStringList &arguments, return false; } - if (process.exitCode() != 0) { + if (process.exitCode() != 0 || process.exitStatus() == QProcess::CrashExit) { QString error(process.readAllStandardError()); error.append(tr("\nArguments:\n")); error.append(arguments.join(" "));