diff --git a/Core/UpdateController.cpp b/Core/UpdateController.cpp index 382afec..0b18d6f 100644 --- a/Core/UpdateController.cpp +++ b/Core/UpdateController.cpp @@ -8,35 +8,34 @@ UpdateController::UpdateController(DataParser *parser,SendSystem *sendSystem, QO this->dataParser = parser; this->sendSystem = sendSystem; applicationFolderPath = QDir::currentPath() + applicationFolderName; - //calculateStreamingHash(); } void UpdateController::calculateCommonHash() { - fileDataList.clear(); - calculateHash(applicationFolderPath); - dataParser->createFileDataList(fileDataList,hashFilename); + appDataList.clear(); + appDataList = calculateHash(applicationFolderPath); + calculateStreamingHash(); + dataParser->createFileDataList(appDataList,hashFilename); qDebug() << "UpdateController threadID " << QThread::currentThreadId(); } void UpdateController::calculateStreamingHash() { - fileDataList.clear(); - calculateHash(QDir::currentPath() + streamingAssetsPath); - dataParser->createFileDataList(fileDataList,streamingHashFilename); + streamingDataList.clear(); + streamingDataList = calculateHash(QDir::currentPath() + streamingAssetsPath); + dataParser->createFileDataList(appDataList,streamingHashFilename); } -void UpdateController::calculateHash(QString path) +QList UpdateController::calculateHash(QString path) { qDebug() << "Try calculate"; QDir dir(path); QDirIterator iterator(dir,QDirIterator::Subdirectories); - fileDataList.clear(); - QList *files = new QList; - QList *folders = new QList; + QList *hashes = new QList; - if(!QDir(path).exists()){ //проверка на наличие папки + if(!QDir(path).exists()) + { //проверка на наличие папки QDir().mkdir(path); } @@ -68,12 +67,10 @@ void UpdateController::calculateHash(QString path) readSize = qMin(fileSize,bufferSize); } - - hashString = QString(hash.result().toHex()); currentFile.path = Tools::createLocalPath(fileInfo.absoluteFilePath()); currentFile.hash = hashString; - files->push_back(currentFile); + hashes->push_back(currentFile); file.close(); } else if (fileInfo.isDir() && !fileInfo.isRoot() && fileInfo.fileName() != "..") @@ -81,19 +78,15 @@ void UpdateController::calculateHash(QString path) currentFile.path = Tools::createLocalPath(fileInfo.path()); currentFile.hash = "FOLDER"; - if(!folders->contains(currentFile)){ - folders->push_back(currentFile); + if(!hashes->contains(currentFile)) + { + hashes->push_back(currentFile); } } } - fileDataList.append(*folders); - fileDataList.append(*files); - - delete folders; - delete files; - + return *hashes; } void UpdateController::updateFilesOnServer(QList *fileSendList){ diff --git a/Core/UpdateController.h b/Core/UpdateController.h index cb66032..fc11d33 100644 --- a/Core/UpdateController.h +++ b/Core/UpdateController.h @@ -39,9 +39,10 @@ private: DataParser *dataParser; SendSystem *sendSystem; QString applicationFolderPath; - QList fileDataList; + QList appDataList; + QList streamingDataList; - void calculateHash(QString path); + QList calculateHash(QString path); }; diff --git a/RRJClient.pro.user b/RRJClient.pro.user index 8eee7d4..b2a10a2 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/StaticData/clientHash.xml b/StaticData/clientHash.xml index 57c1a0f..ad4190f 100644 --- a/StaticData/clientHash.xml +++ b/StaticData/clientHash.xml @@ -3,47 +3,29 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -51,15 +33,22 @@ + + + + + + + @@ -178,8 +167,11 @@ + + + @@ -188,11 +180,24 @@ + + + + - + + + + + + + + + + @@ -200,6 +205,7 @@ + diff --git a/StaticData/serverHash.xml b/StaticData/serverHash.xml index 57c1a0f..e472a2f 100644 --- a/StaticData/serverHash.xml +++ b/StaticData/serverHash.xml @@ -25,12 +25,14 @@ - + + + @@ -188,9 +190,9 @@ + - diff --git a/StaticData/streamingHash.xml b/StaticData/streamingHash.xml index 897a32a..ad4190f 100644 --- a/StaticData/streamingHash.xml +++ b/StaticData/streamingHash.xml @@ -1,2 +1,212 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index 3af1559..15ed56e 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/instructorbuttongroupwidget.o b/debug/instructorbuttongroupwidget.o index 23670e2..fc509c7 100644 Binary files a/debug/instructorbuttongroupwidget.o and b/debug/instructorbuttongroupwidget.o differ diff --git a/debug/mainwindow.o b/debug/mainwindow.o index 0cff6b7..38e38ee 100644 Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ diff --git a/debug/moc_updatecontroller.o b/debug/moc_updatecontroller.o index e9cbe87..2af00e1 100644 Binary files a/debug/moc_updatecontroller.o and b/debug/moc_updatecontroller.o differ diff --git a/debug/updatecontroller.o b/debug/updatecontroller.o index d8d0dc0..9c22336 100644 Binary files a/debug/updatecontroller.o and b/debug/updatecontroller.o differ diff --git a/instructorbuttongroupwidget.ui b/instructorbuttongroupwidget.ui index b560a90..e3bca91 100644 --- a/instructorbuttongroupwidget.ui +++ b/instructorbuttongroupwidget.ui @@ -6,10 +6,22 @@ 0 0 - 513 - 52 + 520 + 45 + + + 0 + 0 + + + + + 520 + 45 + + Form @@ -21,19 +33,58 @@ 0 0 - 513 - 53 + 520 + 45 + + + 0 + 0 + + + + + 520 + 45 + + + + 5 + + + 0 + + + 0 + + + 0 + + + 5 + + + + 0 + 0 + + 0 35 + + + 16777215 + 40 + + Выгрузить изменения @@ -41,12 +92,24 @@ + + + 0 + 0 + + 0 35 + + + 16777215 + 40 + + Отменить изменения @@ -54,12 +117,24 @@ + + + 0 + 0 + + 0 35 + + + 16777215 + 40 + + Запустить без отправки diff --git a/mainwindow.cpp b/mainwindow.cpp index 7d78438..4e6a4fd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -41,7 +41,7 @@ void MainWindow::initialize() ui->offlineWidget->hide(); ui->offlineStartButton->show(); ui->offlineStartButton->setEnabled(false); - ui->offlineStartButton->setGeometry(540,552,250,35); + ui->offlineStartButton->setGeometry(540,549,250,40); ui->displayGroupWidget->show(); ui->autostartCheckBox->hide(); @@ -275,7 +275,7 @@ void MainWindow::showConnectionEmpty() ui->notificationLabel->setText(tr("Соединение отсутсвует")); ui->offlineWidget->show(); ui->offlineStartButton->show(); - ui->offlineStartButton->setGeometry(280,340,250,35); + ui->offlineStartButton->setGeometry(280,340,250,40); ui->settingsButton->show(); ui->loginWidget->hide(); ui->updateWidget->hide(); @@ -296,7 +296,7 @@ void MainWindow::slotConnectionState(bool flag) ui->loginWidget->show(); ui->offlineStartButton->show(); - ui->offlineStartButton->setGeometry(540,552,250,35); + ui->offlineStartButton->setGeometry(540,549,250,40); } else { @@ -471,8 +471,9 @@ void MainWindow::showUpdateInfo() ui->updateActionListLabel->setText(list); ui->updateWidget->show(); + commonButtonGroupWidget->hide(); instructorButtonGroupWidget->show(); - ui->offlineStartButton->setGeometry(540,552,250,35); + ui->offlineStartButton->setGeometry(540,549,250,40); fileCountForUpdate = hashComparer->getFilesForUpdate()->length(); filesLoaded = 0; diff --git a/ui_instructorbuttongroupwidget.h b/ui_instructorbuttongroupwidget.h index aa63a07..2fd38dd 100644 --- a/ui_instructorbuttongroupwidget.h +++ b/ui_instructorbuttongroupwidget.h @@ -30,11 +30,11 @@ public: { if (InstructorButtonGroupWidget->objectName().isEmpty()) InstructorButtonGroupWidget->setObjectName(QString::fromUtf8("InstructorButtonGroupWidget")); - InstructorButtonGroupWidget->resize(513, 52); + InstructorButtonGroupWidget->resize(513, 53); instructorButtonGroup = new QWidget(InstructorButtonGroupWidget); instructorButtonGroup->setObjectName(QString::fromUtf8("instructorButtonGroup")); instructorButtonGroup->setEnabled(true); - instructorButtonGroup->setGeometry(QRect(0, 0, 513, 53)); + instructorButtonGroup->setGeometry(QRect(0, 0, 513, 51)); updateButtonGroup = new QHBoxLayout(instructorButtonGroup); updateButtonGroup->setObjectName(QString::fromUtf8("updateButtonGroup")); loadToServerButton = new QPushButton(instructorButtonGroup);