fead: load without animation

This commit is contained in:
semenov
2024-09-19 11:11:20 +03:00
parent f2163b97b5
commit a1a103ae1e
65 changed files with 5618 additions and 865 deletions

71
Core/hashcomparer.cpp Normal file
View File

@@ -0,0 +1,71 @@
#include "hashcomparer.h"
#include <QCoreApplication>
#include <updatenotifywidget.h>
HashComparer::HashComparer(DataParser *dataParser,QObject *parent)
{
this->dataParser = dataParser;
this->updateWidget = updateWidget;
}
void HashComparer::CompareDeltas()
{
QList<FileData> *serverStreamingHash = new QList<FileData>;
QList<FileData> *localStreamingHash = new QList<FileData>;
QFile file(serverHash);
file.open(QIODevice::ReadOnly | QIODevice::Text);
serverStreamingHash = dataParser->xmlFileDataParse(file.readAll(),"StreamingAssets");
file.close();
QFile file2(streamingHashFilename);
file2.open(QIODevice::ReadOnly | QIODevice::Text);
localStreamingHash = dataParser->xmlFileDataParse(file2.readAll(),"StreamingAssets");
file2.close();
QMutableListIterator<FileData> iterator(*localStreamingHash);
for (auto &item:*localStreamingHash)
{
if(serverStreamingHash->contains(item))
{
serverStreamingHash->removeOne(item);
localStreamingHash->removeOne(item);
}
}
filesForUpdate = localStreamingHash;
showDeltas();
}
void HashComparer::showDeltas()
{
if (filesForUpdate->length() <= 0)
{
emit sigCallCheck();
return;
}
for (auto &item:*filesForUpdate)
{
updateWidget->addToList(item);
}
updateWidget->setUpdateList(filesForUpdate);
updateWidget->show();
updateWidget->activateWindow();
}
void HashComparer::setWidget(UpdateNotifyWidget* updateWidget)
{
this->updateWidget = updateWidget;
}
HashComparer::~HashComparer()
{
}