checkin for saving current state
This commit is contained in:
44
common/include/command.h
Normal file
44
common/include/command.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef COMMAND_H_INCLUDED
|
||||
#define COMMAND_H_INCLUDED
|
||||
|
||||
#include <QObject>
|
||||
#include <QCoreApplication>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QProcess>
|
||||
#include <QScopedPointer>
|
||||
|
||||
class Command : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
QString m_command;
|
||||
QString m_commandResult;
|
||||
|
||||
int m_waitForStartTimeout;
|
||||
int m_waitForFinishTimeout;
|
||||
int m_exitCode;
|
||||
QString m_workingDirectory;
|
||||
|
||||
QScopedPointer<QProcess> m_p;
|
||||
|
||||
QStringList m_args;
|
||||
|
||||
public:
|
||||
Command(QString command,
|
||||
QStringList args,
|
||||
QString workingDirectory,
|
||||
int start_timeout = 100000,
|
||||
int finish_timeout = 100000);
|
||||
|
||||
QString getCommandResult(bool reset = false);
|
||||
QString command() const { return m_command; }
|
||||
|
||||
bool exec();
|
||||
int exitCode() const { return m_exitCode; }
|
||||
|
||||
private slots:
|
||||
virtual void readyReadStandardOutput();
|
||||
virtual void readyReadStandardError();
|
||||
};
|
||||
|
||||
#endif // COMMAND_H_INCLUDED
|
16
common/include/utils.h
Normal file
16
common/include/utils.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef UTILS_INTERNAL_H_INCLUDED
|
||||
#define UTILS_INTERNAL_H_INCLUDED
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace internal {
|
||||
int read1stLineOfFile(QString fileName);
|
||||
QString customerRepoRoot();
|
||||
QString customerRepoDir();
|
||||
QString customerRepoDirName();
|
||||
QString repositoryUrl();
|
||||
QString branchName();
|
||||
bool customerRepoExists();
|
||||
}
|
||||
|
||||
#endif // UTILS_INTERNAL_H_INCLUDED
|
34
common/include/utils_internal.h
Normal file
34
common/include/utils_internal.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef UTILS_INTERNAL_H_INCLUDED
|
||||
#define UTILS_INTERNAL_H_INCLUDED
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace internal {
|
||||
|
||||
static constexpr const char *UPDATE_NOT_NECESSARY{"not necessary"};
|
||||
static constexpr const char *UPDATE_NOT_REQUESTED{"not requested"};
|
||||
static constexpr const char *UPDATE_REQUESTED{"requested"};
|
||||
static constexpr const char *NO_CUSTOMER_REPOSITORY{"no customer repository"};
|
||||
static constexpr const char *ISMAS_CONNECTED{"connected"};
|
||||
static constexpr const char *ISMAS_DISCONNECTED{"disconnected"};
|
||||
static constexpr const char *ISMAS_DISCONNECTING{"disconnecting"};
|
||||
static constexpr const char *ISMAS_NOT_CONNECTED{"not connected"};
|
||||
static constexpr const char *ISMAS_CONNECTION_IN_PROGRESS{"connecting"};
|
||||
static constexpr const char *GIT_CUSTOMER_REPO_CHECKOUT_ERROR{"checkout error"};
|
||||
static constexpr const char *GIT_CUSTOMER_REPO_PULL_ERROR{"pull error"};
|
||||
static constexpr const char *GIT_CUSTOMER_REPO_UP_TO_DATE{"up to date"};
|
||||
static constexpr const char *EXEC_OPKG_COMMANDS_SUCCESS{"success"};
|
||||
static constexpr const char *UPDATE_DC_JSON_FILES_SUCCESS{"success"};
|
||||
static constexpr const char *SYNC_CUSTOMER_REPO_FILES_SUCCESS{"success"};
|
||||
static constexpr const char *UPDATE_DC_FIRMARE_SUCCESS{"success"};
|
||||
|
||||
int read1stLineOfFile(QString fileName);
|
||||
QString customerRepoRoot();
|
||||
QString customerRepoDir();
|
||||
QString customerRepoDirName();
|
||||
QString repositoryUrl();
|
||||
QString branchName();
|
||||
bool customerRepoExists();
|
||||
}
|
||||
|
||||
#endif // UTILS_INTERNAL_H_INCLUDED
|
Reference in New Issue
Block a user