Commit abb2b646 authored by heretik's avatar heretik
Browse files

Fix deprecated usage of method start()

parent 6d153f05
......@@ -54,19 +54,23 @@ MainWindow::MainWindow( QWidget *parent )
commands_ = {
{
tr( "testing presence of cmake...\n" ).toStdString(),
"cmake --version"
"cmake",
{"--version"}
},
{
tr( "running 'cmake'...\n" ).toStdString(),
"cmake -G Ninja -B"s + build_dir + " -H" + directory_.string()
"cmake",
{"-G", "Ninja", "-B"s + build_dir, "-H"s + directory_.string()}
},
{
tr( "running 'make'...\n" ).toStdString(),
"ninja -C "s + build_dir
"ninja",
{"-C", build_dir}
},
{
tr( "running application...\n" ).toStdString(),
build_dir + "/prototypator"
build_dir + "/prototypator",
{}
},
};
}
......@@ -224,7 +228,11 @@ void MainWindow::execute_next_command()
{
const auto &command = commands_.at( current_command_index_ );
append_text( command.introduction, Qt::darkGreen );
process_.start( QString::fromStdString( command.command ) );
auto arguments = QStringList{};
for( const auto &argument : command.arguments ) {
arguments.push_back(QString::fromStdString(argument));
}
process_.start( QString::fromStdString( command.program ), arguments );
auto started = process_.waitForStarted();
if( not started ) {
const auto msg = tr( "failed to start '" ) + process_.program() + '\'';
......
......@@ -15,8 +15,9 @@ class MainWindow;
class QPlainTextEdit;
struct Command {
std::string introduction;
std::string command;
std::string introduction = "";
std::string program = "";
std::vector<std::string> arguments = {};
};
class MainWindow
......
......@@ -67,8 +67,8 @@
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="tabStopWidth">
<number>20</number>
<property name="tabStopDistance">
<double>20.000000000000000</double>
</property>
<property name="acceptRichText">
<bool>false</bool>
......
......@@ -40,42 +40,42 @@
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="60"/>
<location filename="../src/prototypator/mainwindow.cpp" line="61"/>
<source>running &apos;cmake&apos;...
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="64"/>
<location filename="../src/prototypator/mainwindow.cpp" line="66"/>
<source>running &apos;make&apos;...
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="68"/>
<location filename="../src/prototypator/mainwindow.cpp" line="71"/>
<source>running application...
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="120"/>
<location filename="../src/prototypator/mainwindow.cpp" line="124"/>
<source> exited with code </source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="206"/>
<location filename="../src/prototypator/mainwindow.cpp" line="210"/>
<source>error(s):
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="211"/>
<location filename="../src/prototypator/mainwindow.cpp" line="215"/>
<source>warning(s):
</source>
<translation></translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="230"/>
<location filename="../src/prototypator/mainwindow.cpp" line="238"/>
<source>failed to start &apos;</source>
<translation></translation>
</message>
......
......@@ -41,47 +41,47 @@
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="60"/>
<location filename="../src/prototypator/mainwindow.cpp" line="61"/>
<source>running &apos;cmake&apos;...
</source>
<translation>démarrage de &apos;cmake&apos;...
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="64"/>
<location filename="../src/prototypator/mainwindow.cpp" line="66"/>
<source>running &apos;make&apos;...
</source>
<translation>démarrage de &apos;make&apos;...
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="68"/>
<location filename="../src/prototypator/mainwindow.cpp" line="71"/>
<source>running application...
</source>
<translation>démarrage de l&apos;application...
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="120"/>
<location filename="../src/prototypator/mainwindow.cpp" line="124"/>
<source> exited with code </source>
<translation> s&apos;est terminé avec le code </translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="206"/>
<location filename="../src/prototypator/mainwindow.cpp" line="210"/>
<source>error(s):
</source>
<translation>erreur(s) :
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="211"/>
<location filename="../src/prototypator/mainwindow.cpp" line="215"/>
<source>warning(s):
</source>
<translation>avertissement(s) :
</translation>
</message>
<message>
<location filename="../src/prototypator/mainwindow.cpp" line="230"/>
<location filename="../src/prototypator/mainwindow.cpp" line="238"/>
<source>failed to start &apos;</source>
<translation>impossible de démarrer &apos;</translation>
</message>
......
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