mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
ref: segregate systems, codestyle, busy message
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#ifndef FILEDATA_H
|
||||
#define FILEDATA_H
|
||||
|
||||
struct FileData
|
||||
{
|
||||
QString path;
|
||||
QString hash;
|
||||
|
||||
bool operator==(const FileData& other)const
|
||||
{
|
||||
if(this->path==(other.path)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator<(const FileData& data2) const
|
||||
{
|
||||
return this->hash == "FOLDER" && data2.hash !="FOLDER";
|
||||
}
|
||||
|
||||
}; //путь
|
||||
|
||||
struct SAttribute
|
||||
{
|
||||
QString name;
|
||||
QString value;
|
||||
|
||||
};
|
||||
|
||||
struct SXmlAnswerTag{
|
||||
QString elementName;
|
||||
QList<SAttribute> attr;
|
||||
};
|
||||
|
||||
#endif // FILEDATA_H
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "UpdateController.h"
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
UpdateController::UpdateController(DataParser *parser,SendSystem *sendSystem, QObject *parent) :
|
||||
QObject(parent)
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
#ifndef UPDATECONTROLLER_H
|
||||
#define UPDATECONTROLLER_H
|
||||
|
||||
|
||||
#include "Core\FileData.h"
|
||||
#include "Core\dataparser.h"
|
||||
#include "Core\tcpclient.h"
|
||||
#include "streamingversiondata.h"
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QXmlStreamAttribute>
|
||||
@@ -17,6 +12,12 @@
|
||||
#include <QDebug>
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
#include <Data\FileData.h>
|
||||
#include <Core\dataparser.h>
|
||||
#include <Core\tcpclient.h>
|
||||
#include <Data\streamingversiondata.h>
|
||||
|
||||
class SendSystem;
|
||||
class MainWindow;
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
#include "Core/dataparser.h"
|
||||
|
||||
#include "FileData.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QDomDocument>
|
||||
|
||||
DataParser::DataParser(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
#ifndef DATAPARSER_H
|
||||
#define DATAPARSER_H
|
||||
|
||||
#include "FileData.h"
|
||||
#include "recognizesystem.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <Datas.h>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QObject>
|
||||
#include <QDomDocument>
|
||||
#include <QXmlStreamWriter>
|
||||
#include <Data/FileData.h>
|
||||
#include <Data/Datas.h>
|
||||
#include <Data/FileData.h>
|
||||
#include <Core/recognizesystem.h>
|
||||
#include <Core/tools.h>
|
||||
|
||||
class RecognizeSystem;
|
||||
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
#include "externalexecuter.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
ExternalExecuter::ExternalExecuter() {}
|
||||
|
||||
|
||||
ExternalExecuter::ExternalExecuter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ExternalExecuter::~ExternalExecuter()
|
||||
{
|
||||
|
||||
}
|
||||
ExternalExecuter::~ExternalExecuter() {}
|
||||
|
||||
void ExternalExecuter::callApp()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#include <QDirIterator>
|
||||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include "tools.h"
|
||||
#include <QCoreApplication>
|
||||
#include <Core/tools.h>
|
||||
|
||||
class ExternalExecuter : public QObject
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#include "hashcomparer.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <updatenotifywidget.h>
|
||||
|
||||
|
||||
HashComparer::HashComparer(DataParser *dataParser,QObject *)
|
||||
{
|
||||
this->dataParser = dataParser;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifndef HASHCOMPARER_H
|
||||
#define HASHCOMPARER_H
|
||||
|
||||
#include "FileData.h"
|
||||
#include "dataparser.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
#include <updatenotifywidget.h>
|
||||
#include <Data/FileData.h>
|
||||
#include <Core/dataparser.h>
|
||||
#include <Core/tools.h>
|
||||
#include <Widgets/updatenotifywidget.h>
|
||||
#include <Widgets/updatenotifywidget.h>
|
||||
|
||||
class UpdateNotifyWidget;
|
||||
class VersionContainer;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#include "Core/recognizesystem.h"
|
||||
|
||||
#include "streamingversiondata.h"
|
||||
|
||||
#include <updatenotifywidget.h>
|
||||
|
||||
RecognizeSystem::RecognizeSystem(QObject *parent):
|
||||
QObject(parent)
|
||||
{
|
||||
@@ -44,6 +40,7 @@ void RecognizeSystem::initialize(UpdateController *updateController,
|
||||
connect(this,&RecognizeSystem::sigSocketWaitForReadyRead,client,&TCPClient::waitRead,Qt::DirectConnection);
|
||||
connect(this,&RecognizeSystem::sigServerBlocked,mainWindow,&MainWindow::serverBlocked);
|
||||
connect(this,&RecognizeSystem::sigShowServerList,mainWindow,&MainWindow::showServerListWidget);
|
||||
connect(this,&RecognizeSystem::sigAnimationActivated,mainWindow,&MainWindow::activateLoadingAnimation,Qt::AutoConnection);
|
||||
}
|
||||
|
||||
void RecognizeSystem::recognize(QTcpSocket *socket)
|
||||
@@ -275,6 +272,17 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
|
||||
{
|
||||
mainWindow->checkUpdate();
|
||||
}
|
||||
|
||||
if(packetType == PacketType::BUSY)
|
||||
{
|
||||
emit sigAnimationActivated(true);
|
||||
}
|
||||
|
||||
if(packetType == PacketType::FREE)
|
||||
{
|
||||
emit sigAnimationActivated(false);
|
||||
}
|
||||
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <mainwindow.h>
|
||||
#include <Core\tools.h>
|
||||
#include <Core\UpdateController.h>
|
||||
#include <Data\streamingversiondata.h>
|
||||
#include <Widgets\updatenotifywidget.h>
|
||||
|
||||
class UpdateController;
|
||||
class MainWindow;
|
||||
@@ -45,6 +47,7 @@ signals:
|
||||
void sigSocketWaitForReadyRead(int waitTime);
|
||||
void sigStartCompare();
|
||||
void sigShowServerList(QList<StreamingVersionData*> *serverDatas);
|
||||
void sigAnimationActivated(bool flag);
|
||||
|
||||
private:
|
||||
QList<QString> *folderList;
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
#include "screenchecker.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QBitmap>
|
||||
#include <QToolButton>
|
||||
#include <QPainter>
|
||||
|
||||
ScreenChecker::ScreenChecker(QWidget *mainWidget,DataParser *dataParser, QHBoxLayout *layout, QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QToolButton>
|
||||
#include <QLabel>
|
||||
#include <QBitmap>
|
||||
#include <QToolButton>
|
||||
#include <QPainter>
|
||||
|
||||
class DataParser;
|
||||
class ScreenChecker : public QObject
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
#include "sendsystem.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QThread>
|
||||
|
||||
|
||||
|
||||
SendSystem::SendSystem(QObject *)
|
||||
{
|
||||
|
||||
}
|
||||
SendSystem::SendSystem(QObject *) {}
|
||||
|
||||
void SendSystem::initialize(MainWindow *mainWindow,DataParser *dataParser)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define SENDSYSTEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QThread>
|
||||
#include <QTcpSocket>
|
||||
#include <QDataStream>
|
||||
#include <mainwindow.h>
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
#ifndef STREAMINGVERSIONDATA_H
|
||||
#define STREAMINGVERSIONDATA_H
|
||||
|
||||
#include <QObject>
|
||||
#include <qdatetime.h>
|
||||
|
||||
class StreamingVersionData
|
||||
{
|
||||
public:
|
||||
|
||||
StreamingVersionData(){}
|
||||
|
||||
StreamingVersionData(QString absoltePath,QString viewName,QDateTime data,qint32 size)
|
||||
{
|
||||
this->absolutePath = absoltePath;
|
||||
this->viewName = viewName;
|
||||
this->createData = data;
|
||||
this->size = size;
|
||||
}
|
||||
|
||||
void setName(QString viewName)
|
||||
{
|
||||
this->viewName = viewName;
|
||||
}
|
||||
|
||||
void setCreateData(QDateTime data)
|
||||
{
|
||||
this->createData = data;
|
||||
}
|
||||
|
||||
~StreamingVersionData();
|
||||
|
||||
QString getAbsolutPath() const
|
||||
{
|
||||
return absolutePath;
|
||||
}
|
||||
|
||||
QString getViewName() const
|
||||
{
|
||||
return viewName;
|
||||
}
|
||||
|
||||
QDateTime getCreateData() const
|
||||
{
|
||||
return createData;
|
||||
}
|
||||
|
||||
qint32 getSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
private:
|
||||
QString absolutePath;
|
||||
QString viewName;
|
||||
QDateTime createData;
|
||||
qint32 size;
|
||||
};
|
||||
|
||||
#endif // STREAMINGVERSIONDATA_H
|
||||
@@ -1,8 +1,4 @@
|
||||
#include "tcpclient.h"
|
||||
#include "UpdateController.h"
|
||||
#include "externalexecuter.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
TCPClient::TCPClient(QObject *parent) :
|
||||
QObject(parent)
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
#include <QDataStream>
|
||||
#include <QTcpServer>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include "Core\recognizesystem.h"
|
||||
#include "Core\tools.h"
|
||||
#include "Core\UpdateController.h"
|
||||
#include "Core\externalexecuter.h"
|
||||
#include <Core\recognizesystem.h>
|
||||
#include <Core\tools.h>
|
||||
#include <Core\UpdateController.h>
|
||||
#include <Core\externalexecuter.h>
|
||||
|
||||
|
||||
class UpdateController;
|
||||
class RecognizeSystem;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include "tools.h"
|
||||
|
||||
#include <qdir.h>
|
||||
|
||||
|
||||
void Tools::printTime()
|
||||
{
|
||||
qDebug() << QTime::currentTime().toString("hh:mm:ss");
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifndef GLOBAL_H
|
||||
#define GLOBAL_H
|
||||
|
||||
#include "streamingversiondata.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QTime>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
|
||||
#include <Data/streamingversiondata.h>
|
||||
|
||||
#define TCP_READ_TIMEOUT 2000
|
||||
|
||||
static QString applicationEXEName = "RRJ.exe";
|
||||
@@ -44,7 +45,10 @@ enum PacketType{
|
||||
HASH_READY = 150,
|
||||
CHANGE_DATA_VERSION = 151,
|
||||
COPY_VERSION = 152,
|
||||
DELETE_DATA_VERSION = 153
|
||||
DELETE_DATA_VERSION = 153,
|
||||
BUSY = 154,
|
||||
FREE = 155
|
||||
|
||||
};
|
||||
|
||||
class Tools {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#ifndef VERSIONCONTAINER_H
|
||||
#define VERSIONCONTAINER_H
|
||||
|
||||
#include "streamingversiondata.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <Data/streamingversiondata.h>
|
||||
|
||||
class VersionContainer : public QObject
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user