mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: before threading
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
#include "Core/dataparser.h"
|
||||
|
||||
#include "FileData.h"
|
||||
#include "dataparser.h"
|
||||
#include "tools.h"
|
||||
|
||||
DataParser::DataParser(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DataParser::DataParser()
|
||||
DataParser::~DataParser()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -38,6 +43,8 @@ void DataParser::CreateXML(QList<FileData> fileDataList)
|
||||
|
||||
void DataParser::CreateAuthMessage(ClientAutorization *auth)
|
||||
{
|
||||
authPassCache = auth; //кэширование даных авторизации, для сохранения при успешном заходе
|
||||
|
||||
QFile file(tempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
@@ -68,9 +75,10 @@ void DataParser::CreateServerSettings(QString address, QString port)
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("ServerSettingsContainer");
|
||||
|
||||
xmlWriter.writeStartElement("ServerSettingsContainer");
|
||||
xmlWriter.writeStartElement("ServerSettings");
|
||||
|
||||
xmlWriter.writeAttribute("Address",address);
|
||||
xmlWriter.writeAttribute("Port",port);
|
||||
|
||||
@@ -83,6 +91,27 @@ void DataParser::CreateServerSettings(QString address, QString port)
|
||||
|
||||
}
|
||||
|
||||
void DataParser::CreateAuthData(ServerAuthorization *serverAuth)
|
||||
{
|
||||
QFile file(authTempName);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
|
||||
QXmlStreamWriter xmlWriter(&file);
|
||||
|
||||
xmlWriter.setAutoFormatting(true);
|
||||
xmlWriter.writeStartDocument();
|
||||
xmlWriter.writeStartElement("AuthData");
|
||||
xmlWriter.writeAttribute("Login",authPassCache->Login);
|
||||
xmlWriter.writeAttribute("Password",authPassCache->Password);
|
||||
xmlWriter.writeAttribute("InstructorName",serverAuth->InstructorName);
|
||||
xmlWriter.writeAttribute("ClientName",serverAuth->ClientName);
|
||||
xmlWriter.writeAttribute("AccessType",serverAuth->AccessType);
|
||||
|
||||
xmlWriter.writeEndElement();
|
||||
file.close();
|
||||
|
||||
}
|
||||
|
||||
ServerSettings *DataParser::GetServerSettings()
|
||||
{
|
||||
ServerSettings *settings = new ServerSettings;
|
||||
@@ -102,10 +131,6 @@ ServerSettings *DataParser::GetServerSettings()
|
||||
|
||||
if(name == "Address"){
|
||||
settings->Address = value;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(name == "Port"){
|
||||
|
||||
Reference in New Issue
Block a user