From a36dfe35fb6c753d5e8ece7a9cca240d33f8d619 Mon Sep 17 00:00:00 2001 From: krivoshein Date: Thu, 3 Jul 2025 09:55:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B8=D0=BB=20=D0=B4=D0=B2=D0=B5=20=D1=84-=D0=B8=20?= =?UTF-8?q?=D0=B2=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ServerLMS/Systems/recognizesystem.cpp | 24 ++---------------------- ServerLMS/Systems/recognizesystem.h | 5 ++--- ServerLMS/Systems/tools.cpp | 18 ++++++++++++++++++ ServerLMS/Systems/tools.h | 2 ++ 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/ServerLMS/Systems/recognizesystem.cpp b/ServerLMS/Systems/recognizesystem.cpp index a864676..63971a6 100644 --- a/ServerLMS/Systems/recognizesystem.cpp +++ b/ServerLMS/Systems/recognizesystem.cpp @@ -202,7 +202,7 @@ void RecognizeSystem::recognize() continue; } - filePath = createFullPath(filePath); + filePath = Tools::createFullPath(filePath); } @@ -292,7 +292,7 @@ void RecognizeSystem::recognize() if(!stream.commitTransaction()) continue; - filePath = createFullPath(filePath); + filePath = Tools::createFullPath(filePath); socket->waitForReadyRead(100); break; } @@ -462,31 +462,11 @@ void RecognizeSystem::packetTypeInit(PacketType packet,Client *client) packetType = PacketType::TYPE_NONE; } -QString RecognizeSystem::createFullPath(QString path) -{ - QString fullPath; - qint8 pos = path.indexOf("Application"); - - QString localPath = path.remove(0,--pos); - - //qDebug() << "CLIENT: localPath" << localPath; - fullPath = QDir::currentPath() + localPath; - - return fullPath; -} - bool RecognizeSystem::checkIsChangeable() { return updateController->getCurrentVersion()->getIsChangeable(); } -bool RecognizeSystem::checkNonStaticData(QString path) -{ - if(path.contains(sharedDataFolderName)) return true; - - return false; -} - RecognizeSystem::~RecognizeSystem() { diff --git a/ServerLMS/Systems/recognizesystem.h b/ServerLMS/Systems/recognizesystem.h index a28a893..7d54af4 100644 --- a/ServerLMS/Systems/recognizesystem.h +++ b/ServerLMS/Systems/recognizesystem.h @@ -60,8 +60,7 @@ private: void packetTypeInit(PacketType packet,Client *client); void packetTypeInit(PacketType type); - QString createFullPath(QString path); - bool checkIsChangeable(); - bool checkNonStaticData(QString path); + + bool checkIsChangeable(); }; #endif // RECOGNIZESYSTEM_H diff --git a/ServerLMS/Systems/tools.cpp b/ServerLMS/Systems/tools.cpp index 70e2093..65f6131 100644 --- a/ServerLMS/Systems/tools.cpp +++ b/ServerLMS/Systems/tools.cpp @@ -91,4 +91,22 @@ QString Tools::createFolderPath(QString path) return folderPath; } +QString Tools::createFullPath(QString path) +{ + QString fullPath; + qint8 pos = path.indexOf("Application"); + QString localPath = path.remove(0,--pos); + + //qDebug() << "CLIENT: localPath" << localPath; + fullPath = QDir::currentPath() + localPath; + + return fullPath; +} + +bool Tools::checkNonStaticData(QString path) +{ + if(path.contains(sharedDataFolderName)) return true; + + return false; +} diff --git a/ServerLMS/Systems/tools.h b/ServerLMS/Systems/tools.h index 162854e..8d86925 100644 --- a/ServerLMS/Systems/tools.h +++ b/ServerLMS/Systems/tools.h @@ -59,6 +59,8 @@ public: static QString createRealPath(QString path,StreamingVersionData* currentVersionData); static QString createStreamingToRealPath(QString path, StreamingVersionData *streamingVersionData); static QString createVersionHashFilepath(QString fileName); + static QString createFullPath(QString path); + static bool checkNonStaticData(QString path); };