#include <QTime>
#include <QSettings>
#include <QStringList>
-#include <iostream>
#include <AniDBUdpClient/MyListState>
#include <QxtCommandOptions>
#include <QDebug>
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;
}
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;
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;
}
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;