From: APTX Date: Thu, 12 Jan 2012 14:23:15 +0000 (+0100) Subject: Use QTextStream instead of iostream. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=4a3d78305fb4825a70f9b0ca307243e8fc588723;p=AniAddCLI.git Use QTextStream instead of iostream. --- diff --git a/main.cpp b/main.cpp index ddbe1ed..4ce6d9b 100644 --- a/main.cpp +++ b/main.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -118,9 +117,11 @@ int main(int argc, char *argv[]) opts.parse(a.arguments()); + QTextStream cout(stdout, QIODevice::WriteOnly); + if (opts.count("help")) { - std::cout << QCoreApplication::applicationName().toUtf8().constData() << " v" << QCoreApplication::applicationVersion().toUtf8().constData() - << " by " << QCoreApplication::organizationName().toUtf8().constData() << std::endl << std::endl; + cout << QCoreApplication::applicationName() << " v" << QCoreApplication::applicationVersion() + << " by " << QCoreApplication::organizationName() << endl << endl; opts.showUsage(); return -1; } @@ -231,7 +232,6 @@ int main(int argc, char *argv[]) if (opts.count("print-settings")) { AniDBUdpClient::Client *c = AniDBUdpClient::Client::instance(); - using namespace std; cout << "Actions:" << endl; cout << " Add: " << (add ? "Yes" : "No") << endl; cout << " Rename: " << (rename ? "Yes" : "No") << endl; @@ -239,22 +239,22 @@ int main(int argc, char *argv[]) cout << " Print Hash: " << (hash ? "Yes" : "No") << endl << endl; cout << "Account settings:" << endl; - cout << " User: " << c->user().toUtf8().constData() << endl; + cout << " User: " << c->user() << endl; cout << " Pass: " << (c->pass().isEmpty() ? "" : "****") << endl; cout << " ApiKey: " << (c->apiKey().isEmpty() ? "" : "****") << endl << endl; cout << "Connection settings:" << endl; - cout << " Host: " << c->host().toUtf8().constData() << endl; + cout << " Host: " << c->host() << endl; cout << " Host port: " << c->hostPort() << endl; cout << " Local port: " << c->localPort() << endl; cout << " Encryption: " << (c->encryptionEnabled() ? "1 (Enabled)" : "0 (Disabled)") << endl << endl; cout << "MyList settings:" << endl; - cout << " State: " << State2String(state.state()).toUtf8().constData() << endl; - cout << " Watched: " << ViewedState2String(state.viewed()).toUtf8().constData() << endl; - cout << " Source: " << state.source().toUtf8().constData() << endl; - cout << " Storage: " << state.storage().toUtf8().constData() << endl; - cout << " Other: " << state.other().toUtf8().constData() << endl; + cout << " State: " << State2String(state.state()) << endl; + cout << " Watched: " << ViewedState2String(state.viewed()) << endl; + cout << " Source: " << state.source() << endl; + cout << " Storage: " << state.storage() << endl; + cout << " Other: " << state.other() << endl; cout << endl; } @@ -291,7 +291,7 @@ int main(int argc, char *argv[]) if (qApp->arguments().count() < 2) { - std::cout << "Try " << qApp->arguments()[0].toUtf8().constData() << " -help for usage." << std::endl; + cout << "Try " << qApp->arguments()[0] << " -help for usage." << endl; } AniAddCli t;