mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-29 06:35:40 +03:00
feat: choosing complete
This commit is contained in:
@@ -124,8 +124,8 @@ QList<FileData> UpdateController::calculateHash(const QString& path,const QStrin
|
||||
return *hashes;
|
||||
}
|
||||
|
||||
void UpdateController::updateFilesOnServer(QList<FileData> *fileSendList){
|
||||
|
||||
void UpdateController::updateFilesOnServer(QList<FileData> *fileSendList)
|
||||
{
|
||||
QListIterator<FileData> serverIterator(*fileSendList);
|
||||
try {
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ void HashComparer::initialize(VersionContainer *versionContainer,UpdateNotifyWid
|
||||
this->versionContainer = versionContainer;
|
||||
this->updateWidget = updateWidget;
|
||||
filesForUpdate = new QList<FileData>;
|
||||
|
||||
connect(this,&HashComparer::sigAddToList,updateWidget,&UpdateNotifyWidget::addToList,Qt::QueuedConnection);
|
||||
connect(this,&HashComparer::sigGetUpdateList,updateWidget,&UpdateNotifyWidget::getUpdateList,Qt::DirectConnection);
|
||||
}
|
||||
|
||||
void HashComparer::CompareDeltas(QList<FileData> *serverStreamingHash, QList<FileData> localStreamingHash)
|
||||
@@ -60,7 +63,7 @@ void HashComparer::showDeltas()
|
||||
{
|
||||
FileData local = filesForUpdate->at(i);
|
||||
FileData server = serverFiles->at(i);
|
||||
updateWidget->addToList(local,server);
|
||||
emit sigAddToList(local,server);
|
||||
}
|
||||
|
||||
emit sigHaveDelta();
|
||||
@@ -73,7 +76,7 @@ quint16 HashComparer::getFileUpdateCount() const
|
||||
|
||||
QList<FileData> *HashComparer::getFilesForUpdate() const
|
||||
{
|
||||
QList<FileData> *completeList = filesForUpdate;
|
||||
QList<FileData> *completeList = emit sigGetUpdateList();
|
||||
|
||||
for (int i = 0; i < completeList->count();i++)
|
||||
{
|
||||
@@ -86,5 +89,5 @@ QList<FileData> *HashComparer::getFilesForUpdate() const
|
||||
completeList->replace(i,data);
|
||||
}
|
||||
|
||||
return filesForUpdate;
|
||||
return completeList;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public:
|
||||
signals:
|
||||
void sigCallCheck();
|
||||
void sigHaveDelta();
|
||||
void sigAddToList(FileData local, FileData server);
|
||||
QList<FileData> *sigGetUpdateList() const;
|
||||
|
||||
private:
|
||||
UpdateNotifyWidget* updateWidget;
|
||||
QList<FileData> *filesForUpdate;
|
||||
|
||||
Reference in New Issue
Block a user