]> Some of my projects - AniAddCLI.git/commitdiff
Do not display progress info while shutting down.
authorAPTX <marek321@gmail.com>
Sun, 15 Jan 2012 16:14:32 +0000 (17:14 +0100)
committerAPTX <marek321@gmail.com>
Sun, 15 Jan 2012 16:14:32 +0000 (17:14 +0100)
aniaddcli.cpp
aniaddcli.h

index 7536502d4c6f7d92e5706b83e4f583886985d649..435709f95dc4f53f8e33ef9e8669cd2510d40004 100644 (file)
@@ -5,7 +5,7 @@
 #include <QFileInfo>
 
 AniAddCli::AniAddCli(QObject *parent) :
-       QObject(parent), printHash(false), cout(stdout, QIODevice::WriteOnly), showNewVersionInfo(false)
+       QObject(parent), printHash(false), cout(stdout, QIODevice::WriteOnly), showNewVersionInfo(false), closing(false)
 {
        AniDBUdpClient::Client::instance()->setIdlePolicy(AniDBUdpClient::ImmediateLogoutIdlePolicy);;
        connect(AniDBUdpClient::Client::instance(), SIGNAL(connectionError()), this, SLOT(handleError()));
@@ -105,6 +105,9 @@ void AniAddCli::handleStatusUpdate(AniDBUdpClient::File::Action action, AniDBUdp
                return;
        }
 
+       if (closing)
+               return;
+
        switch (state)
        {
                case AniDBUdpClient::File::Success:
@@ -178,5 +181,6 @@ void AniAddCli::exit(int code)
                showNewVersionMessage();
        if (!code)
                cout << "[INFO] Done. Logging out..." << endl;
+       closing = true;
        qApp->exit(code);
 }
index bbac603c029db911e9283f13c8939d8ca6b34afd..e3e2291f2fecd12a9427a2b3f943a3ffe9320e0d 100644 (file)
@@ -39,6 +39,7 @@ private:
 
        bool printHash;
        bool showNewVersionInfo;
+       bool closing;
 
        QTextStream cout;
 };