diff --git a/Core/UpdateController.cpp b/Core/UpdateController.cpp index 78a63ab..5222be2 100644 --- a/Core/UpdateController.cpp +++ b/Core/UpdateController.cpp @@ -4,7 +4,7 @@ UpdateController::UpdateController(DataParser *parser, QObject *parent) : QObject(parent) { this->dataParser = parser; - localPath = QDir::currentPath() + "/Application"; + localPath = QDir::currentPath() + applicationFolderName; } @@ -18,8 +18,8 @@ void UpdateController::calculateHash() QList *files = new QList; QList * folders = new QList; - if(!QDir("Application").exists()){ //проверка на наличие папки - QDir().mkdir("Application"); + if(!QDir(applicationFolderName).exists()){ //проверка на наличие папки + QDir().mkdir(applicationFolderName); } QDir dir(localPath); diff --git a/Core/dataparser.cpp b/Core/dataparser.cpp index d18378c..749b754 100644 --- a/Core/dataparser.cpp +++ b/Core/dataparser.cpp @@ -8,8 +8,8 @@ DataParser::DataParser(QObject *parent) : QObject(parent) { - if(!QDir("StaticData").exists()){ - QDir().mkdir("StaticData"); + if(!QDir(staticDataFolderName).exists()){ + QDir().mkdir(staticDataFolderName); } } @@ -217,7 +217,7 @@ void DataParser::saveClientSettrings(QString language, bool isAutoStart) QByteArray DataParser::xmlAnswer(QList listTag, QString elemUp1, QString elemUp2) { /* Открываем файл для Записи*/ - QFile file("save.xml"); + QFile file(tempName); file.open(QIODevice::WriteOnly); /* Создаем объект, с помощью которого осуществляется запись в файл */ @@ -259,7 +259,7 @@ QByteArray DataParser::xmlAnswer(QList listTag, QString elemUp1, QByteArray array; /* Открываем файл для Чтения*/ - QFile fileR("save.xml"); + QFile fileR(tempName); if (!fileR.open(QFile::ReadOnly | QFile::Text)) { QString str = "Не удалось открыть файл"; diff --git a/Core/externalexecuter.cpp b/Core/externalexecuter.cpp index 75f136e..97d5d9d 100644 --- a/Core/externalexecuter.cpp +++ b/Core/externalexecuter.cpp @@ -26,13 +26,13 @@ void ExternalExecuter::callApp() bool ExternalExecuter::findApp() { - QString localPath = QDir::currentPath() + "/Application"; + QString localPath = QDir::currentPath() + applicationFolderName; QDirIterator iterator(localPath,QDirIterator::Subdirectories); while(iterator.hasNext()){ iterator.next(); - if(iterator.fileInfo().fileName() == "RRJ.exe"){ + if(iterator.fileInfo().fileName() == applicationEXEName){ programPath = iterator.fileInfo().absoluteFilePath(); return true; } diff --git a/Core/externalexecuter.h b/Core/externalexecuter.h index 3625a8e..1bd898e 100644 --- a/Core/externalexecuter.h +++ b/Core/externalexecuter.h @@ -7,6 +7,7 @@ #include #include #include +#include "tools.h" class ExternalExecuter : public QObject { diff --git a/Core/tcpclient.cpp b/Core/tcpclient.cpp index c144306..a03373f 100644 --- a/Core/tcpclient.cpp +++ b/Core/tcpclient.cpp @@ -15,7 +15,7 @@ void TCPClient::initialize(RecognizeSystem *recognize,ExternalExecuter *external this->recognizeSystem = recognize; this->externalExecuter = externalExecuter; - emit sigSendDebugLog(Tools::GetTime() + " Client started"); + emit sigSendDebugLog(Tools::getTime() + " Client started"); } void TCPClient::setConnect(ServerSettings *serverSettings) @@ -88,7 +88,7 @@ void TCPClient::sendFile() countSend++; } - qDebug() << Tools::GetTime() << "count end Final: " << countSend; + qDebug() << Tools::getTime() << "count end Final: " << countSend; } file.close(); @@ -113,15 +113,15 @@ void TCPClient::setDisconnect() void TCPClient::sendDisable() { - QDataStream stream(socket); - stream.setVersion(QDataStream::Qt_DefaultCompiledVersion); +// QDataStream stream(socket); +// stream.setVersion(QDataStream::Qt_DefaultCompiledVersion); - QByteArray data; - data = emit sigGetXmlAnswer("END"); +// QByteArray data; +// data = emit sigGetXmlAnswer("END"); - stream << PacketType::TYPE_XMLANSWER; - stream << data; - socket->waitForBytesWritten(); +// stream << PacketType::TYPE_XMLANSWER; +// stream << data; +// socket->waitForBytesWritten(); } void TCPClient::waitRead(int time) @@ -149,7 +149,7 @@ void TCPClient::slotMessageEntered(QString message) socket->waitForBytesWritten(); sendFile(); - emit sigSendDebugLog(Tools::GetTime() + " Local checkFile sended"); + emit sigSendDebugLog(Tools::getTime() + " Local checkFile sended"); socket->waitForReadyRead(1000); } diff --git a/Core/tools.h b/Core/tools.h index d0238a1..3609ded 100644 --- a/Core/tools.h +++ b/Core/tools.h @@ -7,11 +7,14 @@ #define TCP_READ_TIMEOUT 1000 -static QString hashFilename = "StaticData/hash.xml"; -static QString settingsName = "StaticData/settings.xml"; -static QString tempName = "StaticData/temp.xml"; -static QString authTempName = "StaticData/authData.xml"; -static QString displayTemp = "StaticData/displayData.xml"; +static QString applicationEXEName = "RRJ.exe"; +static QString applicationFolderName = "/Application"; +static QString staticDataFolderName = "StaticData"; +static QString hashFilename = staticDataFolderName + "/hash.xml"; +static QString settingsName = staticDataFolderName + "/settings.xml"; +static QString tempName = staticDataFolderName + "/temp.xml"; +static QString authTempName = staticDataFolderName + "/authData.xml"; +static QString displayTemp = staticDataFolderName + "/displayData.xml"; enum PacketType{ TYPE_NONE = 0, diff --git a/RRJClient.pro.user b/RRJClient.pro.user index 2a80afc..299070f 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -67,7 +67,7 @@ Desktop Qt 5.14.2 MinGW 64-bit Desktop Qt 5.14.2 MinGW 64-bit qt.qt5.5142.win64_mingw73_kit - 0 + 1 0 0 @@ -299,7 +299,7 @@ false true - E:/Projects/QT/GUIProj/RRJClient/RRJClient + E:/Projects/QT/GUIProj/RRJClient/Deploy 1 diff --git a/StaticData/hash.xml b/StaticData/hash.xml index fbbd1a6..5c55dab 100644 --- a/StaticData/hash.xml +++ b/StaticData/hash.xml @@ -1,32 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StaticData/settings.xml b/StaticData/settings.xml index 87e3d5f..e8b58bd 100644 --- a/StaticData/settings.xml +++ b/StaticData/settings.xml @@ -1,4 +1,4 @@ - + diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index 66f7dcc..33396dd 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/UpdateController.o b/debug/UpdateController.o index dfc13fd..ecfcb4d 100644 Binary files a/debug/UpdateController.o and b/debug/UpdateController.o differ diff --git a/debug/recognizesystem.o b/debug/recognizesystem.o index 3f26690..826a3b7 100644 Binary files a/debug/recognizesystem.o and b/debug/recognizesystem.o differ diff --git a/debug/tcpclient.o b/debug/tcpclient.o index 08613fc..b64f36f 100644 Binary files a/debug/tcpclient.o and b/debug/tcpclient.o differ diff --git a/debug/tools.o b/debug/tools.o index 75cb9e3..fafb9c5 100644 Binary files a/debug/tools.o and b/debug/tools.o differ