mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Merge branch 'add-versionController' into merge-task-and-verController
# Conflicts: # InstructorsAndTrainees/CMakeLists.txt # InstructorsAndTrainees/connectorToServer/Core/recognizesystem.h # InstructorsAndTrainees/instructorsandtraineeswidget.cpp # ServerLMS/Systems/updatecontroller.cpp # ServerLMS/Systems/updatecontroller.h
This commit is contained in:
@@ -14,6 +14,8 @@ enum PacketType
|
||||
TYPE_XMLANSWER = 8,
|
||||
TYPE_QT = 9,
|
||||
TYPE_DISABLE = 11,
|
||||
TYPE_UPDATE = 12,
|
||||
TYPE_CHECK_VERSION = 13,
|
||||
TYPE_FILESIZE = 20,
|
||||
|
||||
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
||||
|
||||
@@ -13,7 +13,11 @@ public:
|
||||
this->viewName = viewName;
|
||||
this->createData = data;
|
||||
this->size = size;
|
||||
this->isChangeable = true;
|
||||
this->author = "";
|
||||
}
|
||||
StreamingVersionData(){};
|
||||
|
||||
~StreamingVersionData();
|
||||
|
||||
QString getAbsolutPath() const
|
||||
@@ -36,11 +40,55 @@ public:
|
||||
return size;
|
||||
}
|
||||
|
||||
bool getIsChangeable() const
|
||||
{
|
||||
return isChangeable;
|
||||
}
|
||||
|
||||
void setIsChangeable(bool value)
|
||||
{
|
||||
isChangeable = value;
|
||||
}
|
||||
|
||||
QString getAuthor() const
|
||||
{
|
||||
return author;
|
||||
}
|
||||
|
||||
void setAuthor(const QString &value)
|
||||
{
|
||||
author = value;
|
||||
}
|
||||
|
||||
void setViewName(const QString &value)
|
||||
{
|
||||
viewName = value;
|
||||
}
|
||||
|
||||
void setCreateData(const QDateTime &value)
|
||||
{
|
||||
createData = value;
|
||||
}
|
||||
|
||||
void setAbsolutePath(const QString &value)
|
||||
{
|
||||
absolutePath = value;
|
||||
}
|
||||
|
||||
private:
|
||||
QString absolutePath;
|
||||
QString viewName;
|
||||
QString author;
|
||||
QDateTime createData;
|
||||
bool isChangeable;
|
||||
qint32 size;
|
||||
};
|
||||
|
||||
#endif // STREAMINGVERSIONDATA_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -262,6 +262,7 @@ void ProcessParser::clientMessage(QXmlStreamReader &xmlReader,ClientHandler *cli
|
||||
}
|
||||
|
||||
processingSystem->processingFromClientMessage(client, clientMessage);
|
||||
|
||||
}
|
||||
|
||||
void ProcessParser::clientNotify(QXmlStreamReader &xmlReader,ClientHandler *client)
|
||||
@@ -278,6 +279,8 @@ void ProcessParser::clientNotify(QXmlStreamReader &xmlReader,ClientHandler *clie
|
||||
clientNotify.Code = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
processingSystem->processingClientNotify(client, clientNotify);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,76 @@ AssetsManager::AssetsManager(QObject *parent) : QObject(parent)
|
||||
void AssetsManager::initialize(UpdateController* updateContoller,DataParser *dataParser)
|
||||
{
|
||||
this->updateController = updateContoller;
|
||||
connect(this,&AssetsManager::sigSaveVersion,updateContoller,&UpdateController::saveVersionToFile);
|
||||
//connect(this,&AssetsManager::sigSaveVersion,updateContoller,&UpdateController::saveVersionToFile);
|
||||
datas = new QList<StreamingVersionData*>;
|
||||
}
|
||||
|
||||
void AssetsManager::fillDatas()
|
||||
{
|
||||
QByteArray array;
|
||||
QFile file(versionListFile);
|
||||
|
||||
if(!file.exists())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
datas->clear();
|
||||
|
||||
file.open(QIODevice::ReadOnly);
|
||||
array = file.readAll();
|
||||
file.close();
|
||||
QXmlStreamReader xmlReader(array);
|
||||
|
||||
xmlReader.readNext();
|
||||
QString name = xmlReader.name().toString();
|
||||
|
||||
while(!xmlReader.atEnd())
|
||||
{
|
||||
name = xmlReader.name().toString();
|
||||
|
||||
if(!xmlReader.isStartElement()) {
|
||||
xmlReader.readNext();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "VersionList")
|
||||
{
|
||||
xmlReader.readNext();
|
||||
|
||||
while (!xmlReader.atEnd())
|
||||
{
|
||||
if(xmlReader.isStartElement())
|
||||
{
|
||||
if(xmlReader.name() == "VersionData")
|
||||
{
|
||||
StreamingVersionData *data = new StreamingVersionData();
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Version")
|
||||
data->setViewName(value);
|
||||
else if(name == "Created")
|
||||
data->setCreateData(QDateTime::fromString(value));
|
||||
else if(name == "isChangeable")
|
||||
data->setIsChangeable(value.toInt());
|
||||
else if(name == "author")
|
||||
data->setAuthor(value);
|
||||
|
||||
}
|
||||
|
||||
datas->append(data);
|
||||
}
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void AssetsManager::setVersionList(QList<StreamingVersionData*> *streamingVersion)
|
||||
{
|
||||
datas->clear();
|
||||
@@ -41,7 +107,7 @@ QString AssetsManager::setVersion(QString versionName)
|
||||
if (version->getViewName() == versionName)
|
||||
{
|
||||
currentVersionData = version;
|
||||
emit sigSaveVersion(currentVersionData);
|
||||
saveVersionToFile(currentVersionData);
|
||||
|
||||
return version->getAbsolutPath();
|
||||
}
|
||||
@@ -101,11 +167,11 @@ void AssetsManager::addVersion(StreamingVersionData *data)
|
||||
datas->push_back(data);
|
||||
}
|
||||
|
||||
void AssetsManager::createCopyVersion(QString versionName,QString newVersionName)
|
||||
void AssetsManager::createCopyVersion(QString versionName,QString newVersionName,QString author)
|
||||
{
|
||||
qDebug() << "assetManager thread ID " << QThread::currentThreadId();
|
||||
QListIterator<StreamingVersionData*> iterator(*datas);
|
||||
StreamingVersionData* data;
|
||||
StreamingVersionData* data = new StreamingVersionData;
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
@@ -113,10 +179,15 @@ void AssetsManager::createCopyVersion(QString versionName,QString newVersionName
|
||||
|
||||
if (version->getViewName() == versionName)
|
||||
{
|
||||
data = version;
|
||||
data->setAbsolutePath(version->getAbsolutPath());
|
||||
}
|
||||
}
|
||||
|
||||
data->setAuthor(author);
|
||||
data->setIsChangeable(true);
|
||||
data->setViewName(newVersionName);
|
||||
datas->append(data);
|
||||
|
||||
qDebug() << "Version for copy " << versionName;
|
||||
qDebug() << "New version name " << newVersionName;
|
||||
|
||||
@@ -208,6 +279,113 @@ void AssetsManager::copyAllRecurse(QString source,QString destination)
|
||||
}
|
||||
}
|
||||
|
||||
void AssetsManager::writeVersionsToFile(QList<StreamingVersionData*> version,bool isFirst)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
QFile file(versionListFile);
|
||||
|
||||
foreach(StreamingVersionData* ver,version)
|
||||
{
|
||||
SAttribute attribute1 = {"Version", ver->getViewName()};
|
||||
SAttribute attribute2 = {"Created", ver->getCreateData().toString()};
|
||||
SAttribute attribute3;
|
||||
SAttribute attribute4;
|
||||
|
||||
if(isFirst)
|
||||
{
|
||||
attribute3 = {"isChangeable",QString::number(false)};
|
||||
attribute4 = {"author",tr("Константа-дизайн")};
|
||||
}else
|
||||
{
|
||||
attribute3 ={"isChangeable",QString::number(ver->getIsChangeable())};
|
||||
attribute4 = {"author",ver->getAuthor()};
|
||||
}
|
||||
|
||||
|
||||
QList<SAttribute> listAttr = {attribute1, attribute2,attribute3,attribute4};
|
||||
SXmlAnswerTag tag = {"VersionData", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
datas->append(ver);
|
||||
}
|
||||
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("VersionList");
|
||||
|
||||
foreach(SXmlAnswerTag tag,listTag)
|
||||
{
|
||||
xmlWriter.writeStartElement(tag.elementName);
|
||||
|
||||
foreach(SAttribute attribute,tag.attr)
|
||||
{
|
||||
xmlWriter.writeAttribute(attribute.name,attribute.value);
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
file.close();
|
||||
}
|
||||
|
||||
void AssetsManager::createFirstVersionListXML(QList<StreamingVersionData*> version) //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
QFile file(versionListFile);
|
||||
|
||||
if(!file.exists())
|
||||
{
|
||||
writeVersionsToFile(version,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(datas->count() == 0) fillDatas();
|
||||
|
||||
foreach(StreamingVersionData* ver,version)
|
||||
{
|
||||
foreach(StreamingVersionData* data,*datas)
|
||||
{
|
||||
if(ver->getViewName() == data->getViewName())
|
||||
{
|
||||
data->setAbsolutePath(ver->getAbsolutPath());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
writeVersionsToFile(*datas,false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AssetsManager::saveVersionToFile(StreamingVersionData *streamingVersion) //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
QFile file(version);
|
||||
file.open(QFile::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
|
||||
xmlWriter.writeStartElement("VersionData");
|
||||
xmlWriter.writeAttribute("Version",streamingVersion->getViewName());
|
||||
xmlWriter.writeAttribute("Created",streamingVersion->getCreateData().toString());
|
||||
xmlWriter.writeAttribute("isChangeable",QString::number(streamingVersion->getIsChangeable()));
|
||||
xmlWriter.writeAttribute("author",streamingVersion->getAuthor());
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
AssetsManager::~AssetsManager()
|
||||
{
|
||||
|
||||
|
||||
@@ -13,10 +13,11 @@ public:
|
||||
explicit AssetsManager(QObject *parent = nullptr);
|
||||
void initialize(UpdateController* updateContoller,DataParser *dataParser);
|
||||
void addVersion(StreamingVersionData *data);
|
||||
void createCopyVersion(QString versionName,QString newName);
|
||||
void createCopyVersion(QString versionName,QString newName,QString author);
|
||||
void deleteVersion(QString version);
|
||||
void setVersionList(QList<StreamingVersionData *> *streamingVersion);
|
||||
bool findDuplicate(QString name);
|
||||
void createFirstVersionListXML(QList<StreamingVersionData*> assets);
|
||||
QString setVersion(QString versionName);
|
||||
|
||||
QList<FileData> *prepareLocalPathList(QList<FileData>*fileData);
|
||||
@@ -27,6 +28,9 @@ public:
|
||||
|
||||
StreamingVersionData *getCurrentVersionData() const;
|
||||
|
||||
void saveVersionToFile(StreamingVersionData *streamingVersion);
|
||||
void writeVersionsToFile(QList<StreamingVersionData*> version,bool isFirst);
|
||||
|
||||
signals:
|
||||
void sigSaveVersion(StreamingVersionData *versionData);
|
||||
|
||||
@@ -36,6 +40,7 @@ private:
|
||||
StreamingVersionData* currentVersionData;
|
||||
|
||||
void copyAllRecurse(QString source, QString destination);
|
||||
void fillDatas();
|
||||
};
|
||||
|
||||
#endif // ASSETSMANAGER_H
|
||||
|
||||
@@ -11,6 +11,8 @@ void CommonClientHandler::initialize(QMap<int, ClientHandler *> *clientsMap, Pro
|
||||
this->processingSystem = processingSystem;
|
||||
this->dataParser = dataParser;
|
||||
this->logger = logger;
|
||||
|
||||
connect(this,&CommonClientHandler::sigSendToLogger,logger,&Logger::addTextToLogger,Qt::AutoConnection);
|
||||
}
|
||||
|
||||
void CommonClientHandler::sendNewVersionListToAllClient()
|
||||
@@ -85,7 +87,8 @@ void CommonClientHandler::slot_msgToClientFromGUI(QString login, QString text)
|
||||
|
||||
QString str = "Msg To Client [" + peerAddress + ":" + peerPort + "] : " + textMsg;
|
||||
|
||||
logger->addTextToLogger(str);
|
||||
emit sigSendToLogger(str);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -111,7 +114,7 @@ void CommonClientHandler::slot_msgToGUIfromClient(QString login, QString text)
|
||||
|
||||
QString str = "Msg From Client [" + peerAddress + ":" + peerPort + "] : " + textMsg;
|
||||
|
||||
logger->addTextToLogger(str);
|
||||
emit sigSendToLogger(str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +137,7 @@ void CommonClientHandler::slot_sendTaskToClient(QString fullNameClient,QString t
|
||||
QString peerPort = QString::number(handler->getSocket()->peerPort());
|
||||
|
||||
QString str = "Task To Client [" + peerAddress + ":" + peerPort + "] : " + textTask;
|
||||
logger->addTextToLogger(str);
|
||||
emit sigSendToLogger(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
void slot_msgToGUIfromClient(QString login, QString text);
|
||||
void slot_sendTaskToClient(QString fullNameClient, QString textTask);
|
||||
signals:
|
||||
|
||||
void sigSendToLogger(QString text);
|
||||
private:
|
||||
QMap<int, ClientHandler*> *clientsMap;
|
||||
ProcessingSystem *processingSystem;
|
||||
|
||||
@@ -11,11 +11,16 @@ ProcessingSystem::ProcessingSystem(ProviderDBLMS* providerDBLMS, UpdateControlle
|
||||
this->updateController = updateController;
|
||||
}
|
||||
|
||||
void ProcessingSystem::initialize(ServerLMSWidget *server, DataParser *dataParser, CommonClientHandler *commonClientHandler,Logger *logger)
|
||||
void ProcessingSystem::initialize(ServerLMSWidget *server,
|
||||
DataParser *dataParser,
|
||||
CommonClientHandler *commonClientHandler,
|
||||
Logger *logger,
|
||||
UpdateController *updateController)
|
||||
{
|
||||
this->commonClientServer = commonClientHandler;
|
||||
this->dataParser = dataParser;
|
||||
this->server = server;
|
||||
this->updateController = updateController;
|
||||
|
||||
connect(this,&ProcessingSystem::sigAuthChanged,commonClientHandler, &CommonClientHandler::slot_AuthChanged,Qt::AutoConnection);
|
||||
connect(this,&ProcessingSystem::sigUpdateListClients,server, &ServerLMSWidget::slotUpdateListClients,Qt::AutoConnection);
|
||||
@@ -303,6 +308,18 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif
|
||||
{
|
||||
client->sendVersionList();
|
||||
}
|
||||
else if(clientNotify.Code == commandCanChangeVersion)
|
||||
{
|
||||
if (updateController->getCurrentVersion()->getIsChangeable())
|
||||
{
|
||||
client->sigSendNotify(commandChangable);
|
||||
}
|
||||
else
|
||||
{
|
||||
client->sigSendNotify(commandUnchangable);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,12 @@ class ProcessingSystem : public QObject
|
||||
public:
|
||||
explicit ProcessingSystem(ProviderDBLMS* providerDBLMS, UpdateController* updateController, QObject *parent = nullptr);
|
||||
|
||||
void initialize(ServerLMSWidget *server,DataParser* dataParser,CommonClientHandler *commonClientServer,Logger *logger);
|
||||
void initialize(ServerLMSWidget *server,
|
||||
DataParser* dataParser,
|
||||
CommonClientHandler *commonClientServer,
|
||||
Logger *logger,
|
||||
UpdateController *updateComtroller);
|
||||
|
||||
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
|
||||
void processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization);
|
||||
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id = 0, void* data = nullptr);
|
||||
@@ -45,9 +50,8 @@ private:
|
||||
CommonClientHandler *commonClientServer;
|
||||
ServerLMSWidget *server;
|
||||
DataParser *dataParser;
|
||||
//InstructorsAndTraineesWidget *pInstructorsAndTrainees;
|
||||
UpdateController *updateController;
|
||||
ProviderDBLMS* providerDBLMS;
|
||||
UpdateController* updateController;
|
||||
};
|
||||
|
||||
#endif // PROCESSINGSYSTEM_H
|
||||
|
||||
@@ -87,14 +87,22 @@ void RecognizeSystem::recognize()
|
||||
if (!stream.commitTransaction()) continue;
|
||||
}
|
||||
|
||||
if (command == commandUpdateFilesClient) //запускает процесс оновления
|
||||
if (packetType == PacketType::TYPE_UPDATE)
|
||||
{
|
||||
|
||||
sendSystem->updateFiles(updateController->getFileSendList(),
|
||||
updateController->getClientDataList());
|
||||
updateController->getFileDeleteList());
|
||||
|
||||
qDebug()<< "Call update";
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
command = "";
|
||||
}
|
||||
|
||||
if(packetType == PacketType::TYPE_CHECK_VERSION)
|
||||
{
|
||||
QFile checkFile(clientHash);
|
||||
checkFile.open(QIODevice::ReadOnly);
|
||||
updateController->compareFiles(clientHandler,checkFile.readAll());
|
||||
checkFile.close();
|
||||
}
|
||||
|
||||
if (packetType == PacketType::TYPE_XMLANSWER)
|
||||
@@ -160,6 +168,16 @@ void RecognizeSystem::recognize()
|
||||
|
||||
QFile file(filePath);
|
||||
|
||||
// //ПРОВЕРКА НА ИЗМЕНЕНИЕ БАЗОВОЙ ВЕРСИИ
|
||||
// bool check = checkIsChangeable();
|
||||
// bool check2 = checkNonStaticData(filePath);
|
||||
// if(!check && check2)
|
||||
// {
|
||||
// packetType = PacketType::TYPE_NONE;
|
||||
// sendSystem->sendNotify(commandTryBaseChange);
|
||||
// mutex->unlock();
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (file.exists())
|
||||
{
|
||||
@@ -231,6 +249,17 @@ void RecognizeSystem::recognize()
|
||||
break;
|
||||
}
|
||||
|
||||
// //ПРОВЕРКА НА ИЗМЕНЕНИЕ БАЗОВОЙ ВЕРСИИ
|
||||
// bool check = checkIsChangeable();
|
||||
// bool check2 = checkNonStaticData(filePath);
|
||||
// if(!check && check2)
|
||||
// {
|
||||
// sendSystem->sendNotify(commandTryBaseChange);
|
||||
// packetType = PacketType::TYPE_NONE;
|
||||
// mutex->unlock();
|
||||
// return;
|
||||
// }
|
||||
|
||||
QFile file(filePath);
|
||||
QFileInfo fileInfo(file);
|
||||
|
||||
@@ -280,14 +309,6 @@ void RecognizeSystem::recognize()
|
||||
|
||||
file.close();
|
||||
|
||||
if(command == "check")
|
||||
{
|
||||
QFile checkFile(filePath);
|
||||
checkFile.open(QIODevice::ReadOnly);
|
||||
updateController->compareFiles(clientHandler,checkFile.readAll());
|
||||
checkFile.close();
|
||||
}
|
||||
|
||||
filePath.clear();
|
||||
fileSize = 0;
|
||||
tmpBlock.clear();
|
||||
@@ -345,7 +366,7 @@ void RecognizeSystem::recognize()
|
||||
break;
|
||||
}
|
||||
|
||||
emit sigCopyVersion(result[0],result[1]);
|
||||
emit sigCopyVersion(result[0],result[1],result[2]);
|
||||
sendSystem->sendPacketType(PacketType::BUSY);
|
||||
}
|
||||
|
||||
@@ -412,6 +433,18 @@ QString RecognizeSystem::createFullPath(QString path)
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
bool RecognizeSystem::checkIsChangeable()
|
||||
{
|
||||
return updateController->getCurrentVersion()->getIsChangeable();
|
||||
}
|
||||
|
||||
bool RecognizeSystem::checkNonStaticData(QString path)
|
||||
{
|
||||
if(path.contains(sharedDataFolderName)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
RecognizeSystem::~RecognizeSystem()
|
||||
{
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ signals:
|
||||
void sigXmlParser(ClientHandler *clientHandler,QByteArray data);
|
||||
void sigChangeVersion(QString versionName);
|
||||
void sigDeleteVersion(QString versionName);
|
||||
void sigCopyVersion(QString versionName,QString newVersionName);
|
||||
void sigCopyVersion(QString versionName,QString newVersionName,QString author);
|
||||
|
||||
private:
|
||||
UpdateController *updateController;
|
||||
@@ -61,5 +61,7 @@ private:
|
||||
void packetTypeInit(PacketType packet,Client *client);
|
||||
void packetTypeInit(PacketType type);
|
||||
QString createFullPath(QString path);
|
||||
bool checkIsChangeable();
|
||||
bool checkNonStaticData(QString path);
|
||||
};
|
||||
#endif // RECOGNIZESYSTEM_H
|
||||
|
||||
@@ -35,14 +35,22 @@ void SendSystem::sendMessageBlock(QString message)
|
||||
|
||||
void SendSystem::sendFileBlock(QString path)
|
||||
{
|
||||
|
||||
qDebug() << "sendFileBlock thread: " << QThread::currentThreadId();
|
||||
|
||||
QFile file(path);
|
||||
QFileInfo fileInfo(file);
|
||||
|
||||
if(isSendStopped)
|
||||
{ //Поведение на случай отключения клиента
|
||||
|
||||
file.close();
|
||||
return;
|
||||
}
|
||||
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
QFile file(path);
|
||||
QFileInfo fileInfo(file);
|
||||
|
||||
fileSize = fileInfo.size();
|
||||
|
||||
if(fileSize == 0){
|
||||
@@ -55,20 +63,19 @@ void SendSystem::sendFileBlock(QString path)
|
||||
|
||||
stream << path << fileSize;
|
||||
|
||||
if(isSendStopped) { //Поведение на случай отключения клиента
|
||||
|
||||
file.close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
socket->waitForBytesWritten();
|
||||
socket->waitForBytesWritten(10);
|
||||
|
||||
if(file.open(QFile::ReadOnly)){
|
||||
while(!file.atEnd()){
|
||||
if(file.open(QFile::ReadOnly))
|
||||
{
|
||||
while(!file.atEnd())
|
||||
{
|
||||
QByteArray data = file.read(1025*250);
|
||||
stream << data;
|
||||
socket->waitForBytesWritten();
|
||||
socket->waitForBytesWritten(10);
|
||||
|
||||
if(socket->state() == QAbstractSocket::UnconnectedState) break;
|
||||
countSend++;
|
||||
}
|
||||
|
||||
@@ -77,7 +84,7 @@ void SendSystem::sendFileBlock(QString path)
|
||||
|
||||
file.close();
|
||||
countSend = 0;
|
||||
socket->waitForBytesWritten();
|
||||
socket->waitForBytesWritten(10);
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
@@ -237,11 +244,9 @@ void SendSystem::updateFiles(QList<FileData> fileSendList, QList<FileData> delet
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
if(getIsSendStopped()) return;
|
||||
if(isSendStopped) return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
emit sigLoadHash();
|
||||
|
||||
sendPacketType(PacketType::TYPE_FINISH);
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
static const QString staticDataFolderName = "StaticData";
|
||||
static const QString applicationFolderName = "Application";
|
||||
static const QString sharedDataFolderName = "SharedData";
|
||||
static const QString additionalFilesFolderName = "AdditionalFiles";
|
||||
static const QString additionalFilesFolderName = "RRJ-95NEW-100";
|
||||
static const QString streamingAssetsFolderName = "StreamingAssets";
|
||||
static const QString versionFolderName = "StreamingVersion";
|
||||
static const QString tempFile = staticDataFolderName + "/save.xml";
|
||||
static const QString version = staticDataFolderName + "/version.xml";
|
||||
static const QString versionListFile = staticDataFolderName + "/versionList.xml";
|
||||
@@ -25,10 +26,12 @@ static const QString buildHashName = staticDataFolderName + "/buildHash.xml";
|
||||
static const QString buildDataPath = "/Application/RRJLoader/RRJ_Data/";
|
||||
static const QString tasksAMMfileName = "/tasksAmm.xml";
|
||||
static const QString tasksFIMfileName = "/tasksFIM.xml";
|
||||
static const QString clientHash = staticDataFolderName + "/clientHash.xml";
|
||||
|
||||
static const QString baseNameVersion = "base";//может вынести комманды куда нибудь?
|
||||
|
||||
static const QString commandTryBaseDelete = "BASEDELETETRY";
|
||||
static const QString commandTryBaseChange = "TRYBASECHANGE";
|
||||
static const QString commandTryActiveDelete = "TRYACTIVEDELETE";
|
||||
static const QString commandTryCopyWithSameNames = "SAMENAMES";
|
||||
static const QString commandGetServerDataList = "GETSERVERDATALIST";
|
||||
@@ -37,6 +40,9 @@ static const QString commandReadyClient = "READY";
|
||||
static const QString commandDisableClient = "DISABLE";
|
||||
static const QString commandDuplicateVerName = "DUPLICATEVERNAME";
|
||||
static const QString commandHashCompleteClient = "HASHSENDCOMPLETE";
|
||||
static const QString commandCanChangeVersion = "CANCHANGE";
|
||||
static const QString commandChangable = "CHANGEABLE";
|
||||
static const QString commandUnchangable = "UNCHANGEABLE";
|
||||
static const QString commandUpdateFilesClient = "update";
|
||||
|
||||
class Tools {
|
||||
|
||||
@@ -41,16 +41,18 @@ void UpdateController::changeAssetVersion(QString versionName)
|
||||
commonClientHandler->slot_sendPacketToAllClients(PacketType::FREE);
|
||||
}
|
||||
|
||||
void UpdateController::createCopyVersion(QString versionName,QString newVersionName)
|
||||
void UpdateController::createCopyVersion(QString versionName,QString newVersionName,QString author)
|
||||
{
|
||||
commonClientHandler->slot_sendPacketToAllClients(PacketType::BUSY);
|
||||
assetManager->createCopyVersion(versionName,newVersionName);
|
||||
assetManager->createCopyVersion(versionName,newVersionName,author);
|
||||
commonClientHandler->slot_sendPacketToAllClients(PacketType::FREE);
|
||||
}
|
||||
|
||||
void UpdateController::deleteAssetVersion(QString versionName)
|
||||
{
|
||||
commonClientHandler->slot_sendPacketToAllClients(PacketType::BUSY);
|
||||
assetManager->deleteVersion(versionName);
|
||||
commonClientHandler->slot_sendPacketToAllClients(PacketType::FREE);
|
||||
}
|
||||
|
||||
void UpdateController::compareFiles(ClientHandler* handler, QByteArray array)
|
||||
@@ -59,7 +61,6 @@ void UpdateController::compareFiles(ClientHandler* handler, QByteArray array)
|
||||
loadHash();
|
||||
clientDataList.clear();
|
||||
xmlFileDataParse(array);
|
||||
clientDataList.append(*datas);
|
||||
checkNeedUpdate(handler);
|
||||
mutex->unlock();
|
||||
}
|
||||
@@ -182,8 +183,6 @@ QString UpdateController::getCommands()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void UpdateController::setUpCurrentServerHash()
|
||||
{
|
||||
QList<FileData> *fileList = new QList<FileData>;
|
||||
@@ -296,61 +295,69 @@ QList<FileData>* UpdateController::calculateHash(QString path)
|
||||
{
|
||||
serverDataList.clear();
|
||||
|
||||
QDirIterator iterator(path,QDirIterator::Subdirectories);
|
||||
if(!QDir(path).exists()){
|
||||
QDir().mkdir(path);
|
||||
}
|
||||
|
||||
QDir dir(path);
|
||||
dir.setFilter(QDir::NoDotAndDotDot);
|
||||
QString hashString;
|
||||
QStringList filter;
|
||||
filter << "*";
|
||||
QList<FileData> *files = new QList<FileData>;
|
||||
|
||||
while (iterator.hasNext())
|
||||
QDirIterator dirIterator(path,filter, QDir::AllEntries | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
|
||||
while (dirIterator.hasNext())
|
||||
{
|
||||
iterator.next();
|
||||
QFileInfo fileInfo = iterator.fileInfo();
|
||||
QFileInfo fileInfo(dirIterator.next());
|
||||
FileData currentFile;
|
||||
QFile file(fileInfo.absoluteFilePath());
|
||||
|
||||
quint64 fileSize = file.size();
|
||||
const quint64 bufferSize = 10240;
|
||||
|
||||
if (fileInfo.isHidden()) continue;
|
||||
|
||||
if(fileInfo.isFile() && file.open(QIODevice::ReadOnly) && !fileInfo.fileName().contains(".meta"))
|
||||
if(fileInfo.isDir() && !fileInfo.fileName().startsWith(".") && fileInfo.fileName() != "RRJLoader")
|
||||
{
|
||||
char buffer[bufferSize];
|
||||
int bytesRead;
|
||||
int readSize = qMin(fileSize,bufferSize);
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Md5);
|
||||
while(readSize > 0 && (bytesRead = file.read(buffer,readSize)) > 0){
|
||||
fileSize -= bytesRead;
|
||||
hash.addData(buffer,bytesRead);
|
||||
readSize = qMin(fileSize,bufferSize);
|
||||
}
|
||||
|
||||
hashString = QString(hash.result().toHex());
|
||||
currentFile.hash = hashString;
|
||||
currentFile.path = Tools::createLocalPath(fileInfo.absoluteFilePath());
|
||||
|
||||
files->push_back(currentFile);
|
||||
file.close();
|
||||
|
||||
}
|
||||
else if(fileInfo.isDir() && fileInfo.fileName() != ".." && !fileInfo.isRoot())
|
||||
{
|
||||
currentFile.hash = "FOLDER";
|
||||
currentFile.path = Tools::createLocalPath(fileInfo.path());
|
||||
|
||||
if(!files->contains(currentFile)){
|
||||
if(!files->contains(currentFile))
|
||||
{
|
||||
files->push_back(currentFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(files->begin(),files->end());
|
||||
QDirIterator fileIterator(path,filter,QDir::Files | QDir::NoDotAndDotDot,QDirIterator::Subdirectories);
|
||||
|
||||
while (fileIterator.hasNext())
|
||||
{
|
||||
fileIterator.next();
|
||||
QFileInfo fileInfo = fileIterator.fileInfo();
|
||||
FileData currentFile;
|
||||
QFile file(fileInfo.absoluteFilePath());
|
||||
|
||||
quint64 fileSize = file.size(); //буффер для хэширования крупных файлов
|
||||
const quint64 bufferSize = 10240;
|
||||
|
||||
if(fileInfo.isHidden()) continue;
|
||||
|
||||
if(fileInfo.isFile() && file.open(QIODevice::ReadOnly) && !fileInfo.fileName().contains(".meta"))
|
||||
{
|
||||
char buffer[bufferSize];
|
||||
int bytesRead;
|
||||
int readSize = qMin(fileSize,bufferSize);
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Md5);
|
||||
|
||||
while(readSize > 0 && (bytesRead = file.read(buffer,readSize)) > 0)
|
||||
{
|
||||
fileSize -= bytesRead;
|
||||
hash.addData(buffer,bytesRead);
|
||||
readSize = qMin(fileSize,bufferSize);
|
||||
}
|
||||
|
||||
hashString = QString(hash.result().toHex());
|
||||
currentFile.path = Tools::createLocalPath(fileInfo.absoluteFilePath());
|
||||
currentFile.hash = hashString;
|
||||
files->push_back(currentFile);
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
serverDataList.append(*files);
|
||||
return files;
|
||||
}
|
||||
@@ -404,6 +411,12 @@ void UpdateController::CalculateSizeToSend(QList<FileData> diffList)
|
||||
void UpdateController::calculateSharedHash()
|
||||
{
|
||||
QDir sharedDir(sharedDataPath);
|
||||
|
||||
if(!QDir(sharedDataPath).exists())
|
||||
{
|
||||
QDir().mkdir(sharedDataPath);
|
||||
}
|
||||
|
||||
QDirIterator dirIterator(sharedDir);
|
||||
QList<FileData> *fileList = new QList<FileData>;
|
||||
QList<StreamingVersionData*> *versionList = new QList<StreamingVersionData*>;
|
||||
@@ -424,74 +437,24 @@ void UpdateController::calculateSharedHash()
|
||||
fileInfo.absoluteFilePath(),fileInfo.fileName(),
|
||||
fileInfo.birthTime(),fileInfo.size());
|
||||
|
||||
// if(fileInfo.fileName() == baseNameVersion)
|
||||
// {
|
||||
// version->setIsChangeable(false);
|
||||
// version->setAuthor(tr("Константа-дизайн"));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// version->setIsChangeable(true);
|
||||
// }
|
||||
|
||||
versionList->append(version);
|
||||
|
||||
}
|
||||
|
||||
createVersionListXmlAnswer(*versionList);
|
||||
assetManager->setVersionList(versionList);
|
||||
assetManager->createFirstVersionListXML(*versionList);
|
||||
//assetManager->setVersionList(versionList);
|
||||
}
|
||||
|
||||
void UpdateController::createVersionListXmlAnswer(QList<StreamingVersionData *> version) //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
foreach(StreamingVersionData* ver,version)
|
||||
{
|
||||
SAttribute attribute1 = {"Version", ver->getViewName()};
|
||||
SAttribute attribute2 = {"Created", ver->getCreateData().toString()};
|
||||
|
||||
QList<SAttribute> listAttr = {attribute1, attribute2};
|
||||
SXmlAnswerTag tag = {"VersionData", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
}
|
||||
|
||||
|
||||
QFile file(versionListFile);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("VersionList");
|
||||
|
||||
foreach(SXmlAnswerTag tag,listTag)
|
||||
{
|
||||
xmlWriter.writeStartElement(tag.elementName);
|
||||
|
||||
foreach(SAttribute attribute,tag.attr)
|
||||
{
|
||||
xmlWriter.writeAttribute(attribute.name,attribute.value);
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
file.close();
|
||||
}
|
||||
void UpdateController::saveVersionToFile(StreamingVersionData *streamingVersion) //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
QFile file(version);
|
||||
file.open(QFile::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
|
||||
xmlWriter.writeStartElement("VersionData");
|
||||
xmlWriter.writeAttribute("Version",streamingVersion->getViewName());
|
||||
xmlWriter.writeAttribute("Created",streamingVersion->getCreateData().toString());
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
void UpdateController::sendNewVersionList()
|
||||
{
|
||||
commonClientHandler->sendNewVersionListToAllClient();
|
||||
@@ -505,7 +468,6 @@ bool UpdateController::checkDuplicate(QString versionName)
|
||||
void UpdateController::xmlFileDataParse(QByteArray array)
|
||||
{
|
||||
QXmlStreamReader xmlReader(array);
|
||||
datas = new QList<FileData>;
|
||||
xmlReader.readNext();
|
||||
|
||||
//Крутимся в цикле до тех пор, пока не достигнем конца документа
|
||||
@@ -529,7 +491,7 @@ void UpdateController::xmlFileDataParse(QByteArray array)
|
||||
data.hash = value;
|
||||
}
|
||||
|
||||
datas->append(data);
|
||||
clientDataList.append(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,6 +499,11 @@ void UpdateController::xmlFileDataParse(QByteArray array)
|
||||
}
|
||||
}
|
||||
|
||||
StreamingVersionData* UpdateController::getCurrentVersion()
|
||||
{
|
||||
return assetManager->getCurrentVersionData();
|
||||
}
|
||||
|
||||
void UpdateController::printFileList(QList<FileData> fileData)
|
||||
{
|
||||
QListIterator<FileData> iterator(fileData);
|
||||
@@ -571,11 +538,6 @@ DataInfo *UpdateController::getCurrentDataInfo()
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
QList<FileData> *UpdateController::getDatas() const
|
||||
{
|
||||
return datas;
|
||||
}
|
||||
|
||||
void UpdateController::clearCurrentDataInfo()
|
||||
{
|
||||
delete dataInfo;
|
||||
|
||||
@@ -51,16 +51,13 @@ public:
|
||||
|
||||
DataInfo *getCurrentDataInfo();
|
||||
void clearCurrentDataInfo();
|
||||
QList<FileData> *getDatas() const;
|
||||
void createVersionListXmlAnswer(QList<StreamingVersionData *> version);
|
||||
void saveVersionToFile(StreamingVersionData *streamingVersion);
|
||||
void xmlFileDataParse(QByteArray array);
|
||||
|
||||
QString getPathAdditionalFile(QString name);
|
||||
|
||||
public slots:
|
||||
void changeAssetVersion(QString versionName);
|
||||
void createCopyVersion(QString versionName,QString newVersionName);
|
||||
void createCopyVersion(QString versionName,QString newVersionName,QString author);
|
||||
void deleteAssetVersion(QString versionName);
|
||||
void setUpCurrentServerHash();
|
||||
|
||||
@@ -74,7 +71,6 @@ private:
|
||||
QList<FileData> fileSendList;
|
||||
QList<FileData> fileDeleteList;
|
||||
|
||||
QList<FileData> *datas;
|
||||
DataInfo *dataInfo;
|
||||
|
||||
QString buildPath;
|
||||
|
||||
@@ -54,6 +54,7 @@ void ClientHandler::initialize(int descriptor,ServerLMSWidget *serverWidget,
|
||||
connect(this,&ClientHandler::sigSocketClose,sendSystem,&SendSystem::socketClose,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSocketFlush,sendSystem,&SendSystem::socketFlush,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSendPacketType,sendSystem,&SendSystem::sendPacketType,Qt::AutoConnection);
|
||||
connect(this,&ClientHandler::sigSendStop,sendSystem,&SendSystem::sendStop,Qt::DirectConnection);
|
||||
|
||||
connect(socket,&QTcpSocket::readyRead,recognizeSystem,&RecognizeSystem::recognize,Qt::AutoConnection);
|
||||
connect(socket, &QTcpSocket::disconnected, this, &ClientHandler::sendDisable,Qt::AutoConnection);
|
||||
@@ -134,8 +135,10 @@ void ClientHandler::sendNeedUpdate(bool flag, quint64 size, quint64 fileCount,qu
|
||||
|
||||
void ClientHandler::sendDisable()
|
||||
{
|
||||
thread->exit();
|
||||
thread->wait();
|
||||
// thread->exit();
|
||||
// thread->wait();
|
||||
thread->quit();
|
||||
emit sigSendStop();
|
||||
emit sigClientDisconnected(client->getAddress(),client->getPort());
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ signals:
|
||||
bool sigSocketFlush();
|
||||
void sigSendVersion();
|
||||
void sigSendPacketType(PacketType packetType);
|
||||
void sigSendStop();
|
||||
|
||||
public :
|
||||
QThread *thread;
|
||||
|
||||
@@ -8,7 +8,7 @@ MultiThreadServer::MultiThreadServer(ServerLMSWidget *widget,UpdateController *u
|
||||
dataParser(dataParser),
|
||||
logger(logger)
|
||||
{
|
||||
|
||||
connect(this,&MultiThreadServer::sigSendToLogger,logger,&Logger::addTextToLogger);
|
||||
}
|
||||
|
||||
void MultiThreadServer::incomingConnection(qintptr socketDesriptor)
|
||||
@@ -16,14 +16,14 @@ void MultiThreadServer::incomingConnection(qintptr socketDesriptor)
|
||||
ClientHandler* newClient = new ClientHandler;
|
||||
|
||||
connect(this,&MultiThreadServer::sigInitClient,newClient,&ClientHandler::initialize,Qt::AutoConnection);
|
||||
connect(newClient,&ClientHandler::sigClientDisconnected,this,&MultiThreadServer::slotDisconnectClient,Qt::QueuedConnection);
|
||||
connect(newClient,&ClientHandler::sigClientDisconnected,this,&MultiThreadServer::slotDisconnectClient,Qt::AutoConnection);
|
||||
|
||||
emit sigInitClient(socketDesriptor,serverLmsWidget,updateController,dataParser,logger);
|
||||
disconnect(this,&MultiThreadServer::sigInitClient,newClient,&ClientHandler::initialize);
|
||||
|
||||
serverLmsWidget->addClient(socketDesriptor,newClient);
|
||||
|
||||
logger->addTextToLogger("To Client: " + QString(SERVER_HELLO));
|
||||
emit sigSendToLogger("To Client: " + QString(SERVER_HELLO));
|
||||
}
|
||||
|
||||
void MultiThreadServer::slotDisconnectClient(QString peerAddress, QString peerPort)
|
||||
@@ -53,8 +53,7 @@ void MultiThreadServer::slotDisconnectClient(QString peerAddress, QString peerPo
|
||||
}
|
||||
|
||||
emit signalStopSendFile();
|
||||
|
||||
logger->addTextToLogger("SERVER: Client " + login + " disconnected");
|
||||
emit sigSendToLogger("SERVER: Client " + login + " disconnected");
|
||||
|
||||
serverLmsWidget->slotUpdateListClients();
|
||||
serverLmsWidget->autorizationHandler(login);
|
||||
|
||||
@@ -18,6 +18,7 @@ signals:
|
||||
void sigInitClient(int descriptor, ServerLMSWidget *serverWidget,
|
||||
UpdateController *updateController, DataParser *dataParser,Logger *logger);
|
||||
void signalStopSendFile();
|
||||
void sigSendToLogger(QString text);
|
||||
|
||||
public slots:
|
||||
void slotDisconnectClient(QString peerAddress, QString peerPort);
|
||||
|
||||
@@ -14,7 +14,7 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
tcpServer(nullptr),
|
||||
hostPort(6000),
|
||||
stateServer(stoped),
|
||||
stateBlockAutorization(blocked),
|
||||
stateBlockAutorization(unblocked),
|
||||
updateThread(nullptr),
|
||||
loggerThread(nullptr),
|
||||
dataParser(nullptr),
|
||||
@@ -44,11 +44,13 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
loggerThread = new QThread;
|
||||
|
||||
providerDBLMS = new ProviderDBLMS(this);
|
||||
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, this, &ServerLMSWidget::slot_BlockAutorization);
|
||||
providerDBLMS->ConnectionToDB();
|
||||
|
||||
logger = new Logger(ui->listWidgetLogger);
|
||||
connect(logger,&Logger::sigSendTextToLogger,this,&ServerLMSWidget::slotAddToLog,Qt::QueuedConnection);
|
||||
|
||||
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, this, &ServerLMSWidget::slot_BlockAutorization);
|
||||
connect(logger,&Logger::sigSendTextToLogger,this,&ServerLMSWidget::slotAddToLog,Qt::AutoConnection);
|
||||
|
||||
logger->moveToThread(loggerThread);
|
||||
|
||||
assetsManager = new AssetsManager;
|
||||
@@ -68,7 +70,7 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
updateThread->start();
|
||||
|
||||
commonClientHandler->initialize(&clientsMap,processingSystem,dataParser,logger);
|
||||
processingSystem->initialize(this,dataParser,commonClientHandler,logger);
|
||||
processingSystem->initialize(this,dataParser,commonClientHandler,logger,updateController);
|
||||
|
||||
logger->setTypeLog("widget");
|
||||
|
||||
@@ -194,7 +196,7 @@ void ServerLMSWidget::slotUpdateListClients()
|
||||
}
|
||||
|
||||
int countClients = clientsMap.count();
|
||||
logger->addTextToLogger("SERVER: countClients = " + QString::number(countClients));
|
||||
emit sigLog("SERVER: countClients = " + QString::number(countClients));
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_BlockAutorization(bool block)
|
||||
@@ -244,7 +246,6 @@ void ServerLMSWidget::on_btnStartServer_clicked()
|
||||
if(startServer())
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
emit sigCalculateFullHash();
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
ui->btnStartServer->setEnabled(false);
|
||||
|
||||
Reference in New Issue
Block a user