mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
bugfix: add behaviour on empty build and shared data
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "updatecontroller.h"
|
||||
|
||||
|
||||
UpdateController::UpdateController(QObject *parent) :
|
||||
QObject(parent),
|
||||
commonClientHandler(nullptr)
|
||||
@@ -19,6 +20,12 @@ void UpdateController::initialize(CommonClientHandler *commonClientHandler,DataP
|
||||
sizeToSend = 0;
|
||||
assetManager->initialize(this,dataParser);
|
||||
|
||||
if (!checkRequiredFolder())
|
||||
{
|
||||
emit sigErrorRequired(100);
|
||||
return;
|
||||
}
|
||||
|
||||
connect(this,&UpdateController::sigLogMessage,logger,&Logger::addTextToLogger,Qt::AutoConnection);
|
||||
|
||||
calculateFullHash();
|
||||
@@ -319,7 +326,7 @@ QList<FileData>* UpdateController::calculateHash(QString path)
|
||||
{
|
||||
QFileInfo fileInfo(dirIterator.next());
|
||||
FileData currentFile;
|
||||
if(fileInfo.isDir() && !fileInfo.fileName().startsWith(".") && fileInfo.fileName() != "RRJLoader")
|
||||
if(fileInfo.isDir() && !fileInfo.fileName().startsWith(".") && fileInfo.fileName() != projectFolderName)
|
||||
{
|
||||
currentFile.path = Tools::createLocalPath(fileInfo.absoluteFilePath());
|
||||
currentFile.hash = "FOLDER";
|
||||
@@ -536,7 +543,6 @@ QList<FileData> UpdateController::getFileSendList()
|
||||
return sendList;
|
||||
}
|
||||
|
||||
|
||||
QList<FileData> UpdateController::getClientDataList() const
|
||||
{
|
||||
return clientDataList;
|
||||
@@ -552,6 +558,17 @@ void UpdateController::clearCurrentDataInfo()
|
||||
delete dataInfo;
|
||||
}
|
||||
|
||||
bool UpdateController::checkRequiredFolder()
|
||||
{
|
||||
bool required = true;
|
||||
QDir buildDir(buildPath + "/" + projectFolderName);
|
||||
if (!buildDir.exists()) required = false;
|
||||
|
||||
QDir baseSharedDir(sharedDataPath + "/" + baseNameVersion);
|
||||
if (!baseSharedDir.exists()) required = false;
|
||||
|
||||
return required;
|
||||
}
|
||||
UpdateController::~UpdateController()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user