]> Some of my projects - AniAddCLI.git/commitdiff
Show new version info.
authorAPTX <marek321@gmail.com>
Mon, 2 Jan 2012 17:43:22 +0000 (18:43 +0100)
committerAPTX <marek321@gmail.com>
Mon, 2 Jan 2012 17:43:22 +0000 (18:43 +0100)
aniaddcli.cpp
aniaddcli.h

index 71cb1a002c9fee7354545756e543bd5aabb98761..9b38f93b571d07bcf0577db0bdcc385e9711c4cd 100644 (file)
@@ -5,7 +5,7 @@
 #include <QFileInfo>
 
 AniAddCli::AniAddCli(QObject *parent) :
-       QObject(parent), printHash(false), cout(stdout, QIODevice::WriteOnly)
+       QObject(parent), printHash(false), cout(stdout, QIODevice::WriteOnly), showNewVersionInfo(false)
 {
        AniDBUdpClient::Client::instance()->setIdlePolicy(AniDBUdpClient::ImmediateLogoutIdlePolicy);;
        connect(AniDBUdpClient::Client::instance(), SIGNAL(connectionError()), this, SLOT(handleError()));
@@ -167,11 +167,14 @@ void AniAddCli::handleError()
 
 void AniAddCli::showNewVersionMessage()
 {
-       cout << "[INFO] New version available. Update the library and all clients!";
+       cout << endl << "[INFO] New version available. Update the library and all clients!" << endl << endl;
+       showNewVersionInfo = true;
 }
 
 void AniAddCli::exit(int code)
 {
+       if (showNewVersionInfo)
+               showNewVersionMessage();
        if (!code)
                cout << "[INFO] Done" << endl;
        qApp->exit(code);
index cc47a7f39b879a1dd1414be5e03b2fd13c5e4999..bbac603c029db911e9283f13c8939d8ca6b34afd 100644 (file)
@@ -38,6 +38,7 @@ private:
        AniDBUdpClient::MyListState m_state;
 
        bool printHash;
+       bool showNewVersionInfo;
 
        QTextStream cout;
 };