summaryrefslogtreecommitdiffstats
path: root/src/pvsDaemon.cpp
diff options
context:
space:
mode:
authorJohann Latocha2010-09-01 01:02:39 +0200
committerJohann Latocha2010-09-01 01:02:39 +0200
commitf6fca1c3c5279c820be3860b0074831f920219d6 (patch)
tree66c9568114734b8a4e7fa55c1e1626f2ccefa243 /src/pvsDaemon.cpp
parentMissing return statement (diff)
downloadpvs-f6fca1c3c5279c820be3860b0074831f920219d6.tar.gz
pvs-f6fca1c3c5279c820be3860b0074831f920219d6.tar.xz
pvs-f6fca1c3c5279c820be3860b0074831f920219d6.zip
All printf() replaced with qDebug()
Diffstat (limited to 'src/pvsDaemon.cpp')
-rwxr-xr-xsrc/pvsDaemon.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/pvsDaemon.cpp b/src/pvsDaemon.cpp
index 4d3e146..cc11bd4 100755
--- a/src/pvsDaemon.cpp
+++ b/src/pvsDaemon.cpp
@@ -13,8 +13,8 @@ QTextStream qout(stdout);
/// VERSION_STRING is defined in src/version.h
void printVersion(bool doExit)
{
- QTextStream qout(stdout);
- printf("Version:\t"VERSION_STRING"\n");
+ qout << "Version:\t"VERSION_STRING"\n";
+ qout.flush();
if (doExit)
exit(0);
}
@@ -36,7 +36,7 @@ void printHelp()
qout << QObject::tr("-v or --version") << "\n\t" << QObject::tr("Shows the current version and exits.") << "\n";
qout << QObject::tr("-d or --daemon") << "\n\t" << QObject::tr("Start as daemon.") << "\n";
qout << QObject::tr("-c <string command>:<string value>") << "\n\t" << QObject::tr("Sends the command and the optional value to a running PVS-Client.") << "\n\t" << QObject::tr("Command and value may not contain spaces or colons.") << "\n\t" << QObject::tr("The dividing colon is mandatory.") << "\n";
- qout << "-commands: \n\t" << QObject::tr("Prints out available commands to use with -c.") << "\n";
+ qout << "--commands: \n\t" << QObject::tr("Prints out available commands to use with -c.") << "\n";
qout << "**************************************************************\n";
qout.flush();
exit(0);
@@ -51,11 +51,10 @@ void printNotice()
void printCommands()
{
- printf("**************************************************************\n");
- printf("chat:<on/ off/ 1/ 2/ 3>\n ");
- printf("on = turns that chat option on\n off = turns the chat option off\n 1 = bossmode\n 2 = community\n 3 = private\n");
- printf("stop \n\t Stops the running PVS-Client.\n");
- printf("**************************************************************\n");
+ qout << "**************************************************************\n";
+ qout << "stop \n\t Stops the running PVS-Client.\n";
+ qout << "**************************************************************\n";
+ qout.flush();
exit(0);
}
@@ -102,7 +101,7 @@ int main(int argc, char** argv)
com.run();
if (!(com.running()))
{
- printf("Error. UDS Communicator is not running. Exiting.\n");
+ qDebug("Error. UDS Communicator is not running. Exiting.");
exit(0);
}
@@ -151,20 +150,20 @@ int main(int argc, char** argv)
if (com.server())
{
// wont work, no daemon running
- printf("Error. No running PVS-Client found. Exiting.\n");
+ qDebug("Error. No running PVS-Client found. Exiting.");
com.stop();
}
else
{
- printf("Will send i: %s, m: %s\n", argv[option_index + 1], "");
+ qDebug("Will send i: %s, m: %s\n", argv[option_index + 1], "");
com.sendCommand(QString(argv[option_index + 1]), "");
QCoreApplication::processEvents(QEventLoop::AllEvents);
- printf("Sent command. Exiting.\n");
+ qDebug("Sent command. Exiting.");
}
}
else
{
- printf("Error. No command issued. Exiting.\n");
+ qDebug("Error. No command issued. Exiting.");
}
exit(0); // and gone
}
@@ -211,7 +210,7 @@ int main(int argc, char** argv)
{
if (option_index + 1 < argc)
{
- printf("WARNING: -e is deprecated\n");
+ qDebug("WARNING: -e is deprecated");
option_index++;
continue;
}
@@ -243,7 +242,7 @@ int main(int argc, char** argv)
if (!com.server())
{
- printf("Error. PoolVSClient already running. Exiting\n");
+ qDebug("Error. PoolVSClient already running. Exiting");
com.stop();
exit(0);
}