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

index 7536502..435709f 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 bbac603..e3e2291 100644 (file)
@@ -39,6 +39,7 @@ private:
 
        bool printHash;
        bool showNewVersionInfo;
+       bool closing;
 
        QTextStream cout;
 };