Added method getReasonForSendLastVersion()
This commit is contained in:
		@@ -1,4 +1,5 @@
 | 
			
		||||
#include "ismas/ismas_client.h"
 | 
			
		||||
#include "utils.h"
 | 
			
		||||
 | 
			
		||||
#include <cstring>
 | 
			
		||||
#include <cstdio>
 | 
			
		||||
@@ -886,3 +887,18 @@ QString IsmasClient::updateOfPSAFailed(int resultCode, QString step,
 | 
			
		||||
                             reason.toStdString().c_str(),
 | 
			
		||||
                             version.toStdString().c_str());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char const *IsmasClient::reason[REASON::ENTRIES] = {
 | 
			
		||||
    "TIME-TRIGGERED", "SERVICE", "DEV-TEST"
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
QString IsmasClient::getReasonForLastSendVersion() {
 | 
			
		||||
    QString const &parentName = Utils::getParentName();
 | 
			
		||||
    if (parentName == "ATBQT") {
 | 
			
		||||
        return reason[REASON::SERVICE];
 | 
			
		||||
    }
 | 
			
		||||
    if (parentName == "systemd") {
 | 
			
		||||
        return reason[REASON::TIME_TRIGGERED];
 | 
			
		||||
    }
 | 
			
		||||
    return reason[REASON::DEV_TEST];
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -139,6 +139,7 @@ public:
 | 
			
		||||
        DIRECT_PORT = 7778
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    enum RESULT_CODE {
 | 
			
		||||
        SUCCESS=0,
 | 
			
		||||
        NO_UPDATE_NECESSARY=1,
 | 
			
		||||
@@ -146,9 +147,20 @@ public:
 | 
			
		||||
        WRONG_PACKAGE=3,
 | 
			
		||||
        INSTALL_ERROR=4};
 | 
			
		||||
 | 
			
		||||
    enum REASON {
 | 
			
		||||
        TIME_TRIGGERED = 0,
 | 
			
		||||
        SERVICE,
 | 
			
		||||
        DEV_TEST,
 | 
			
		||||
        ENTRIES
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    static char const *reason[REASON::ENTRIES];
 | 
			
		||||
 | 
			
		||||
    static std::optional<QString>
 | 
			
		||||
        sendRequestReceiveResponse(int port, QString const &request);
 | 
			
		||||
 | 
			
		||||
    static QString getReasonForLastSendVersion();
 | 
			
		||||
 | 
			
		||||
    int getProgressInPercent() const {return m_progressInPercent; }
 | 
			
		||||
    void setProgressInPercent(int procent) { m_progressInPercent = procent; }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user