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

index 71cb1a0..9b38f93 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 cc47a7f..bbac603 100644 (file)
@@ -38,6 +38,7 @@ private:
        AniDBUdpClient::MyListState m_state;
 
        bool printHash;
+       bool showNewVersionInfo;
 
        QTextStream cout;
 };