aboutsummaryrefslogtreecommitdiff
path: root/src/app/qmmpstarter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/qmmpstarter.cpp')
-rw-r--r--src/app/qmmpstarter.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/app/qmmpstarter.cpp b/src/app/qmmpstarter.cpp
index 7751d0262..4b463ab27 100644
--- a/src/app/qmmpstarter.cpp
+++ b/src/app/qmmpstarter.cpp
@@ -213,27 +213,22 @@ void QMMPStarter::savePosition()
void QMMPStarter::writeCommand()
{
- if (!argString.isEmpty())
+ QString workingDir = QDir::currentPath() + "\n";
+ QByteArray barray;
+ barray.append(workingDir.toUtf8 ());
+ barray.append(argString.isEmpty() ? "--show-mw" : argString.toUtf8 ());
+ while(!barray.isEmpty())
{
- QString workingDir = QDir::currentPath() + "\n";
-
- QByteArray barray;
- barray.append(workingDir.toUtf8 ());
- barray.append(argString.toUtf8 ());
- while(!barray.isEmpty())
- {
- qint64 size = m_socket->write(barray);
- barray.remove(0, size);
- }
- m_socket->flush();
- //reading answer
- if(m_socket->waitForReadyRead(1500))
- cout << m_socket->readAll().data();
+ qint64 size = m_socket->write(barray);
+ barray.remove(0, size);
}
- else
- {
+ m_socket->flush();
+ //reading answer
+ if(m_socket->waitForReadyRead(1500))
+ cout << m_socket->readAll().data();
+
+ if (argString.isEmpty())
printUsage();
- }
exit(0);
}