Arguments must be cleared before launching a new command.
This commit is contained in:
parent
f33a5c57f1
commit
fc70c9d302
17
dialog.cpp
17
dialog.cpp
|
@ -38,35 +38,36 @@ Dialog::~Dialog()
|
||||||
|
|
||||||
void Dialog::connectToClients()
|
void Dialog::connectToClients()
|
||||||
{
|
{
|
||||||
QString line, command = "tvnserver";
|
QString line, command = QStringLiteral("tvnserver");
|
||||||
QStringList arguments;
|
|
||||||
|
|
||||||
if(connected)
|
if(connected)
|
||||||
{
|
{
|
||||||
arguments << "-controlservice" << "-disconnectall" << line;
|
QStringList arguments;
|
||||||
|
arguments << QStringLiteral("-controlservice") << QStringLiteral("-disconnectall") << line;
|
||||||
QProcess *process = new QProcess();
|
QProcess *process = new QProcess();
|
||||||
process->start(command, arguments);
|
process->start(command, arguments);
|
||||||
connected = false;
|
connected = false;
|
||||||
ui->buttonStart->setText("Start streaming");
|
ui->buttonStart->setText(QStringLiteral("Start streaming"));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile file("clients.txt");
|
QFile file(QStringLiteral("clients.txt"));
|
||||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||||
return;
|
return;
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
while (!in.atEnd()) {
|
while (!in.atEnd()) {
|
||||||
line = in.readLine();
|
line = in.readLine();
|
||||||
if (line != "")
|
if (line != QString())
|
||||||
{
|
{
|
||||||
arguments << "-controlservice" << "-connect" << line;
|
QStringList arguments;
|
||||||
|
arguments << QStringLiteral("-controlservice") << QStringLiteral("-connect") << line;
|
||||||
QProcess *process = new QProcess();
|
QProcess *process = new QProcess();
|
||||||
process->start(command, arguments);
|
process->start(command, arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
connected = true;
|
connected = true;
|
||||||
ui->buttonStart->setText("Disconnect");
|
ui->buttonStart->setText(QStringLiteral("Disconnect"));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue