Skip to content

Commit

Permalink
forget about qtconcurrent, repaint instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jmckisson committed Jan 7, 2025
1 parent 769cfae commit 78e99d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -Wl,--gc-sections")
endif()

find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core Concurrent Widgets LinguistTools Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Concurrent Widgets LinguistTools Network)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core Widgets LinguistTools Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets LinguistTools Network)

set(TS_FILES MudletBootstrap_en_US.ts)

Expand All @@ -46,7 +46,6 @@ qt_add_executable(MudletBootstrap
target_link_libraries(MudletBootstrap PRIVATE
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Concurrent
)

if(WIN32)
Expand Down
8 changes: 6 additions & 2 deletions MudletBootstrap.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "MudletBootstrap.h"
#include <QApplication>
#include <QtConcurrent>
#include <QCryptographicHash>
#include <QDir>
#include <QNetworkRequest>
Expand Down Expand Up @@ -395,6 +394,7 @@ void MudletBootstrap::installApplication(const QString &filePath) {
#endif

statusLabel->setText("Installation Completed");
statusLabel->repaint();
progressWindow->close();
}

Expand All @@ -417,6 +417,9 @@ void MudletBootstrap::onDownloadFinished() {
file.close();
qDebug() << "Downloaded to:" << outputFile;

statusLabel->setText("Verifying SHA256...");
statusLabel->repaint();

// Verify the SHA-256 checksum
if (!verifyFileSha256(outputFile, info.sha256)) {
qDebug() << "Checksum verification failed. Exiting.";
Expand All @@ -425,9 +428,10 @@ void MudletBootstrap::onDownloadFinished() {
}

statusLabel->setText(QString("Installing %1").arg(info.appName));
statusLabel->repaint();

installApplication(outputFile);
QtConcurrent::run(this, &MudletBootstrap::installApplication, outputFile);


} else {
qDebug() << "Failed to save file.";
Expand Down

0 comments on commit 78e99d5

Please sign in to comment.