save files with comment

This commit is contained in:
2025-01-09 15:22:10 +01:00
parent 7bfb7f5a3b
commit 8f822c5383
17 changed files with 441 additions and 54 deletions

View File

@@ -8,6 +8,7 @@
#include <QByteArray>
#include <QProcess>
#include <QPluginLoader>
#include <QDateTime>
#include <initializer_list>
@@ -36,6 +37,14 @@ class Update : public QObject {
static QPluginLoader pluginLoader;
QDateTime m_start;
QString nextTimePoint() const {
float const secs = m_start.msecsTo(QDateTime::currentDateTime()) / 1000.0;
return QStringLiteral("+%1s").arg(secs, 7, 'f', 2, QChar('0'));
}
static qint64 c_ppid;
public:
enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
enum class FileTypeJson {CONFIG=1, DEVICE=2, CASH=3, SERIAL=4, TIME=5, PRINTER=6};
@@ -44,6 +53,8 @@ public:
static bool unloadDCPlugin();
static QStringList split(QString line, QChar sep = ',');
static qint64 ppid() { return c_ppid; }
static void setPPid(qint64 ppid) { c_ppid = ppid; }
explicit Update(QString customerRepository,
QString customerNrStr,
@@ -59,6 +70,7 @@ public:
virtual ~Update() override;
bool doUpdate(QStringList const &jsonFilesToDownload, bool usbStickDetected = false);
bool doUpdate();
bool updatePrinterTemplate(int templateIdx, QString fname) const;
bool updateConfig(QString jsFileToSendToDC);