mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
ref: start refactoring
This commit is contained in:
@@ -224,23 +224,6 @@ void DataParser::xmlParser(ClientHandler *client, QByteArray array)
|
||||
|
||||
processingSystem->processingClientNotify(client, clientNotify);
|
||||
}
|
||||
else if(xmlReader.name() == "DataInfo")
|
||||
{
|
||||
dataInfo = new DataInfo;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "path")
|
||||
dataInfo->path= value.toUtf8();
|
||||
|
||||
if(name == "size")
|
||||
dataInfo->size = value.toLong();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
emit sigLogMessage("XmlParser: unrecognized tag");
|
||||
@@ -255,7 +238,7 @@ void DataParser::xmlFileDataParse(QByteArray array)
|
||||
{
|
||||
QXmlStreamReader xmlReader(array);
|
||||
datas = new QList<FileData>;
|
||||
xmlReader.readNext(); // Переходим к первому элементу в файле
|
||||
xmlReader.readNext();
|
||||
|
||||
//Крутимся в цикле до тех пор, пока не достигнем конца документа
|
||||
while(!xmlReader.atEnd())
|
||||
@@ -591,7 +574,7 @@ QByteArray DataParser::xmlAnswer_currentVersion()
|
||||
return array;
|
||||
}
|
||||
|
||||
void DataParser::createVersionListXmlAnswer(QList<StreamingVersionData *> version)
|
||||
void DataParser::createVersionListXmlAnswer(QList<StreamingVersionData *> version) //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
@@ -632,7 +615,7 @@ void DataParser::createVersionListXmlAnswer(QList<StreamingVersionData *> versio
|
||||
file.close();
|
||||
}
|
||||
|
||||
QByteArray DataParser::readTempFile()
|
||||
QByteArray DataParser::readTempFile() //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
QByteArray array;
|
||||
QFile fileR(tempFile);
|
||||
@@ -644,13 +627,13 @@ QByteArray DataParser::readTempFile()
|
||||
else
|
||||
{
|
||||
array = fileR.readAll();
|
||||
fileR.close(); // Закрываем файл
|
||||
fileR.close();
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
void DataParser::saveVersionToFile(StreamingVersionData *streamingVersion)
|
||||
void DataParser::saveVersionToFile(StreamingVersionData *streamingVersion) //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
QFile file(version);
|
||||
file.open(QFile::WriteOnly);
|
||||
@@ -669,17 +652,17 @@ void DataParser::saveVersionToFile(StreamingVersionData *streamingVersion)
|
||||
file.close();
|
||||
}
|
||||
|
||||
DataInfo *DataParser::getCurrentDataInfo()
|
||||
DataInfo *DataParser::getCurrentDataInfo() //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
void DataParser::clearCurrentDataInfo()
|
||||
void DataParser::clearCurrentDataInfo() //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
delete dataInfo;
|
||||
}
|
||||
|
||||
QList<FileData> *DataParser::getDatas() const
|
||||
QList<FileData> *DataParser::getDatas() const //TODO: переименовать и перебросить в AssetManager
|
||||
{
|
||||
return datas;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
|
||||
{
|
||||
QByteArray arrayAnswer;
|
||||
|
||||
qDebug() << "ProcessingQueryThread " << QThread::currentThreadId();
|
||||
switch (clientQueryToDB.typeQuery)
|
||||
{
|
||||
case TypeQueryToDB::TYPE_QUERY_GET_ALL_LISTS:
|
||||
|
||||
@@ -27,7 +27,6 @@ void SendSystem::setClient(Client *client,QTcpSocket *socket)
|
||||
isSendStopped = false;
|
||||
}
|
||||
|
||||
|
||||
void SendSystem::sendMessageBlock(QString message)
|
||||
{
|
||||
auto messageBlock = emit sigSendXMLmessage(message);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "providerdblms.h"
|
||||
|
||||
#include <QThread>
|
||||
|
||||
ProviderDBLMS::ProviderDBLMS(QWidget *parentWidget, QObject *parent) :
|
||||
QObject(parent),
|
||||
dbLMS(nullptr)
|
||||
@@ -202,7 +204,7 @@ QString ProviderDBLMS::getNameInstructorByLogin(QString login)
|
||||
QList<Instructor> ProviderDBLMS::GetListAllInstructors()
|
||||
{
|
||||
QList<Instructor> listInstructors;
|
||||
|
||||
qDebug() << "ProviderDBLMS " << QThread::currentThreadId();
|
||||
mtxAccess.lock();
|
||||
|
||||
if(! dbLMS->DBisConnected())
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define PROVIDERDBLMS_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include "interfacedatabaselms.h"
|
||||
|
||||
class ProviderDBLMS : public QObject
|
||||
|
||||
@@ -80,7 +80,7 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
on_btnStartServer_clicked();
|
||||
|
||||
first = true;
|
||||
qDebug() << "WidgetThread: " << QThread::currentThreadId();
|
||||
qDebug() << "MAIN THREAD: " << QThread::currentThreadId();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::autorizationHandler(QString login)
|
||||
@@ -97,7 +97,7 @@ void ServerLMSWidget::autorizationHandler(QString login)
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::sendNewVersionListToAllClient()
|
||||
void ServerLMSWidget::sendNewVersionListToAllClient() //Выделить в сервис отправки сервера(не конкретный клиент)
|
||||
{
|
||||
foreach(int idSocket,clientsMap.keys())
|
||||
{
|
||||
@@ -109,7 +109,7 @@ void ServerLMSWidget::sendNewVersionListToAllClient()
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::sendCurrentVersionToAllClient()
|
||||
void ServerLMSWidget::sendCurrentVersionToAllClient() //Выделить в сервис отправки сервера(не конкретный клиент)
|
||||
{
|
||||
foreach(int idSocket,clientsMap.keys())
|
||||
{
|
||||
@@ -226,7 +226,7 @@ void ServerLMSWidget::slot_BlockAutorization(bool block)
|
||||
unBlockAutorization();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_AuthChanged()
|
||||
void ServerLMSWidget::slot_AuthChanged() //Выделить в сервис отправки сервера(не конкретный клиент)
|
||||
{
|
||||
//Проходим все открытые сокеты
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
@@ -241,7 +241,7 @@ void ServerLMSWidget::slot_AuthChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_sendPacketToAllClients(PacketType packetType)
|
||||
void ServerLMSWidget::slot_sendPacketToAllClients(PacketType packetType) //Выделить в сервис отправки сервера(не конкретный клиент)
|
||||
{
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
{
|
||||
@@ -272,7 +272,7 @@ void ServerLMSWidget::slot_LanguageChanged(QString language)
|
||||
}
|
||||
|
||||
|
||||
void ServerLMSWidget::slot_msgToClientFromGUI(QString login, QString text)
|
||||
void ServerLMSWidget::slot_msgToClientFromGUI(QString login, QString text) //Выделить в сервис отправки сервера(не конкретный клиент)
|
||||
{
|
||||
QString textMsg = text;
|
||||
|
||||
@@ -298,7 +298,7 @@ void ServerLMSWidget::slot_msgToClientFromGUI(QString login, QString text)
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_msgToGUIfromClient(QString login, QString text)
|
||||
void ServerLMSWidget::slot_msgToGUIfromClient(QString login, QString text) //Выделить в сервис отправки сервера(не конкретный клиент)
|
||||
{
|
||||
QString textMsg = text;
|
||||
|
||||
@@ -355,7 +355,7 @@ void ServerLMSWidget::on_btnStopServer_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::on_btnTaskSet_clicked()
|
||||
void ServerLMSWidget::on_btnTaskSet_clicked() //Выделить в сервис отправки сервера(не конкретный клиент)
|
||||
{
|
||||
QString fullNameClient = ui->listWidget_Clients->currentItem()->text();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user