mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
86 lines
2.2 KiB
C++
86 lines
2.2 KiB
C++
#include "postprocessorsystem.h"
|
|
|
|
PostProcessorSystem::PostProcessorSystem(QObject *parent) : QObject(parent){}
|
|
|
|
void PostProcessorSystem::initialize(DataParserOutput *dataParserOutput,
|
|
HashComparer *hashComparer,
|
|
VersionContainer* versionContainer,
|
|
UpdateController* updateController)
|
|
{
|
|
this->hashComparer = hashComparer;
|
|
this->versionContainer = versionContainer;
|
|
this->updateController = updateController;
|
|
this->dataParserOutput = dataParserOutput;
|
|
|
|
}
|
|
|
|
void PostProcessorSystem::socketDisable()
|
|
{
|
|
emit sigSocketDisabled();
|
|
}
|
|
|
|
void PostProcessorSystem::serverBlocked()
|
|
{
|
|
emit sigServerBlocked();
|
|
}
|
|
|
|
void PostProcessorSystem::startCompare()
|
|
{
|
|
QList<FileData> *serverStreamingHash = new QList<FileData>;
|
|
QList<FileData> *localStreamingHash = new QList<FileData>;
|
|
|
|
QFile file(serverHash);
|
|
file.open(QIODevice::ReadOnly | QIODevice::Text);
|
|
|
|
serverStreamingHash = dataParserOutput->xmlFileDataParse(file.readAll(),"StreamingAssets");
|
|
file.close();
|
|
|
|
QFile file2(streamingHashFilename);
|
|
file2.open(QIODevice::ReadOnly | QIODevice::Text);
|
|
|
|
localStreamingHash = dataParserOutput->xmlFileDataParse(file2.readAll(),"StreamingAssets");
|
|
file2.close();
|
|
|
|
emit sigStartCompare(serverStreamingHash,*localStreamingHash);
|
|
}
|
|
|
|
void PostProcessorSystem::showUpdateList()
|
|
{
|
|
emit sigShowUpdateList();
|
|
}
|
|
|
|
void PostProcessorSystem::compareFiles()
|
|
{
|
|
updateController->updateFilesOnServer(hashComparer->getFilesForUpdate());
|
|
}
|
|
|
|
void PostProcessorSystem::checkAccessType(QString type)
|
|
{
|
|
if(type == "instructor")
|
|
{
|
|
emit sigCallUpdateList();
|
|
}
|
|
}
|
|
|
|
void PostProcessorSystem::saveLoginData(ServerAuthorization *auth)
|
|
{
|
|
emit sigSaveLoginData(auth);
|
|
dataParserOutput->createAuthData(auth);
|
|
}
|
|
|
|
void PostProcessorSystem::setServerVersion(StreamingVersionData *serverVersion)
|
|
{
|
|
versionContainer->setServerVersionData(serverVersion);
|
|
}
|
|
|
|
void PostProcessorSystem::calculateCommonHash()
|
|
{
|
|
updateController->calculateCommonHash();
|
|
}
|
|
|
|
void UpdateController::checkCanUpdate()
|
|
{
|
|
QByteArray checkUpdate = dataParserOut->xmlAnswer_notify("CANCHANGE");
|
|
sendSystem->sendXMLAnswer(checkUpdate);
|
|
}
|