aboutsummaryrefslogtreecommitdiff
path: root/src/ui/qmmpstarter.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-04-09 19:56:12 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-04-09 19:56:12 +0000
commit4008075712363ed133940e8edd98348b924d1b85 (patch)
tree9c651329e6f4537da66174d198354d251624a883 /src/ui/qmmpstarter.cpp
parenta7f6d7b496b40690716af72caa4efceb58c03e7a (diff)
downloadqmmp-4008075712363ed133940e8edd98348b924d1b85.tar.gz
qmmp-4008075712363ed133940e8edd98348b924d1b85.tar.bz2
qmmp-4008075712363ed133940e8edd98348b924d1b85.zip
partial mingw support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@899 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/qmmpstarter.cpp')
-rw-r--r--src/ui/qmmpstarter.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ui/qmmpstarter.cpp b/src/ui/qmmpstarter.cpp
index 6dd467344..6570ef6ac 100644
--- a/src/ui/qmmpstarter.cpp
+++ b/src/ui/qmmpstarter.cpp
@@ -27,7 +27,9 @@
#include <string.h>
#include <qmmpui/commandlinemanager.h>
+#ifndef Q_OS_WIN32
#include "unixdomainsocket.h"
+#endif
#include "mainwindow.h"
#include "qmmpstarter.h"
#include "builtincommandlineoption.h"
@@ -66,7 +68,7 @@ QMMPStarter::QMMPStarter(int argc,char **argv, QObject* parent) : QObject(parent
qFatal("QMMP: Unknown command...");
exit(1);
}
-
+#ifndef Q_OS_WIN32
m_sock = new UnixDomainSocket(this);
if (m_sock->bind(UDS_PATH))
{
@@ -88,6 +90,9 @@ QMMPStarter::QMMPStarter(int argc,char **argv, QObject* parent) : QObject(parent
}
else // socket is alive, qmmp application is already running. passing command to it!
writeCommand();
+#else
+ startMainWindow();
+#endif
}
QMMPStarter::~ QMMPStarter()
@@ -97,13 +102,16 @@ QMMPStarter::~ QMMPStarter()
void QMMPStarter::startMainWindow()
{
+#ifndef Q_OS_WIN32
connect(m_sock, SIGNAL(readyRead()),this, SLOT(readCommand()));
+#endif
QStringList arg_l = argString.split("\n", QString::SkipEmptyParts);
mw = new MainWindow(arg_l,m_option_manager,0);
}
void QMMPStarter::writeCommand()
{
+#ifndef Q_OS_WIN32
if (!argString.isEmpty())
{
char buf[PATH_MAX + 1];
@@ -120,10 +128,12 @@ void QMMPStarter::writeCommand()
}
exit(0);
+#endif
}
void QMMPStarter::readCommand()
{
+#ifndef Q_OS_WIN32
QByteArray inputArray;
inputArray.resize(MAXCOMMANDSIZE);
bzero(inputArray.data(),inputArray.size());
@@ -134,7 +144,7 @@ void QMMPStarter::readCommand()
{
mw->processCommandArgs(slist,cwd);
}
-
+#endif
}
void QMMPStarter::printUsage()