mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
107 lines
3.0 KiB
C++
107 lines
3.0 KiB
C++
#ifndef UPDATECONTROLLER_H
|
||
#define UPDATECONTROLLER_H
|
||
|
||
#include <QString>
|
||
#include <QObject>
|
||
#include <QCryptographicHash>
|
||
#include <QDirIterator>
|
||
#include <QDebug>
|
||
#include <QDataStream>
|
||
#include <QMutex>
|
||
#include <QApplication>
|
||
#include <QMessageBox>
|
||
#include <Systems/Parsers/dataparser.h>
|
||
#include <Data/typesDataServerClient.h>
|
||
#include <Data/StreamingVersionData.h>
|
||
#include "fasthashcalculator.h"
|
||
|
||
class TCPServer;
|
||
class SendSystem;
|
||
class DataParser;
|
||
class ClientHandler;
|
||
class AssetsManager;
|
||
class ServerLMSWidget;
|
||
class CommonClientHandler;
|
||
class Logger;
|
||
class UpdateController : public QObject
|
||
{
|
||
Q_OBJECT
|
||
|
||
public:
|
||
|
||
explicit UpdateController(QObject *parent = 0);
|
||
void initialize(CommonClientHandler* commonClientHandler,DataParser *dataParser,AssetsManager *assetManager);
|
||
void compareFiles(ClientHandler* handler, QByteArray array);
|
||
void showHash();
|
||
void calculateFullHash();
|
||
void calculateFullHashWithSetup();
|
||
void calculateSharedHash();
|
||
void sendNewVersionList();
|
||
void setCurrentStreamingPath(QString path);
|
||
bool checkDuplicate(QString versionName);
|
||
QList<FileData>* calculateHash(QString path);
|
||
QByteArray getLocalHash();
|
||
|
||
QString getCurrentVersionName();
|
||
QList<FileData> getClientDataList() const;
|
||
QString getCurrentStreamingPath() const;
|
||
QList<FileData> prepareRealPathList(QList<FileData> fileData);
|
||
|
||
~UpdateController();
|
||
|
||
DataInfo *getCurrentDataInfo();
|
||
void clearCurrentDataInfo();
|
||
void xmlFileDataParse(QByteArray array);
|
||
|
||
QString getPathAdditionalFile(QString name);
|
||
QString getPathScensFile(QString name);
|
||
|
||
StreamingVersionData *getCurrentVersion();
|
||
void setDataInfo(DataInfo *value);
|
||
|
||
public slots:
|
||
void changeAssetVersion(QString versionName);
|
||
void createCopyVersion(QString versionName,QString newVersionName,QString author);
|
||
void deleteAssetVersion(QString versionName);
|
||
void setUpCurrentServerHash();
|
||
|
||
signals:
|
||
void sigErrorRequired(int code);
|
||
void sigUpdateDocs();
|
||
|
||
void sigInitializeFinished();
|
||
|
||
//сигнал о блокировке авторизации
|
||
bool signal_BlockAutorization(bool block, QString whoFullName, QString type);
|
||
|
||
private:
|
||
QList<FileData> clientDataList;
|
||
QList<FileData> serverDataList;
|
||
|
||
DataInfo *dataInfo;
|
||
|
||
QString buildPath;
|
||
QString currentStreamingPath;
|
||
QString sharedDataPath;
|
||
CommonClientHandler *commonClientHandler;
|
||
FastHashCalculator *hashCalculator;
|
||
DataParser *dataParser;
|
||
AssetsManager *assetManager;
|
||
quint64 sizeToSend;
|
||
QMutex *mutex;
|
||
|
||
QString getCommands();
|
||
void printFileList(QList<FileData> fileData);
|
||
|
||
bool checkNeedUpdate(ClientHandler* handler);
|
||
void setLocalFileData(QList<FileData> dataList);
|
||
void calculateSize();
|
||
void saveHash(QString fileName,QList<FileData> *fileList);
|
||
QList<FileData>* loadHash(QString fileName);
|
||
void CalculateSizeToSend(QList<FileData> diffList);
|
||
bool checkRequiredFolder();
|
||
void calculateCurrentSharedHash();
|
||
};
|
||
|
||
#endif // UPDATECONTROLLER_H
|