feat: add files time

This commit is contained in:
semenov
2026-03-10 09:36:49 +03:00
parent 715d29a1ec
commit 1d76e9785b
13 changed files with 29791 additions and 29716 deletions

View File

@@ -93,6 +93,7 @@ void DataParserOutput::createFileDataList(const QList<FileData>& fileDataList,co
xmlWriter.writeAttribute("Path",data.path);
xmlWriter.writeAttribute("Hash",data.hash);
xmlWriter.writeAttribute("LastUpdate",data.lastUpdate);
xmlWriter.writeEndElement();
}
@@ -333,6 +334,8 @@ QList<FileData>* DataParserOutput::xmlFileDataParse(const QByteArray& array,cons
data.path = value;
else if(name == "Hash")
data.hash = value;
else if(name == "LastUpdate")
data.lastUpdate = value;
}
if(data.path.contains(filter))

View File

@@ -61,6 +61,7 @@ void FastHashCalculator::calculateHashes(const QString& path, const QString& ign
QtConcurrent::map(files, [this](const QString &filePath)
{
QFileInfo fileInfo(filePath);
QByteArray hash = calculateFileHashOptimized(filePath);
QMutexLocker locker(&_mutex);
FileData currentFile;
@@ -68,7 +69,7 @@ void FastHashCalculator::calculateHashes(const QString& path, const QString& ign
currentFile.path = Tools::createLocalPath(filePath);
currentFile.hash = hash.toHex();
currentFile.lastUpdate = fileInfo.fileTime(QFileDevice::FileModificationTime).toString("dd.MM.yyyy hh:mm:ss");
hashList->append(currentFile);
}).waitForFinished();

View File

@@ -18,7 +18,7 @@ void HashComparer::initialize(VersionContainer *versionContainer,UpdateNotifyWid
void HashComparer::CompareDeltas(QList<FileData> *serverStreamingHash, QList<FileData> localStreamingHash)
{
QList<FileData> *files = new QList<FileData>;
serverFiles = new QList<FileData>;
QMutableListIterator<FileData> iterator(localStreamingHash);
for (auto &item:localStreamingHash)
@@ -26,6 +26,8 @@ void HashComparer::CompareDeltas(QList<FileData> *serverStreamingHash, QList<Fil
if(!serverStreamingHash->contains(item))
{
if (item.path.contains("docs.xml")) continue; //фильтр на docs
quint32 fileDataIndex = findIndexByPath(*serverStreamingHash, item.path);
serverFiles->append(serverStreamingHash->at(fileDataIndex));
files->append(item);
}
}
@@ -34,6 +36,17 @@ void HashComparer::CompareDeltas(QList<FileData> *serverStreamingHash, QList<Fil
showDeltas();
}
quint32 HashComparer::findIndexByPath(const QList<FileData> &serverStreamingHash,QString path)
{
for(int i = 0; i < serverStreamingHash.size(); i++)
{
if(serverStreamingHash.at(i).path == path)
return i;
}
return -1;
}
void HashComparer::showDeltas()
{
@@ -42,9 +55,12 @@ void HashComparer::showDeltas()
emit sigCallCheck();
return;
}
for (auto &item:*filesForUpdate)
for (int i = 0; i < filesForUpdate->size(); i++)
{
updateWidget->addToList(item);
FileData local = filesForUpdate->at(i);
FileData server = serverFiles->at(i);
updateWidget->addToList(local,server);
}
emit sigHaveDelta();

View File

@@ -26,7 +26,9 @@ signals:
private:
UpdateNotifyWidget* updateWidget;
QList<FileData> *filesForUpdate;
QList<FileData> *serverFiles;
VersionContainer *versionContainer;
quint32 findIndexByPath(const QList<FileData> &serverStreamingHash, QString path);
};
#endif // HASHCOMPARER_H

View File

@@ -8,6 +8,7 @@ struct FileData
{
QString path;
QString hash;
QString lastUpdate;
bool operator==(const FileData& other)const
{

2
StaticData/authData.xml Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuthData Login="I1" Password="b59c67bf196a4758191e42f76670ceba" InstructorName="Колобков В.Р." ClientName="Колобков В.Р." AccessType="instructor"/>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0" encoding="UTF-8"?>
<ServerSettingsContainer>
<ServerSettings AutoStart="0" Port="6000" Address="192.168.100.134" Language="RUS"/>
<VersionData Created="Пн дек 22 15:46:11 2025" isChangable="1" Version="max2"/>
<ServerSettings Address="192.168.100.83" Port="6000" Language="RUS" AutoStart="0"/>
<VersionData Version="-----" isChangable="0"/>
</ServerSettingsContainer>

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<ClientNotify Code="DISABLE"/>
<ClientNotify Code="CHECKVERSIONLIST"/>

View File

@@ -28,10 +28,14 @@ void UpdateNotifyWidget::setVersionContainer(VersionContainer *versionContainer)
this->versionContainer = versionContainer;
}
void UpdateNotifyWidget::addToList(FileData fileData)
void UpdateNotifyWidget::addToList(FileData localFileData,FileData serverFileData)
{
QString itemName = fileData.path;
QString itemName = localFileData.path;
itemName = itemName.remove(streamingAssetsPath);
itemName.append("Сервер: ");
itemName.append(serverFileData.lastUpdate);
itemName.append("Локально: ");
itemName.append(localFileData.lastUpdate);
ui->updateListWidget->addItem(itemName);
}

View File

@@ -21,7 +21,7 @@ public:
explicit UpdateNotifyWidget(QWidget *parent = nullptr);
~UpdateNotifyWidget();
void initialize(QPoint startPos);
void addToList(FileData fileData);
void addToList(FileData localFileData,FileData serverFileData);
void showWithFill();
void showTryChangeBase();
void setVersionContainer(VersionContainer *versionContainer);