Procházet zdrojové kódy

Clean up from old code

Ivan Arkhipov před 3 roky
rodič
revize
01c6794080

+ 2 - 14
src/Legacy/Legacy.pro

@@ -16,8 +16,8 @@ CONFIG += resources_big
 SOURCES += \
     main.cpp \
     models/downloader.cpp \
-    models/lotrodatmanager.cpp \
     models/patchdownloader.cpp \
+    models/patchinstaller.cpp \
     models/selfupdater.cpp \
     utils.cpp \
     widgets/helpwidget.cpp \
@@ -34,12 +34,6 @@ SOURCES += \
     widgets/dialogwindow.cpp \
     widgets/qsmoothscrollarea.cpp \
     fonts.cpp \
-    models/patch/patch.cpp \
-    models/patch/soundspatch.cpp \
-    models/patch/videospatch.cpp \
-    models/patch/textspatch.cpp \
-    models/patch/graphicspatch.cpp \
-    models/patchlist.cpp \
     legacyapplication.cpp \
     models/settings.cpp \
     models/filesystem.cpp
@@ -47,8 +41,8 @@ SOURCES += \
 HEADERS += \
     models/downloader.h \
     models/filesystem.h \
-    models/lotrodatmanager.h \
     models/patchdownloader.h \
+    models/patchinstaller.h \
     models/selfupdater.h \
     utils.h \
     widgets/helpwidget.h \
@@ -67,12 +61,6 @@ HEADERS += \
     constants.h \
     fonts.h \
     models/settings.h \
-    models/patch/patch.h \
-    models/patch/soundspatch.h \
-    models/patch/videospatch.h \
-    models/patch/textspatch.h \
-    models/patch/graphicspatch.h \
-    models/patchlist.h \
     legacyapplication.h
 
 FORMS += \

+ 9 - 13
src/Legacy/legacyapplication.cpp

@@ -1,16 +1,17 @@
 #include "legacyapplication.h"
-#include "models/lotrodatmanager.h"
-#include "models/patchlist.h"
-#include "widgets/mainwindow.h"
 
 #include <QLockFile>
+#include <QDir>
 #include <QMessageBox>
 #include <QResource>
 #include <QFontDatabase>
 #include <QMessageLogContext>
 
 #include "utils.h"
+#include "widgets/mainwindow.h"
+#include "models/filesystem.h"
 #include "models/patchdownloader.h"
+#include "models/patchinstaller.h"
 
 extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
 
@@ -56,17 +57,12 @@ bool LegacyApplication::init()
     QFontDatabase::addApplicationFont(":/fonts/EBGaramond.ttf");
     QFontDatabase::addApplicationFont(":/fonts/aniron.ttf");
 
-//    qDebug() << "Starting Lotro Manager initialization...";
-
-//    lotro_dat_manager = new LotroDatManager();
-//    lotro_dat_manager_thread = new QThread();
-//    connect(lotro_dat_manager_thread, &QThread::finished, lotro_dat_manager, &LotroDatManager::deleteLater);
-//    lotro_dat_manager->moveToThread(lotro_dat_manager_thread);
-//    lotro_dat_manager_thread->start();
-
-//    qDebug() << "Starting Patch list initialisation...";
+    qDebug() << "Starting Patch managers initialization...";
 
-//    patch_list = new PatchList(lotro_dat_manager);
+    patch_installer_thread_ = new QThread();
+    PatchInstaller::instance().init();
+    PatchInstaller::instance().moveToThread(patch_installer_thread_);
+    patch_installer_thread_->start();
 
     patch_downloader_thread_ = new QThread();
     PatchDownloader::instance().init();

+ 1 - 4
src/Legacy/legacyapplication.h

@@ -7,7 +7,6 @@
 #include "utils.h"
 
 class LotroDatManager;
-class PatchList;
 class MainWindow;
 
 class LegacyApplication : public QObject
@@ -35,12 +34,10 @@ private slots:
     void InitModules();
 
 private:
-//    LotroDatManager *lotro_dat_manager = nullptr;
-//    QThread *lotro_dat_manager_thread = nullptr;
-//    PatchList *patch_list = nullptr;
     MainWindow *gui = nullptr;
 
     QThread* patch_downloader_thread_;
+    QThread* patch_installer_thread_;
 
     QTimer modules_init_timer_;
     size_t seconds_after_previous_try_to_init_ = 10; // init value should be equal to try_to_init_timeout_

+ 0 - 354
src/Legacy/models/patch/graphicspatch.cpp

@@ -1,354 +0,0 @@
-#include "graphicspatch.h"
-
-#include <QUrlQuery>
-#include <QSet>
-
-GraphicsPatch::GraphicsPatch(LotroDatManager *mgr, QObject *parent) : Patch("GraphicsPatch", mgr, parent)
-{
-    connect(lotro_mgr_, &LotroDatManager::operationStarted, this, &GraphicsPatch::onLotroDatManagerOperationStarted);
-    connect(lotro_mgr_, &LotroDatManager::operationFinished, this, &GraphicsPatch::onLotroDatManagerOperationFinished);
-    connect(lotro_mgr_, &LotroDatManager::statusChanged, this, &GraphicsPatch::onLotroDatManagerStatusChanged);
-}
-
-void GraphicsPatch::checkForUpdates()
-{
-    QUrlQuery query; // query for building GET-request aka patch-version
-
-    foreach (QString db_name, databases_names) {
-        query.addQueryItem(db_name, "100");
-    }
-
-    QUrl target_url;
-    target_url.setUrl(Settings::getValue("Network/patch_updates_url").toString());
-    target_url.setQuery(query);
-
-    QByteArray target_array;
-    Downloader downloader;
-    downloader.setUrl(target_url);
-    downloader.targetBytearray = &target_array;
-    downloader.start();
-    downloader.waitForDownloaded();
-
-    if (target_array.isEmpty()) {
-        qWarning() << *this << "Cannot check for updates, target_array is empty!";
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    QStringList patch_info = QString(target_array).split('|');
-    if (patch_info.size() != databases_names.size()) {
-        qCritical() << __FUNCTION__ << "Incorrect patches number! Data: " << patch_info;
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    for (int i = 0; i < databases_names.size(); ++i) {
-        QStringList patch_data = patch_info[i].split(":::");
-        if (patch_data.size() != 3) {
-            qCritical() << __FUNCTION__ << "Incorrect patch entry size! Entry: " << patch_data;
-            emit errorOccured(E_CHECKFORUPDATES, this, "");
-            emit operationFinished(E_CHECKFORUPDATES, this);
-            return;
-        }
-
-        QString patch_filename = Settings::getValue("General/PatchDownloadDir").toString() + "/" + QUrl(patch_data[0]).fileName();
-
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/url", patch_data[0]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/hashsum", patch_data[1]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/datetime", patch_data[2]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/path", patch_filename);
-    }
-
-    emit operationFinished(E_CHECKFORUPDATES, this);
-}
-
-void GraphicsPatch::download()
-{
-    foreach (QString db_name, databases_names) {
-        QString settings_prefix = "PatchDatabases/" + db_name;
-
-        QString target_filename = QApplication::applicationDirPath() + "/" + Settings::getValue(settings_prefix + "/path").toString();
-        qDebug() << patch_name_ << ": Checking if file " << target_filename << " matches its hashsum";
-
-        if (FileSystem::fileHash(target_filename) == Settings::getValue(settings_prefix + "/hashsum").toString()) {
-            qInfo() << *this << ": file " << target_filename << " is up-to-date, no need to download";
-            continue;
-        }
-
-        FileSystem::createFilePath(target_filename);
-        QFile* target_file = new QFile(target_filename);
-        if (!target_file->open(QIODevice::ReadWrite | QIODevice::Truncate)) {
-            qWarning() << *this << "Cannot open file " << target_filename;
-            continue;
-        }
-
-        qInfo() << *this << ": beginning download of file " << target_filename;
-
-        Settings::setValue("DatabaseNeedInstall/" + db_name, true);
-
-        Downloader* downloader = new Downloader();
-        downloader->setUrl(Settings::getValue(settings_prefix + "/url").toUrl());
-        downloader->targetFile = target_file;
-        connect(downloader, &Downloader::progressChanged, this, &GraphicsPatch::onDownloaderProgressChanged);
-        connect(downloader, &Downloader::downloadFinished, this, &GraphicsPatch::onDownloaderFinished);
-        downloaders_.insert(downloader);
-        downloader->start();
-    }
-
-    if (downloaders_.empty()) {
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}
-
-void GraphicsPatch::install()
-{
-    installLoadscreens();
-
-    foreach (QString db_name, QStringList({"image", "texture"})) {
-        if (!Settings::getValue("DatabaseNeedInstall/" + db_name).toBool()) {
-            continue;
-        }
-
-        ++elapsed_patches_to_install_;
-        QMetaObject::invokeMethod(lotro_mgr_, "installPatch", Qt::QueuedConnection,
-                                  Q_ARG(QString, getPatchName() + "_" + db_name),
-                                  Q_ARG(QString, Settings::getValue("PatchDatabases/" + db_name + "/path").toString())
-                                  );
-    }
-
-    if (elapsed_patches_to_install_ == 0) {
-        emit operationFinished(E_INSTALL, this);
-    }
-}
-
-void GraphicsPatch::activate()
-{
-    emit operationFinished(E_ACTIVATE, this);
-    return;
-
-    if (Settings::getValue("Components/loadscreens").toBool()) {
-        enableLoadscreens();
-    } else {
-        disableLoadscreens();
-    }
-
-    QString operation_name;
-
-    operation_name = Settings::getValue("Components/maps").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                                  Q_ARG(QString, getPatchName() + "_maps"),
-                                  Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_MAPS_COMMON)
-                                  );
-
-    operation_name = Settings::getValue("Components/textures").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                                  Q_ARG(QString, getPatchName() + "_textures"),
-                                  Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_TEXTURES_COMMON)
-                                  );
-}
-
-void GraphicsPatch::onDownloaderProgressChanged(Downloader *, Downloader::Status)
-{
-    Downloader::Status all_downloads_status;
-    foreach (Downloader* downloader, downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    emit progressChanged(OperationProgress(all_downloads_status), this);
-}
-
-void GraphicsPatch::onDownloaderFinished(Downloader *ptr)
-{
-    ptr->targetFile->close();
-    ptr->targetFile->deleteLater();
-
-    Downloader::Status all_downloads_status;
-    for (const Downloader* downloader : downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    if (!all_downloads_status.running) {
-        for (Downloader* downloader : downloaders_) {
-            downloader->deleteLater();
-        }
-        downloaders_.clear();
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}
-
-void GraphicsPatch::onLotroDatManagerOperationFinished(QString operation_name, QVector<QVariant> args, bool successful)
-{
-    if (args.size() == 0 || !args[0].toString().contains(getPatchName())) {
-        return; // This means, that message from LotroManager is addressed to another patchset
-    }
-
-    if (operation_name.contains("installPatch")) {
-        if (!successful) {
-            qCritical() << *this << "Database " + args[0].toString() + " (" + args[1].toString() + ") was not installed due to Legacy core error.";
-            emit errorOccured(E_INSTALL, this, "Database " + args[0].toString() + " (" + args[1].toString() + ") was not installed due to Legacy core error.");
-        }
-
-        QString db_name = args[0].toString().split('_').at(1);
-        Settings::setValue("DatabaseNeedInstall/" + db_name, false);
-
-        --elapsed_patches_to_install_;
-        if (!elapsed_patches_to_install_) {
-            is_being_patched_by_lotro_dat_manager_ = false;
-            emit operationFinished(E_INSTALL, this);
-        }
-    }
-
-    if (operation_name.contains("enableCategory") || operation_name.contains("disableCategory")) {
-        if (!successful) {
-            qCritical() << *this << "Error in patch " + args[0].toString() + ": activating category " + QString::number(args[1].toInt()) + " failed.";
-            emit errorOccured(E_ACTIVATE, this, "Error in patch " + args[0].toString() + ": activating category " + QString::number(args[1].toInt()) + " failed.");
-        }
-
-        --elapsed_patches_to_install_;
-        if (!elapsed_patches_to_install_) {
-            is_being_patched_by_lotro_dat_manager_ = false;
-            emit operationFinished(E_ACTIVATE, this);
-        }
-    }
-}
-
-void GraphicsPatch::onLotroDatManagerOperationStarted(QString, QVector<QVariant> args)
-{
-    if (args.size() == 0 || !args[0].toString().contains(getPatchName())) {
-        return;
-    }
-
-    is_being_patched_by_lotro_dat_manager_ = true;
-}
-
-void GraphicsPatch::onLotroDatManagerStatusChanged(LotroDatManager::Status status)
-{
-    if (!is_being_patched_by_lotro_dat_manager_) {
-        return;
-    }
-
-    emit progressChanged(OperationProgress(status), this);
-}
-
-void GraphicsPatch::installLoadscreens()
-{
-    if (!Settings::getValue("DatabaseNeedInstall/loadscreen").toBool()) {
-        return;
-    }
-
-    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
-
-    const QStringList loadscreens_filenames = {
-        locale_prefix == "English" ? "lotro_ad_pregame.jpg" : "lotro_ad_pregame_" + locale_prefix + ".jpg",
-        "lotro_generic_teleport_screen_01.jpg",
-        "lotro_generic_teleport_screen_02.jpg",
-        "lotro_generic_teleport_screen_03.jpg",
-        "lotro_generic_teleport_screen_04.jpg",
-        "lotro_generic_teleport_screen_05.jpg",
-        "lotro_generic_teleport_screen_06.jpg",
-        "lotro_generic_teleport_screen_07.jpg",
-        "lotro_generic_teleport_screen_08.jpg",
-        "lotro_generic_teleport_screen_09.jpg",
-        "lotro_generic_teleport_screen_10.jpg"
-    };
-
-    OperationProgress progress;
-    progress.install_finished_parts = 0;
-    progress.install_total_parts = loadscreens_filenames.size() * 2;
-
-    LOTRO_DAT::Database database;
-    if (!database.InitDatabase(Settings::getValue("PatchDatabases/Loadscreen/path").toString().toStdString())) {
-        qCritical() << *this << "database.InitDatabase() of " << Settings::getValue("PatchDatabases/Loadscreen/path").toString() << " FAILED!";
-        return;
-    }
-
-    LOTRO_DAT::SubfileData data;
-
-    QString logo_path = Settings::getValue("Lotro/game_path").toString() + "/raw/" + (locale_prefix == "English" ? "en" : locale_prefix) + "/logo/";
-
-    for (size_t i = 0; i < qMin(size_t(loadscreens_filenames.size()), database.CountRows()); ++i) {
-        data = database.GetNextFile();
-        QFile::remove(logo_path + loadscreens_filenames[i] + "_ru");
-
-        if (!data.binary_data.WriteToFile((logo_path + loadscreens_filenames[i] + "_ru").toLocal8Bit())) {
-            qWarning() << patch_name_ << "Cannot write to file " << logo_path + loadscreens_filenames[i];
-        }
-
-        progress.install_finished_parts++;
-        emit progressChanged(progress, this);
-    }
-
-    for (int i = 0; i < loadscreens_filenames.size(); ++i) {
-        QFile::copy(logo_path + loadscreens_filenames[i], logo_path + loadscreens_filenames[i] + "_orig"); // Will not copy if _orig file already exists
-        progress.install_finished_parts++;
-        emit progressChanged(progress, this);
-    }
-
-    Settings::setValue("DatabaseNeedInstall/loadscreen", false);
-}
-
-void GraphicsPatch::enableLoadscreens()
-{
-    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
-    QString logo_path = Settings::getValue("Lotro/game_path").toString() + "/raw/" + (locale_prefix == "English" ? "en" : locale_prefix) + "/logo/";
-
-    const QStringList loadscreens_filenames = {
-        locale_prefix == "English" ? "lotro_ad_pregame.jpg" : "lotro_ad_pregame_" + locale_prefix + ".jpg",
-        "lotro_generic_teleport_screen_01.jpg",
-        "lotro_generic_teleport_screen_02.jpg",
-        "lotro_generic_teleport_screen_03.jpg",
-        "lotro_generic_teleport_screen_04.jpg",
-        "lotro_generic_teleport_screen_05.jpg",
-        "lotro_generic_teleport_screen_06.jpg",
-        "lotro_generic_teleport_screen_07.jpg",
-        "lotro_generic_teleport_screen_08.jpg",
-        "lotro_generic_teleport_screen_09.jpg",
-        "lotro_generic_teleport_screen_10.jpg"
-    };
-
-    OperationProgress progress;
-    progress.install_total_parts = loadscreens_filenames.size();
-
-    for (int i = 0; i < loadscreens_filenames.size(); ++i) {
-        QFile::remove(logo_path + loadscreens_filenames[i]);
-        QFile::copy(logo_path + loadscreens_filenames[i] + "_ru", logo_path + loadscreens_filenames[i]);
-
-        progress.install_finished_parts++;
-        emit progressChanged(progress, this);
-    }
-}
-
-void GraphicsPatch::disableLoadscreens()
-{
-    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
-    QString logo_path = Settings::getValue("Lotro/game_path").toString() + "/raw/" + (locale_prefix == "English" ? "en" : locale_prefix) + "/logo/";
-
-    const QStringList loadscreens_filenames = {
-        locale_prefix == "English" ? "lotro_ad_pregame.jpg" : "lotro_ad_pregame_" + locale_prefix + ".jpg",
-        "lotro_generic_teleport_screen_01.jpg",
-        "lotro_generic_teleport_screen_02.jpg",
-        "lotro_generic_teleport_screen_03.jpg",
-        "lotro_generic_teleport_screen_04.jpg",
-        "lotro_generic_teleport_screen_05.jpg",
-        "lotro_generic_teleport_screen_06.jpg",
-        "lotro_generic_teleport_screen_07.jpg",
-        "lotro_generic_teleport_screen_08.jpg",
-        "lotro_generic_teleport_screen_09.jpg",
-        "lotro_generic_teleport_screen_10.jpg"
-    };
-
-    OperationProgress progress;
-    progress.install_total_parts = loadscreens_filenames.size();
-
-    for (int i = 0; i < loadscreens_filenames.size(); ++i) {
-        QFile::remove(logo_path + loadscreens_filenames[i]);
-        QFile::copy(logo_path + loadscreens_filenames[i] + "_orig", logo_path + loadscreens_filenames[i]);
-
-        progress.install_finished_parts++;
-        emit progressChanged(progress, this);
-    }
-}

+ 0 - 41
src/Legacy/models/patch/graphicspatch.h

@@ -1,41 +0,0 @@
-#ifndef IMAGESPATCH_H
-#define IMAGESPATCH_H
-
-#include <QObject>
-
-#include "models/patch/patch.h"
-
-class GraphicsPatch : public Patch
-{
-    Q_OBJECT
-
-public:
-    GraphicsPatch(LotroDatManager* mgr, QObject* parent = nullptr);
-
-private slots:
-    virtual void checkForUpdates() override;
-    virtual void download() override;
-    virtual void install() override;
-    virtual void activate() override;
-
-private slots:
-    void onDownloaderProgressChanged(Downloader* ptr, Downloader::Status status);
-    void onDownloaderFinished(Downloader* ptr);
-
-    void onLotroDatManagerOperationStarted(QString operation_name, QVector<QVariant> args);
-    void onLotroDatManagerOperationFinished(QString operation_name, QVector<QVariant> args, bool successful);
-    void onLotroDatManagerStatusChanged(LotroDatManager::Status status);
-
-private:
-    const QStringList databases_names = {
-        "image",
-        "texture",
-        "loadscreen",
-    };
-
-    void installLoadscreens();
-    void enableLoadscreens();
-    void disableLoadscreens();
-};
-
-#endif // IMAGESPATCH_H

+ 0 - 203
src/Legacy/models/patch/patch.cpp

@@ -1,203 +0,0 @@
-#include "patch.h"
-#include "models/settings.h"
-#include "models/filesystem.h"
-#include "models/lotrodatmanager.h"
-
-#include <QUrlQuery>
-
-Patch::Patch(QString patch_name, LotroDatManager* mgr, QObject *parent)
-    : QObject(parent)
-    , lotro_mgr_(mgr)
-    , patch_name_(patch_name)
-{
-    qRegisterMetaType<Operation>("Operation");
-    qRegisterMetaType<QList<Patch::Operation>>("QList<Patch::Operation>");
-    qRegisterMetaType<OperationProgress>("OperationProgress");
-
-
-    connect(this, &Patch::operationStarted, this, &Patch::onOperationStarted);
-    connect(this, &Patch::operationFinished, this, &Patch::onOperationFinished);
-}
-
-bool Patch::needDownloadDatabase(QString db_name)
-{
-    QString patch_filename = Settings::getValue("PatchDatabases/" + db_name + "/path").toString();
-    QString current_file_hash = FileSystem::fileHash(patch_filename);
-    QString required_file_hash = Settings::getValue("PatchDatabases/" + db_name + "/hashsum").toString();
-    return isDatabaseDownloadEnabled(db_name) && (current_file_hash != required_file_hash);
-}
-
-bool Patch::isDatabaseDownloadEnabled(QString db_name)
-{
-    if (db_name == "text") {
-        return Settings::getValue("Components/texts_main").toBool() ||
-               Settings::getValue("Components/texts_items").toBool() ||
-               Settings::getValue("Components/texts_emotes").toBool();
-    }
-
-    if (db_name == "font") {
-        return Settings::getValue("Components/fonts").toBool();
-    }
-
-    if (db_name == "image") {
-        return Settings::getValue("Components/maps").toBool();
-    }
-
-    if (db_name == "texture") {
-        return Settings::getValue("Components/logos").toBool();
-    }
-
-    if (db_name == "loadscreen") {
-        return Settings::getValue("Components/loadscreens").toBool();
-    }
-
-    if (db_name == "sound") {
-        return Settings::getValue("Components/sounds").toBool();
-    }
-
-    if (db_name == "video") {
-        return Settings::getValue("Components/video").toBool();
-    }
-
-    return false;
-}
-
-void Patch::execOperation(Patch::Operation operation)
-{
-    switch (operation) {
-    case E_CHECKFORUPDATES:
-        checkForUpdates();
-        return;
-    case E_DOWNLOAD:
-        download();
-        return;
-    case E_INSTALL:
-        install();
-        return;
-    case E_ACTIVATE:
-        activate();
-        return;
-    default:
-        qCritical() << "Unknown operation on patchset " << patch_name_ << "!";
-    }
-}
-
-QString Patch::getPatchName() const
-{
-    return patch_name_;
-}
-
-void Patch::enqueue(const Patch::Operation &operation)
-{
-    qDebug() << "Enqueuing operation " << operation << " in patchset" << *this;
-    operations_queue_.append(operation);
-    if (!running_operation_) {
-        processQueue();
-    }
-}
-
-void Patch::enqueue(const QList<Patch::Operation> &operations)
-{
-    qDebug() << "Enqueuing operations " << operations << " in patchset" << *this;
-    operations_queue_.append(operations);
-    if (!running_operation_) {
-        processQueue();
-    }
-}
-
-void Patch::processQueue()
-{
-    if (operations_queue_.empty() || running_operation_) {
-        return;
-    }
-
-    Operation current_operation = operations_queue_.dequeue();
-    qDebug() << "Processing patch queue: " << *this << ", starting operation " << current_operation;
-    emit operationStarted(current_operation, this);
-    execOperation(current_operation);
-}
-
-void Patch::onOperationStarted(Patch::Operation, Patch*)
-{
-    running_operation_ = true;
-}
-
-void Patch::onOperationFinished(Patch::Operation, Patch*)
-{
-    running_operation_ = false;
-    processQueue();
-}
-
-Patch::OperationProgress::OperationProgress(Downloader::Status status)
-{
-    download_finished_bytes = status.downloaded_bytes;
-    download_total_bytes = status.total_bytes;
-    download_speed = status.current_speed;
-    download_elapsed_time = status.elapsed_time;
-}
-
-Patch::OperationProgress::OperationProgress(LotroDatManager::Status status) {
-//    install_finished_parts = status.finished_parts;
-//    install_total_parts = status.total_parts;
-}
-
-Patch::OperationProgress Patch::OperationProgress::operator+(const Patch::OperationProgress &other) const
-{
-    Patch::OperationProgress result;
-
-    result.download_elapsed_time = download_elapsed_time + other.download_elapsed_time;
-    result.download_finished_bytes = download_finished_bytes + other.download_finished_bytes;
-    result.download_speed = download_speed + other.download_speed;
-    result.download_total_bytes = download_total_bytes + other.download_total_bytes;
-
-    result.install_finished_parts = install_finished_parts + other.install_finished_parts;
-    result.install_total_parts = install_total_parts + other.install_total_parts;
-
-    return result;
-}
-
-double Patch::OperationProgress::getDownloadPercent() const
-{
-    return double(download_finished_bytes) * 100.0/ double(download_total_bytes);
-}
-
-double Patch::OperationProgress::getInstallPercent() const
-{
-    return double(install_finished_parts) * 100.0 / double(install_total_parts);
-}
-
-QDebug operator<<(QDebug dbg, const Patch::Operation& operation) {
-    switch (operation) {
-    case Patch::Operation::E_CHECKFORUPDATES:
-        dbg << "Patch::Operation::E_CHECKFORUPDATES";
-        return dbg;
-    case Patch::Operation::E_DOWNLOAD:
-        dbg << "Patch::Operation::E_DOWNLOAD";
-        return dbg;
-    case Patch::Operation::E_INSTALL:
-        dbg << "Patch::Operation::E_INSTALL";
-        return dbg;
-    case Patch::Operation::E_ACTIVATE:
-        dbg << "Patch::Operation::E_ACTIVATE";
-        return dbg;
-    default:
-        dbg << "{Unknown operation!}";
-    }
-    return dbg;
-}
-
-QDebug operator<<(QDebug dbg, const Patch::OperationProgress& operation_progress) {
-    dbg.nospace().noquote()
-        << "Downloaded: " << Downloader::getSizeFormatted(operation_progress.download_finished_bytes)
-        << " of " << Downloader::getSizeFormatted(operation_progress.download_total_bytes)
-        << " with speed " << Downloader::getSpeedFormatted(operation_progress.download_speed)
-        << " Elapsed time " << Downloader::getElapsedTimeFormatted(operation_progress.download_elapsed_time)
-        << " Installed: " << operation_progress.install_finished_parts << " of " << operation_progress.install_total_parts << ".";
-    return dbg;
-}
-
-QDebug operator<<(QDebug dbg, const Patch& patch) {
-    dbg.nospace().noquote() << "Patch::" << patch.getPatchName();
-    return dbg;
-}
-

+ 0 - 97
src/Legacy/models/patch/patch.h

@@ -1,97 +0,0 @@
-#ifndef LEGACYPATCH_H
-#define LEGACYPATCH_H
-
-#include <QObject>
-#include <QQueue>
-#include <QTimer>
-
-#include "models/downloader.h"
-#include "models/filesystem.h"
-#include "models/lotrodatmanager.h"
-#include "models/settings.h"
-
-class Patch : public QObject
-{
-    Q_OBJECT
-
-public:
-    enum Operation {
-        E_CHECKFORUPDATES,
-        E_DOWNLOAD,
-        E_INSTALL,
-        E_ACTIVATE
-    };
-
-    struct OperationProgress {
-
-        OperationProgress() = default;
-        OperationProgress(Downloader::Status status);
-        OperationProgress(LotroDatManager::Status status);
-
-        OperationProgress operator+(const Patch::OperationProgress& other) const;
-
-        double getDownloadPercent() const;
-        double getInstallPercent() const;
-
-    public:
-        quint64 download_finished_bytes = 0;
-        quint64 download_total_bytes = 0;
-        quint64 download_speed = 0;
-        quint64 download_elapsed_time = 0;
-
-        quint64 install_finished_parts = 0;
-        quint64 install_total_parts = 0;
-    };
-
-public:
-    explicit Patch(QString patch_name, LotroDatManager* mgr, QObject* parent);
-
-    QString getPatchName() const;
-
-public slots:
-    void enqueue(const Patch::Operation& operation);
-
-    void enqueue(const QList<Patch::Operation>& operations);
-
-    void processQueue();
-
-private slots: // WARNING: THESE CAN BE NON-BLOCKING OPERATIONS! Use them in chain only via operationFinished signal handlers.
-    virtual void checkForUpdates() = 0; // Checks for updates. Updates patches info in Settings.
-    virtual void download() = 0;        // Downloads patch contents, prepared for installation.
-    virtual void install() = 0;         // Installs patch into game resources (needs to be activated in order to be available in-game)
-    virtual void activate() = 0;        // Activates (or deactivates) patch components based on user preferences (patch needs to be installed)
-
-    void onOperationStarted(Operation operation, Patch* patch);
-    void onOperationFinished(Operation operation, Patch* patch);
-
-signals: // each signal brings with it pointer to class-emitter, operation name is equal to function name
-    void operationStarted(Operation operation, Patch* patch);
-    void progressChanged(OperationProgress progress, Patch* patch);
-    void operationFinished(Operation operation, Patch* patch);
-    void errorOccured(Operation operation, Patch* patch, QString msg);
-
-protected:
-    bool needDownloadDatabase(QString db_name); // Checks if database needs to be downloaded (by checksum comparing)
-
-    static bool isDatabaseDownloadEnabled(QString db_name); // Checks if database is checked for installation by user (via Settings)
-
-    void execOperation(Operation operation); // Starts operation execution by its "name"
-
-protected:
-    bool running_operation_ = false;
-    LotroDatManager* lotro_mgr_;
-    QString patch_name_;
-    QSet<Downloader*> downloaders_;
-    QQueue<Operation> operations_queue_;
-    bool is_being_patched_by_lotro_dat_manager_ = false;
-
-    quint32 elapsed_patches_to_install_ = 0;
-};
-
-QDebug operator<<(QDebug dbg, const Patch::Operation& operation);
-
-QDebug operator<<(QDebug dbg, const Patch::OperationProgress& operation_progress);
-
-QDebug operator<<(QDebug dbg, const Patch& patch);
-
-#endif // LEGACYPATCH_H

+ 0 - 218
src/Legacy/models/patch/soundspatch.cpp

@@ -1,218 +0,0 @@
-#include "soundspatch.h"
-
-#include <QUrlQuery>
-#include <QSet>
-#include <QThread>
-
-SoundsPatch::SoundsPatch(LotroDatManager *mgr, QObject *parent) : Patch("SoundsPatch", mgr, parent)
-{
-    connect(lotro_mgr_, &LotroDatManager::operationStarted, this, &SoundsPatch::onLotroDatManagerOperationStarted);
-    connect(lotro_mgr_, &LotroDatManager::operationFinished, this, &SoundsPatch::onLotroDatManagerOperationFinished);
-    connect(lotro_mgr_, &LotroDatManager::statusChanged, this, &SoundsPatch::onLotroDatManagerStatusChanged);
-}
-
-void SoundsPatch::checkForUpdates()
-{
-    QUrlQuery query; // query for building GET-request aka patch-version
-
-    foreach (QString db_name, databases_names) {
-        query.addQueryItem(db_name, "100");
-    }
-
-    QUrl target_url;
-    target_url.setUrl(Settings::getValue("Network/patch_updates_url").toString());
-    target_url.setQuery(query);
-
-    QByteArray target_array;
-    Downloader downloader;
-    downloader.setUrl(target_url);
-    downloader.targetBytearray = &target_array;
-    downloader.start();
-    downloader.waitForDownloaded();
-
-    if (target_array.isEmpty()) {
-        qWarning() << *this << "Cannot check for updates, target_array is empty!";
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    QStringList patch_info = QString(target_array).split('|');
-    if (patch_info.size() != databases_names.size()) {
-        qCritical() << __FUNCTION__ << "Incorrect patches number! Data: " << patch_info;
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    for (int i = 0; i < databases_names.size(); ++i) {
-        QStringList patch_data = patch_info[i].split(":::");
-        if (patch_data.size() != 3) {
-            qCritical() << __FUNCTION__ << "Incorrect patch entry size! Entry: " << patch_data;
-            emit errorOccured(E_CHECKFORUPDATES, this, "");
-            emit operationFinished(E_CHECKFORUPDATES, this);
-            return;
-        }
-
-        QString patch_filename = Settings::getValue("General/PatchDownloadDir").toString() + "/" + QUrl(patch_data[0]).fileName();
-
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/url", patch_data[0]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/hashsum", patch_data[1]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/datetime", patch_data[2]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/path", patch_filename);
-    }
-
-    emit operationFinished(E_CHECKFORUPDATES, this);
-}
-
-void SoundsPatch::download()
-{
-    foreach (QString db_name, databases_names) {
-        QString settings_prefix = "PatchDatabases/" + db_name;
-
-        QString target_filename = QApplication::applicationDirPath() + "/" + Settings::getValue(settings_prefix + "/path").toString();
-        qDebug() << patch_name_ << ": Checking if file " << target_filename << " matches its hashsum";
-
-        if (FileSystem::fileHash(target_filename) == Settings::getValue(settings_prefix + "/hashsum").toString()) {
-            qInfo() << *this << ": file " << target_filename << " is up-to-date, no need to download";
-            continue;
-        }
-
-        FileSystem::createFilePath(target_filename);
-        QFile* target_file = new QFile(target_filename);
-        if (!target_file->open(QIODevice::ReadWrite | QIODevice::Truncate)) {
-            qWarning() << *this << "Cannot open file " << target_filename;
-            continue;
-        }
-
-        qInfo() << *this << ": beginning download of file " << target_filename;
-
-        Settings::setValue("DatabaseNeedInstall/" + db_name, true);
-
-        Downloader* downloader = new Downloader();
-        downloader->setUrl(Settings::getValue(settings_prefix + "/url").toUrl());
-        downloader->targetFile = target_file;
-        connect(downloader, &Downloader::progressChanged, this, &SoundsPatch::onDownloaderProgressChanged);
-        connect(downloader, &Downloader::downloadFinished, this, &SoundsPatch::onDownloaderFinished);
-        downloaders_.insert(downloader);
-        downloader->start();
-    }
-
-    if (downloaders_.empty()) {
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}
-
-void SoundsPatch::install()
-{
-    foreach (QString db_name, QStringList({"sound"})) {
-        if (!Settings::getValue("DatabaseNeedInstall/" + db_name).toBool()) {
-            continue;
-        }
-
-        ++elapsed_patches_to_install_;
-        QMetaObject::invokeMethod(lotro_mgr_, "installPatch", Qt::QueuedConnection,
-                                  Q_ARG(QString, getPatchName() + "_" + db_name),
-                                  Q_ARG(QString, Settings::getValue("PatchDatabases/" + db_name + "/path").toString())
-                                  );
-    }
-
-    if (elapsed_patches_to_install_ == 0) {
-        emit operationFinished(E_INSTALL, this);
-    }
-}
-
-void SoundsPatch::activate()
-{
-    emit operationFinished(E_ACTIVATE, this);
-    return;
-
-    QString operation_name = Settings::getValue("Components/sounds").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                              Q_ARG(QString, getPatchName() + "_sounds"),
-                              Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_AUDIOS_COMMON)
-                              );
-}
-
-void SoundsPatch::onDownloaderProgressChanged(Downloader *, Downloader::Status)
-{
-    Downloader::Status all_downloads_status;
-    foreach (Downloader* downloader, downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    emit progressChanged(OperationProgress(all_downloads_status), this);
-}
-
-void SoundsPatch::onDownloaderFinished(Downloader *ptr)
-{
-    ptr->targetFile->close();
-    ptr->targetFile->deleteLater();
-
-    Downloader::Status all_downloads_status;
-    for (const Downloader* downloader : downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    if (!all_downloads_status.running) {
-        for (Downloader* downloader : downloaders_) {
-            downloader->deleteLater();
-        }
-        downloaders_.clear();
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}
-
-void SoundsPatch::onLotroDatManagerOperationFinished(QString operation_name, QVector<QVariant> args, bool successful)
-{
-    if (args.size() == 0 || !args[0].toString().contains(getPatchName())) {
-        return; // This means, that message from LotroManager is addressed to another patchset
-    }
-
-    if (operation_name.contains("installPatch")) {
-        if (!successful) {
-            qCritical() << *this << "Database " + args[0].toString() + " (" + args[1].toString() + ") was not installed due to Legacy core error.";
-            emit errorOccured(E_INSTALL, this, "Database " + args[0].toString() + " (" + args[1].toString() + ") was not installed due to Legacy core error.");
-        }
-        QString db_name = args[0].toString().split('_').at(1);
-        Settings::setValue("DatabaseNeedInstall/" + db_name, false);
-
-        --elapsed_patches_to_install_;
-        if (!elapsed_patches_to_install_) {
-            is_being_patched_by_lotro_dat_manager_ = false;
-            emit operationFinished(E_INSTALL, this);
-        }
-    }
-
-    if (operation_name.contains("enableCategory") || operation_name.contains("disableCategory")) {
-        if (!successful) {
-            qCritical() << *this << "Error in patch " + args[0].toString() + ": activating category " + QString::number(args[1].toInt()) + " failed.";
-            emit errorOccured(E_ACTIVATE, this, "Error in patch " + args[0].toString() + ": activating category " + QString::number(args[1].toInt()) + " failed.");
-        }
-
-        --elapsed_patches_to_install_;
-        if (!elapsed_patches_to_install_) {
-            is_being_patched_by_lotro_dat_manager_ = false;
-            emit operationFinished(E_ACTIVATE, this);
-        }
-    }
-}
-
-void SoundsPatch::onLotroDatManagerOperationStarted(QString, QVector<QVariant> args)
-{
-    if (args.size() == 0 || !args[0].toString().contains(getPatchName())) {
-        return;
-    }
-
-    is_being_patched_by_lotro_dat_manager_ = true;
-}
-
-void SoundsPatch::onLotroDatManagerStatusChanged(LotroDatManager::Status status)
-{
-    if (!is_being_patched_by_lotro_dat_manager_) {
-        return;
-    }
-
-    emit progressChanged(OperationProgress(status), this);
-}

+ 0 - 35
src/Legacy/models/patch/soundspatch.h

@@ -1,35 +0,0 @@
-#ifndef SOUNDSPATCH_H
-#define SOUNDSPATCH_H
-
-#include <QObject>
-
-#include "models/patch/patch.h"
-
-class SoundsPatch : public Patch
-{
-    Q_OBJECT
-
-public:
-    SoundsPatch(LotroDatManager* mgr, QObject* parent = nullptr);
-
-private slots:
-    virtual void checkForUpdates() override;
-    virtual void download() override;
-    virtual void install() override;
-    virtual void activate() override;
-
-private slots:
-    void onDownloaderProgressChanged(Downloader* ptr, Downloader::Status status);
-    void onDownloaderFinished(Downloader* ptr);
-
-    void onLotroDatManagerOperationStarted(QString operation_name, QVector<QVariant> args);
-    void onLotroDatManagerOperationFinished(QString operation_name, QVector<QVariant> args, bool successful);
-    void onLotroDatManagerStatusChanged(LotroDatManager::Status status);
-
-private:
-    const QStringList databases_names = {
-        "sound",
-    };
-};
-
-#endif // SOUNDSPATCH_H

+ 0 - 247
src/Legacy/models/patch/textspatch.cpp

@@ -1,247 +0,0 @@
-#include "textspatch.h"
-
-#include <QUrlQuery>
-#include <QSet>
-#include <QThread>
-
-TextsPatch::TextsPatch(LotroDatManager *mgr, QObject *parent) : Patch("TextsPatch", mgr, parent)
-{
-    connect(lotro_mgr_, &LotroDatManager::operationStarted, this, &TextsPatch::onLotroDatManagerOperationStarted);
-    connect(lotro_mgr_, &LotroDatManager::operationFinished, this, &TextsPatch::onLotroDatManagerOperationFinished);
-    connect(lotro_mgr_, &LotroDatManager::statusChanged, this, &TextsPatch::onLotroDatManagerStatusChanged);
-}
-
-void TextsPatch::checkForUpdates()
-{
-    QUrlQuery query; // query for building GET-request aka patch-version
-
-    foreach (QString db_name, databases_names) {
-        query.addQueryItem(db_name, "100");
-    }
-
-    QUrl target_url;
-    target_url.setUrl(Settings::getValue("Network/patch_updates_url").toString());
-    target_url.setQuery(query);
-
-    QByteArray target_array;
-    Downloader downloader;
-    downloader.setUrl(target_url);
-    downloader.targetBytearray = &target_array;
-    downloader.start();
-    downloader.waitForDownloaded();
-
-    if (target_array.isEmpty()) {
-        qWarning() << *this << "Cannot check for updates, target_array is empty!";
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    QStringList patch_info = QString(target_array).split('|');
-    if (patch_info.size() != databases_names.size()) {
-        qCritical() << __FUNCTION__ << "Incorrect patches number! Data: " << patch_info;
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    for (int i = 0; i < databases_names.size(); ++i) {
-        QStringList patch_data = patch_info[i].split(":::");
-        if (patch_data.size() != 3) {
-            qCritical() << __FUNCTION__ << "Incorrect patch entry size! Entry: " << patch_data;
-            emit errorOccured(E_CHECKFORUPDATES, this, "");
-            emit operationFinished(E_CHECKFORUPDATES, this);
-            return;
-        }
-
-        QString patch_filename = Settings::getValue("General/PatchDownloadDir").toString() + "/" + QUrl(patch_data[0]).fileName();
-
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/url", patch_data[0]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/hashsum", patch_data[1]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/datetime", patch_data[2]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/path", patch_filename);
-    }
-
-    emit operationFinished(E_CHECKFORUPDATES, this);
-}
-
-void TextsPatch::download()
-{
-    foreach (QString db_name, databases_names) {
-        QString settings_prefix = "PatchDatabases/" + db_name;
-
-        QString target_filename = QApplication::applicationDirPath() + "/" + Settings::getValue(settings_prefix + "/path").toString();
-        qDebug() << patch_name_ << ": Checking if file " << target_filename << " matches its hashsum";
-
-        if (FileSystem::fileHash(target_filename) == Settings::getValue(settings_prefix + "/hashsum").toString()) {
-            qInfo() << *this << ": file " << target_filename << " is up-to-date, no need to download";
-            continue;
-        }
-
-        FileSystem::createFilePath(target_filename);
-        QFile* target_file = new QFile(target_filename);
-        if (!target_file->open(QIODevice::ReadWrite | QIODevice::Truncate)) {
-            qWarning() << *this << "Cannot open file " << target_filename;
-            continue;
-        }
-
-        qInfo() << *this << ": beginning download of file " << target_filename;
-
-        Settings::setValue("DatabaseNeedInstall/" + db_name, true);
-
-        Downloader* downloader = new Downloader();
-        downloader->setUrl(Settings::getValue(settings_prefix + "/url").toUrl());
-        downloader->targetFile = target_file;
-        connect(downloader, &Downloader::progressChanged, this, &TextsPatch::onDownloaderProgressChanged);
-        connect(downloader, &Downloader::downloadFinished, this, &TextsPatch::onDownloaderFinished);
-        downloaders_.insert(downloader);
-        downloader->start();
-    }
-
-    if (downloaders_.empty()) {
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}
-
-void TextsPatch::install()
-{
-    foreach (QString db_name, databases_names) {
-        if (!Settings::getValue("DatabaseNeedInstall/" + db_name).toBool()) {
-            continue;
-        }
-
-        ++elapsed_patches_to_install_;
-        QMetaObject::invokeMethod(lotro_mgr_, "installPatch", Qt::QueuedConnection,
-                                  Q_ARG(QString, getPatchName() + "_" + db_name),
-                                  Q_ARG(QString, Settings::getValue("PatchDatabases/" + db_name + "/path").toString())
-                                  );
-    }
-
-    if (elapsed_patches_to_install_ == 0) {
-        emit operationFinished(E_INSTALL, this);
-    }
-}
-
-void TextsPatch::activate()
-{
-    emit operationFinished(E_ACTIVATE, this);
-    return;
-
-    QString operation_name = Settings::getValue("Components/fonts").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                              Q_ARG(QString, getPatchName() + "_fonts"),
-                              Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_FONTS_COMMON)
-                              );
-
-    operation_name = Settings::getValue("Components/texts_main").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                              Q_ARG(QString, getPatchName() + "_texts_main"),
-                              Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_TEXTS_COMMON)
-                              );
-
-    operation_name = Settings::getValue("Components/texts_items").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                              Q_ARG(QString, getPatchName() + "_texts_items"),
-                              Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_TEXTS_ITEMS)
-                              );
-
-    operation_name = Settings::getValue("Components/texts_emotes").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                              Q_ARG(QString, getPatchName() + "_texts_emotes"),
-                              Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_TEXTS_EMOTES)
-                              );
-
-    operation_name = Settings::getValue("Components/videos").toBool() ? "enableCategory" : "disableCategory";
-    ++elapsed_patches_to_install_;
-    QMetaObject::invokeMethod(lotro_mgr_, operation_name.toLocal8Bit().constData(), Qt::QueuedConnection,
-                              Q_ARG(QString, getPatchName() + "_texts_videos_refs"),
-                              Q_ARG(LotroDatManager::Category, LotroDatManager::Category::E_TEXTS_VIDEOS_REFS)
-                              );
-}
-
-void TextsPatch::onDownloaderProgressChanged(Downloader *, Downloader::Status)
-{
-    Downloader::Status all_downloads_status;
-    foreach (Downloader* downloader, downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    emit progressChanged(OperationProgress(all_downloads_status), this);
-}
-
-void TextsPatch::onDownloaderFinished(Downloader *ptr)
-{
-    ptr->targetFile->close();
-    ptr->targetFile->deleteLater();
-
-    Downloader::Status all_downloads_status;
-    for (const Downloader* downloader : downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    if (!all_downloads_status.running) {
-        for (Downloader* downloader : downloaders_) {
-            downloader->deleteLater();
-        }
-        downloaders_.clear();
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}
-
-void TextsPatch::onLotroDatManagerOperationFinished(QString operation_name, QVector<QVariant> args, bool successful)
-{
-    if (args.size() == 0 || !args[0].toString().contains(getPatchName())) {
-        return; // This means, that message from LotroManager is addressed to another patchset
-    }
-
-    if (operation_name.contains("installPatch")) {
-        if (!successful) {
-            qCritical() << *this << "Database " + args[0].toString() + " (" + args[1].toString() + ") was not installed due to Legacy core error.";
-            emit errorOccured(E_INSTALL, this, "Database " + args[0].toString() + " (" + args[1].toString() + ") was not installed due to Legacy core error.");
-        }
-
-        QString db_name = args[0].toString().split('_').at(1);
-        Settings::setValue("DatabaseNeedInstall/" + db_name, false);
-
-        --elapsed_patches_to_install_;
-        if (!elapsed_patches_to_install_) {
-            is_being_patched_by_lotro_dat_manager_ = false;
-            emit operationFinished(E_INSTALL, this);
-        }
-    }
-
-    if (operation_name.contains("enableCategory") || operation_name.contains("disableCategory")) {
-        if (!successful) {
-            qCritical() << *this << "Error in patch " + args[0].toString() + ": activating category " + QString::number(args[1].toInt()) + " failed.";
-            emit errorOccured(E_ACTIVATE, this, "Error in patch " + args[0].toString() + ": activating category " + QString::number(args[1].toInt()) + " failed.");
-        }
-
-        --elapsed_patches_to_install_;
-        if (!elapsed_patches_to_install_) {
-            is_being_patched_by_lotro_dat_manager_ = false;
-            emit operationFinished(E_ACTIVATE, this);
-        }
-    }
-}
-
-void TextsPatch::onLotroDatManagerOperationStarted(QString, QVector<QVariant> args)
-{
-    if (args.size() == 0 || !args[0].toString().contains(getPatchName())) {
-        return;
-    }
-
-    is_being_patched_by_lotro_dat_manager_ = true;
-}
-
-void TextsPatch::onLotroDatManagerStatusChanged(LotroDatManager::Status status)
-{
-    if (!is_being_patched_by_lotro_dat_manager_) {
-        return;
-    }
-
-    emit progressChanged(OperationProgress(status), this);
-}

+ 0 - 35
src/Legacy/models/patch/textspatch.h

@@ -1,35 +0,0 @@
-#ifndef TEXTPATCH_H
-#define TEXTPATCH_H
-
-#include <QObject>
-
-#include "models/patch/patch.h"
-
-class TextsPatch : public Patch
-{
-    Q_OBJECT
-
-public:
-    TextsPatch(LotroDatManager* mgr, QObject* parent = nullptr);
-
-private slots:
-    virtual void checkForUpdates() override;
-    virtual void download() override;
-    virtual void install() override;
-    virtual void activate() override;
-
-private slots:
-    void onDownloaderProgressChanged(Downloader* ptr, Downloader::Status status);
-    void onDownloaderFinished(Downloader* ptr);
-
-    void onLotroDatManagerOperationStarted(QString operation_name, QVector<QVariant> args);
-    void onLotroDatManagerOperationFinished(QString operation_name, QVector<QVariant> args, bool successful);
-    void onLotroDatManagerStatusChanged(LotroDatManager::Status status);
-
-private:
-    const QStringList databases_names = {
-        "text",
-        "font"
-    };
-};
-#endif // TEXTPATCH_H

+ 0 - 140
src/Legacy/models/patch/videospatch.cpp

@@ -1,140 +0,0 @@
-#include "videospatch.h"
-
-#include <QUrlQuery>
-#include <QSet>
-#include <QThread>
-
-VideosPatch::VideosPatch(LotroDatManager *mgr, QObject *parent) : Patch("VideosPatch", mgr, parent)
-{
-}
-
-void VideosPatch::checkForUpdates()
-{
-    QUrlQuery query; // query for building GET-request aka patch-version
-
-    foreach (QString db_name, databases_names) {
-        query.addQueryItem(db_name, "100");
-    }
-
-    QUrl target_url;
-    target_url.setUrl(Settings::getValue("Network/patch_updates_url").toString());
-    target_url.setQuery(query);
-
-    QByteArray target_array;
-    Downloader downloader;
-    downloader.setUrl(target_url);
-    downloader.targetBytearray = &target_array;
-    downloader.start();
-    downloader.waitForDownloaded();
-
-    if (target_array.isEmpty()) {
-        qWarning() << *this << "Cannot check for updates, target_array is empty!";
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    QStringList patch_info = QString(target_array).split('|');
-    if (patch_info.size() != databases_names.size()) {
-        qCritical() << __FUNCTION__ << "Incorrect patches number! Data: " << patch_info;
-        emit errorOccured(E_CHECKFORUPDATES, this, "");
-        emit operationFinished(E_CHECKFORUPDATES, this);
-        return;
-    }
-
-    for (int i = 0; i < databases_names.size(); ++i) {
-        QStringList patch_data = patch_info[i].split(":::");
-        if (patch_data.size() != 3) {
-            qCritical() << __FUNCTION__ << "Incorrect patch entry size! Entry: " << patch_data;
-            emit errorOccured(E_CHECKFORUPDATES, this, "");
-            emit operationFinished(E_CHECKFORUPDATES, this);
-            return;
-        }
-
-        QString patch_filename = Settings::getValue("General/PatchDownloadDir").toString() + "/" + QUrl(patch_data[0]).fileName();
-
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/url", patch_data[0]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/hashsum", patch_data[1]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/datetime", patch_data[2]);
-        Settings::setValue("PatchDatabases/" + databases_names[i] + "/path", patch_filename);
-    }
-
-    emit operationFinished(E_CHECKFORUPDATES, this);
-}
-
-void VideosPatch::download()
-{
-    foreach (QString db_name, databases_names) {
-        QString settings_prefix = "PatchDatabases/" + db_name;
-
-        QString target_filename = QApplication::applicationDirPath() + "/" + Settings::getValue(settings_prefix + "/path").toString();
-        qDebug() << patch_name_ << ": Checking if file " << target_filename << " matches its hashsum";
-
-        if (FileSystem::fileHash(target_filename) == Settings::getValue(settings_prefix + "/hashsum").toString()) {
-            qInfo() << *this << ": file " << target_filename << " is up-to-date, no need to download";
-            continue;
-        }
-
-        FileSystem::createFilePath(target_filename);
-        QFile* target_file = new QFile(target_filename);
-        if (!target_file->open(QIODevice::ReadWrite | QIODevice::Truncate)) {
-            qWarning() << *this << "Cannot open file " << target_filename;
-            continue;
-        }
-
-        qInfo() << *this << ": beginning download of file " << target_filename;
-
-        Downloader* downloader = new Downloader();
-        downloader->setUrl(Settings::getValue(settings_prefix + "/url").toUrl());
-        downloader->targetFile = target_file;
-        connect(downloader, &Downloader::progressChanged, this, &VideosPatch::onDownloaderProgressChanged);
-        connect(downloader, &Downloader::downloadFinished, this, &VideosPatch::onDownloaderFinished);
-        downloaders_.insert(downloader);
-        downloader->start();
-    }
-
-    if (downloaders_.empty()) {
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}
-
-void VideosPatch::install()
-{
-    QThread::msleep(500);
-    emit operationFinished(E_INSTALL, this);
-}
-
-void VideosPatch::activate()
-{
-    QThread::msleep(500);
-    emit operationFinished(E_ACTIVATE, this);
-}
-
-void VideosPatch::onDownloaderProgressChanged(Downloader *, Downloader::Status)
-{
-    Downloader::Status all_downloads_status;
-    foreach (Downloader* downloader, downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    emit progressChanged(OperationProgress(all_downloads_status), this);
-}
-
-void VideosPatch::onDownloaderFinished(Downloader *ptr)
-{
-    ptr->targetFile->close();
-    ptr->targetFile->deleteLater();
-
-    Downloader::Status all_downloads_status;
-    for (const Downloader* downloader : downloaders_) {
-        all_downloads_status = all_downloads_status + downloader->getDownloadStatus();
-    }
-
-    if (!all_downloads_status.running) {
-        for (Downloader* downloader : downloaders_) {
-            downloader->deleteLater();
-        }
-        downloaders_.clear();
-        emit operationFinished(E_DOWNLOAD, this);
-    }
-}

+ 0 - 31
src/Legacy/models/patch/videospatch.h

@@ -1,31 +0,0 @@
-#ifndef VIDEOSPATCH_H
-#define VIDEOSPATCH_H
-
-#include <QObject>
-
-#include "models/patch/patch.h"
-
-class VideosPatch : public Patch
-{
-    Q_OBJECT
-
-public:
-    VideosPatch(LotroDatManager* mgr, QObject* parent = nullptr);
-
-private slots:
-    virtual void checkForUpdates() override;
-    virtual void download() override;
-    virtual void install() override;
-    virtual void activate() override;
-
-private slots:
-    void onDownloaderProgressChanged(Downloader* ptr, Downloader::Status status);
-    void onDownloaderFinished(Downloader* ptr);
-
-private:
-    const QStringList databases_names = {
-        "video"
-    };
-};
-
-#endif // VIDEOSPATCH_H

+ 79 - 113
src/Legacy/models/lotrodatmanager.cpp → src/Legacy/models/patchinstaller.cpp

@@ -1,39 +1,15 @@
-#include "lotrodatmanager.h"
+#include "patchinstaller.h"
 #include "models/filesystem.h"
 #include "models/settings.h"
 
 #include <QDebug>
 #include <QProcess>
 
-Q_DECLARE_METATYPE(LotroDatManager::Category)
 
-
-LotroDatManager::LotroDatManager(QObject *parent) :  QObject(parent), client_local_file_(1), client_general_file_(2) {
-}
-
-LotroDatManager::~LotroDatManager() {
-    deinitializeManager();
-}
-
-bool LotroDatManager::initialised() {
-    return client_general_file_.Initialized() && client_local_file_.Initialized();
-}
-
-bool LotroDatManager::datPathIsRelevant() {
-    QString game_folder = Settings::getValue("Lotro/game_path").toString();
-    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
-
-    QString client_local_filepath = game_folder + "/client_local_" + locale_prefix + ".dat";
-    QString client_general_filepath = game_folder + "/client_general.dat";
-
-    QString client_local_current_path = QString::fromStdString(client_local_file_.GetFilename());
-    QString client_general_current_path = QString::fromStdString(client_general_file_.GetFilename());
-
-    return QFileInfo(client_local_filepath) != QFileInfo(client_local_current_path)
-            || QFileInfo(client_general_filepath) != QFileInfo(client_general_current_path);
+PatchInstaller::PatchInstaller(QObject *parent) :  QObject(parent) {
 }
 
-void LotroDatManager::initializeManager()
+void PatchInstaller::init()
 {
     emit operationStarted("initializeManager");
     qDebug() << __FUNCTION__ << "Starting initialisation of LotroDatManager";
@@ -62,12 +38,15 @@ void LotroDatManager::initializeManager()
 
     // Initialising client_local_*.dat file and client_general.dat
 
-    auto client_local_init_res = client_local_file_.Init(client_local_filepath.toStdString());
-    auto client_general_init_res = client_general_file_.Init(client_general_filepath.toStdString());
+    client_local_file_ = new LOTRO_DAT::DatFile(1);
+    client_general_file_ = new LOTRO_DAT::DatFile(2);
+
+    auto client_local_init_res = client_local_file_->Init(client_local_filepath.toStdString());
+    auto client_general_init_res = client_general_file_->Init(client_general_filepath.toStdString());
 
     if (!client_local_init_res || !client_general_init_res) {
-        client_local_file_.Deinit();
-        client_general_file_.Deinit();
+        client_local_file_->Deinit();
+        client_general_file_->Deinit();
 
         qDebug() << __FUNCTION__ << "Finished LotroDatManager initialisation - error: DatFile initialisation error!";
 
@@ -77,20 +56,81 @@ void LotroDatManager::initializeManager()
     }
 
     qDebug() << "LotroDatManager initialisation successfull! Dat files: "
-             << QString::fromStdString(client_general_file_.GetFilename())
-             << QString::fromStdString(client_local_file_.GetFilename());
+             << QString::fromStdString(client_general_file_->GetFilename())
+             << QString::fromStdString(client_local_file_->GetFilename());
 
     emit operationFinished("initializeManager", {}, true);
 }
 
-void LotroDatManager::deinitializeManager() {
+bool PatchInstaller::initialised() {
+    return client_general_file_->Initialized() && client_local_file_->Initialized();
+}
+
+PatchInstaller::~PatchInstaller() {
+    deinit();
+}
+
+
+bool PatchInstaller::datPathIsRelevant() {
+    QString game_folder = Settings::getValue("Lotro/game_path").toString();
+    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
+
+    QString client_local_filepath = game_folder + "/client_local_" + locale_prefix + ".dat";
+    QString client_general_filepath = game_folder + "/client_general.dat";
+
+    QString client_local_current_path = QString::fromStdString(client_local_file_->GetFilename());
+    QString client_general_current_path = QString::fromStdString(client_general_file_->GetFilename());
+
+    return QFileInfo(client_local_filepath) != QFileInfo(client_local_current_path)
+            || QFileInfo(client_general_filepath) != QFileInfo(client_general_current_path);
+}
+
+void PatchInstaller::deinit() {
     emit operationStarted("deinitializeManager");
-    client_local_file_.Deinit();
-    client_general_file_.Deinit();
+    client_local_file_->Deinit();
+    client_general_file_->Deinit();
     emit operationFinished("deinitializeManager");
 }
 
-void LotroDatManager::startGame(bool freeze_updates) {
+void PatchInstaller::installPatch(QString patch_name, QString database_path, RESOURCE_FILE_TYPE dat_file) {
+    emit operationStarted("installPatch", {patch_name, database_path});
+    LOTRO_DAT::Database db;
+
+    if (!db.InitDatabase(database_path.toStdString())) {
+        qDebug() << __FUNCTION__ << "Error database " << database_path << ": failed to open!";
+        return;
+    }
+
+    size_t patched_files_num = 0;
+
+    LOTRO_DAT::SubfileData file;
+    int i = 0;
+    const int total_files = db.CountRows();
+    qDebug() << "Patching all files from database...";
+    while (!(file = db.GetNextFile()).Empty()) {
+        if (i * 100 / total_files != (i - 1) * 100 / total_files) {
+            qDebug() << "Completed " << i * 100 / total_files << "%";
+        }
+        ++i;
+
+        if (!file.options["fid"]) {
+            continue;
+        }
+
+        if (dat_file == E_CLIENT_LOCAL) {
+            client_local_file_->PatchFile(file);
+        } else if (dat_file == E_CLIENT_GENERAL) {
+            client_general_file_->PatchFile(file);
+        }
+        ++patched_files_num;
+    }
+
+    db.CloseDatabase();
+    emit operationFinished("installPatch", {patch_name, database_path}, true);
+}
+
+
+void PatchInstaller::startGame(bool freeze_updates) {
     // if freeze_updates is set to True, original game
     // launcher will be replaced with special program,
     // which controls lotro startup and prevents from updates
@@ -157,8 +197,8 @@ void LotroDatManager::startGame(bool freeze_updates) {
         args << "-nosplashscreen";
     }
 
-    client_general_file_.Deinit();
-    client_local_file_.Deinit();
+    client_general_file_->Deinit();
+    client_local_file_->Deinit();
 
     QString username = Settings::getValue("Account/username").toString();
     QString password = Settings::getValue("Account/password").toString();
@@ -183,77 +223,3 @@ void LotroDatManager::startGame(bool freeze_updates) {
 
     emit operationFinished("startGame");
 }
-
-void LotroDatManager::installPatch(QString patch_name, QString database_path, RESOURCE_FILE_TYPE dat_file) {
-    emit operationStarted("installPatch", {patch_name, database_path});
-    LOTRO_DAT::Database db;
-
-    if (!db.InitDatabase(database_path.toStdString())) {
-        qDebug() << __FUNCTION__ << "Error database " << database_path << ": failed to open!";
-        return;
-    }
-
-    size_t patched_files_num = 0;
-
-    LOTRO_DAT::SubfileData file;
-    int i = 0;
-    const int total_files = db.CountRows();
-    qDebug() << "Patching all files from database...";
-    while (!(file = db.GetNextFile()).Empty()) {
-        if (i * 100 / total_files != (i - 1) * 100 / total_files) {
-            qDebug() << "Completed " << i * 100 / total_files << "%";
-        }
-        ++i;
-
-        if (!file.options["fid"]) {
-            continue;
-        }
-
-        if (dat_file == E_CLIENT_LOCAL) {
-            client_local_file_.PatchFile(file);
-        } else if (dat_file == E_CLIENT_GENERAL) {
-            client_general_file_.PatchFile(file);
-        }
-        ++patched_files_num;
-    }
-
-    db.CloseDatabase();
-    emit operationFinished("installPatch", {patch_name, database_path}, true);
-}
-
-void LotroDatManager::createBackup()
-{
-//    emit operationStarted("createBackup");
-//    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
-//    QString client_local_backup_path = QApplication::applicationDirPath() + Settings::getValue("Backup/path").toString() + "client_local_" + locale_prefix + ".dat";
-//    QString client_general_backup_path = QApplication::applicationDirPath() + Settings::getValue("Backup/path").toString() + "client_general.dat";
-//    auto loc_res = client_local_file_.GetBackupManager().CreateBackup(client_local_backup_path.toStdString());
-//    auto gen_res = client_general_file_.GetBackupManager().CreateBackup(client_general_backup_path.toStdString());
-//    bool operations_result = (loc_res.result == LOTRO_DAT::SUCCESS && gen_res.result == LOTRO_DAT::SUCCESS);
-
-//    emit operationFinished("createBackup", {client_local_backup_path, client_general_backup_path}, operations_result);
-}
-
-void LotroDatManager::restoreFromBackup()
-{
-//    emit operationStarted("restoreFromBackup");
-//    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
-//    QString client_local_backup_path = QApplication::applicationDirPath() + Settings::getValue("Backup/path").toString() + "client_local_" + locale_prefix + ".dat";
-//    QString client_general_backup_path = QApplication::applicationDirPath() + Settings::getValue("Backup/path").toString() + "client_general.dat";
-//    auto loc_res = client_local_file_.GetBackupManager().RestoreFromBackup(client_local_backup_path.toStdString());
-//    auto gen_res = client_general_file_.GetBackupManager().RestoreFromBackup(client_general_backup_path.toStdString());
-//    bool operations_result = (loc_res.result == LOTRO_DAT::SUCCESS && gen_res.result == LOTRO_DAT::SUCCESS);
-//    emit operationFinished("restoreFromBackup", {}, operations_result);
-}
-
-void LotroDatManager::removeBackup()
-{
-//    emit operationStarted("removeBackup");
-//    QString locale_prefix = Settings::getValue("Lotro/original_locale").toString();
-//    QString client_local_backup_path = QApplication::applicationDirPath() + Settings::getValue("Backup/path").toString() + "client_local_" + locale_prefix + ".dat";
-//    QString client_general_backup_path = QApplication::applicationDirPath() + Settings::getValue("Backup/path").toString() + "client_general.dat";
-//    auto loc_res = client_local_file_.GetBackupManager().RemoveBackup(client_local_backup_path.toStdString());
-//    auto gen_res = client_general_file_.GetBackupManager().RemoveBackup(client_general_backup_path.toStdString());
-//    bool operations_result = (loc_res.result == LOTRO_DAT::SUCCESS && gen_res.result == LOTRO_DAT::SUCCESS);
-//    emit operationFinished("removeBackup", {}, operations_result);
-}

+ 21 - 23
src/Legacy/models/lotrodatmanager.h → src/Legacy/models/patchinstaller.h

@@ -10,7 +10,7 @@
 #include <LotroDat/datfile.h>
 #include <LotroDat/database.h>
 
-class LotroDatManager : public QObject
+class PatchInstaller : public QObject
 {
     Q_OBJECT
 
@@ -19,6 +19,20 @@ public:
 
     };
 
+
+public:
+    static PatchInstaller& instance() {
+        static PatchInstaller instance_;
+        return instance_;
+    }
+    void init();
+    bool initialised();
+    ~PatchInstaller();
+
+//    TODO: bool NotPatched();
+
+
+private:
     enum Category : int {
         E_TEXTS_COMMON = 100,
         E_TEXTS_ITEMS = 101,
@@ -35,34 +49,18 @@ public:
         E_CLIENT_GENERAL = 1
     };
 
-public:
-    ~LotroDatManager();
-
-    void init();
-    bool initialised();
-
-//    TODO: bool NotPatched();
+    explicit PatchInstaller(QObject *parent = nullptr);
 
     bool datPathIsRelevant();
 
-private:
-    explicit LotroDatManager(QObject *parent = nullptr);
-
-
-public slots:
-    void initializeManager();
-
-    void deinitializeManager();
-
-    void startGame(bool freeze_updates);
+    void deinit();
 
     void installPatch(QString patch_name, QString database_path, RESOURCE_FILE_TYPE dat_file);
 
-    void createBackup();
 
-    void restoreFromBackup();
+public slots:
+    void startGame(bool freeze_updates);
 
-    void removeBackup();
 
 signals:
     void operationStarted(QString operation_name, QVector<QVariant> args = {});
@@ -71,8 +69,8 @@ signals:
     void statusChanged(Status status);
 
 private:
-    LOTRO_DAT::DatFile client_local_file_;
-    LOTRO_DAT::DatFile client_general_file_;
+    LOTRO_DAT::DatFile* client_local_file_;
+    LOTRO_DAT::DatFile* client_general_file_;
 };
 
 #endif // LEGACYAPP_H

+ 0 - 306
src/Legacy/models/patchlist.cpp

@@ -1,306 +0,0 @@
-#include "patchlist.h"
-
-#include <QDebug>
-#include <QDirIterator>
-
-PatchList::PatchList(LotroDatManager *mgr, QObject *parent) : QObject(parent)
-{
-    lotro_mgr_ = mgr;
-
-    qInfo() << "PatchList: Initialising patchsets";
-    texts_patch_ = new TextsPatch(mgr);
-    graphics_patch_ = new GraphicsPatch(mgr);
-    sounds_patch_ = new SoundsPatch(mgr);
-    videos_patch_ = new VideosPatch(mgr);
-
-    qInfo() << "PatchList: Patchsets were initialized, initializing threads";
-    texts_patch_thread_ = new QThread(this);
-    graphics_patch_thread_ = new QThread(this);
-    sounds_patch_thread_ = new QThread(this);
-    videos_patch_thread_ = new QThread(this);
-
-    texts_patch_->moveToThread(texts_patch_thread_);
-    graphics_patch_->moveToThread(graphics_patch_thread_);
-    sounds_patch_->moveToThread(sounds_patch_thread_);
-    videos_patch_->moveToThread(videos_patch_thread_);
-
-    connect(texts_patch_, &TextsPatch::operationStarted, this, &PatchList::onPatchOperationStarted, Qt::QueuedConnection);
-    connect(graphics_patch_, &GraphicsPatch::operationStarted, this, &PatchList::onPatchOperationStarted, Qt::QueuedConnection);
-    connect(sounds_patch_, &SoundsPatch::operationStarted, this, &PatchList::onPatchOperationStarted, Qt::QueuedConnection);
-    connect(videos_patch_, &VideosPatch::operationStarted, this, &PatchList::onPatchOperationStarted, Qt::QueuedConnection);
-
-    connect(texts_patch_, &TextsPatch::operationFinished, this, &PatchList::onPatchOperationFinished, Qt::QueuedConnection);
-    connect(graphics_patch_, &GraphicsPatch::operationFinished, this, &PatchList::onPatchOperationFinished, Qt::QueuedConnection);
-    connect(sounds_patch_, &SoundsPatch::operationFinished, this, &PatchList::onPatchOperationFinished, Qt::QueuedConnection);
-    connect(videos_patch_, &VideosPatch::operationFinished, this, &PatchList::onPatchOperationFinished, Qt::QueuedConnection);
-
-    connect(texts_patch_, &TextsPatch::progressChanged, this, &PatchList::onPatchOperationProgressChanged, Qt::QueuedConnection);
-    connect(graphics_patch_, &GraphicsPatch::progressChanged, this, &PatchList::onPatchOperationProgressChanged, Qt::QueuedConnection);
-    connect(sounds_patch_, &SoundsPatch::progressChanged, this, &PatchList::onPatchOperationProgressChanged, Qt::QueuedConnection);
-    connect(videos_patch_, &VideosPatch::progressChanged, this, &PatchList::onPatchOperationProgressChanged, Qt::QueuedConnection);
-
-    connect(lotro_mgr_, &LotroDatManager::operationStarted, this, &PatchList::onLotroManagerOperationStarted, Qt::QueuedConnection);
-    connect(lotro_mgr_, &LotroDatManager::operationFinished, this, &PatchList::onLotroManagerOperationFinished, Qt::QueuedConnection);
-
-    qInfo() << "PatchList: Patchset threads initialized, starting workers";
-    texts_patch_thread_->start();
-    graphics_patch_thread_->start();
-    sounds_patch_thread_->start();
-    videos_patch_thread_->start();
-
-    patch_update_timer.setInterval(5 * 60 * 1000); // Once in 5 minutes check for updates
-    connect(&patch_update_timer, &QTimer::timeout, this, &PatchList::update);
-}
-
-PatchList::~PatchList()
-{
-    qDebug() << "PatchList: finishing work";
-    texts_patch_thread_->quit();
-    graphics_patch_thread_->quit();
-    sounds_patch_thread_->quit();
-    videos_patch_thread_->quit();
-
-    if (!texts_patch_thread_->wait(500)) {
-        qDebug() << "PatchList: ERROR, TEXTS PATCHSET DIDNT STOP, FORCEFULLY TERMINATING!";
-        texts_patch_thread_->terminate();
-        texts_patch_thread_->wait();
-    }
-
-    if (!graphics_patch_thread_->wait(500)) {
-        qDebug() << "PatchList: ERROR, GRAPHICS PATCHSET DIDNT STOP, FORCEFULLY TERMINATING!";
-        graphics_patch_thread_->terminate();
-        graphics_patch_thread_->wait();
-    }
-
-    if (!sounds_patch_thread_->wait(500)) {
-        qDebug() << "PatchList: ERROR, SOUNDS PATCHSET DIDNT STOP, FORCEFULLY TERMINATING!";
-        sounds_patch_thread_->terminate();
-        sounds_patch_thread_->wait();
-    }
-
-    if (!videos_patch_thread_->wait(500)) {
-        qDebug() << "PatchList: ERROR, VIDEOS PATCHSET DIDNT STOP, FORCEFULLY TERMINATING!";
-        videos_patch_thread_->terminate();
-        videos_patch_thread_->wait();
-    }
-
-    qDebug() << "Patchlist: all jobs stopped, destroying";
-
-    delete texts_patch_;
-    delete graphics_patch_;
-    delete sounds_patch_;
-    delete videos_patch_;
-}
-
-QList<Patch *> PatchList::getPatchList()
-{
-    return {texts_patch_, graphics_patch_, sounds_patch_, videos_patch_};
-}
-
-LotroDatManager *PatchList::getManager()
-{
-    return lotro_mgr_;
-}
-
-void PatchList::onPatchOperationProgressChanged(Patch::OperationProgress operation_progress, Patch *patch)
-{
-    patch_operations_status_[patch] = operation_progress;
-
-    Patch::OperationProgress total_status;
-    for (const Patch::OperationProgress &st : patch_operations_status_) {
-        total_status = total_status + st;
-    }
-    emit progressChanged(total_status);
-}
-
-void PatchList::onLotroManagerOperationFinished(QString operation_name, QVector<QVariant>, bool result)
-{
-    qDebug() << "LotroManager: operation finished " << operation_name;
-    if (operation_name == "initializeManager") {
-        --active_operations_num_;
-
-        if (active_operations_num_ == 0) {
-            emit patchOperationsFinished();
-        }
-
-        if (result) {
-            startAutoUpdate();
-            update();
-        } else {
-            qCritical() << "DatManager initialisation error!!!";
-        }
-    }
-    if (operation_name == "createBackup" || operation_name == "restoreFromBackup" || operation_name == "removeBackup") {
-        if (operation_name == "createBackup" && result) {
-            Settings::setValue("Backup/installed", true);
-            Settings::setValue("Backup/creation_time", QDateTime::currentDateTime().toString("dd-MM-yyyy HH:mm:ss"));
-        }
-
-        if (operation_name == "removeBackup" && result) {
-            Settings::setValue("Backup/installed", false);
-            Settings::setValue("Backup/creation_time", "none");
-        }
-
-        emit backupSettingsInfoChanged();
-
-        --active_operations_num_;
-        if (active_operations_num_ == 0) {
-            emit patchOperationsFinished();
-        }
-    }
-}
-
-void PatchList::onLotroManagerOperationStarted(QString operation_name, QVector<QVariant>)
-{
-    qDebug() << "LotroManager: operation started " << operation_name;
-}
-
-void PatchList::startAutoUpdate()
-{
-    auto_updates_enabled_ = true;
-    patch_update_timer.start();
-}
-
-void PatchList::stopAutoUpdate()
-{
-    patch_update_timer.stop();
-    auto_updates_enabled_ = false;
-}
-
-void PatchList::initialize() {
-    ++active_operations_num_;
-    emit patchOperationsStarted();
-    QMetaObject::invokeMethod(lotro_mgr_, &LotroDatManager::initializeManager, Qt::QueuedConnection);
-}
-
-void PatchList::createBackup()
-{
-    if (active_operations_num_ > 0) {
-        qWarning() << "Tried to start create backup operation, while others are still running!";
-        return;
-    }
-
-    ++active_operations_num_;
-    emit patchOperationsStarted();
-    QMetaObject::invokeMethod(lotro_mgr_, "createBackup", Qt::QueuedConnection);
-}
-
-void PatchList::restoreFromBackup()
-{
-    if (active_operations_num_ > 0) {
-        qWarning() << "Tried to start restore from backup operation, while others are still running!";
-        return;
-    }
-
-    ++active_operations_num_;
-    emit patchOperationsStarted();
-    QMetaObject::invokeMethod(lotro_mgr_, "restoreFromBackup", Qt::QueuedConnection);
-}
-
-void PatchList::removeBackup()
-{
-    if (active_operations_num_ > 0) {
-        qWarning() << "Tried to start remove backup operation, while others are still running!";
-        return;
-    }
-
-    ++active_operations_num_;
-    emit patchOperationsStarted();
-    QMetaObject::invokeMethod(lotro_mgr_, "removeBackup", Qt::QueuedConnection);
-}
-
-void PatchList::onPatchOperationStarted(Patch::Operation, Patch*)
-{
-    if (active_operations_num_ == 0) {
-        emit patchOperationsStarted();
-    }
-    ++active_operations_num_;
-}
-
-void PatchList::onPatchOperationFinished(Patch::Operation, Patch*)
-{
-    --active_operations_num_;
-    if (active_operations_num_ == 0) {
-        cleanUpPatchDirectory();
-        emit patchOperationsFinished();
-    }
-}
-
-void PatchList::update()
-{
-    if (active_operations_num_ > 0) {
-        qWarning() << "Tried to start patch update chain, while there are already some operations on them!";
-        return;
-    }
-    qInfo() << "PatchList: Starting update chain!";
-    for (Patch* patch : getPatchList()) {
-        QMetaObject::invokeMethod(patch, "enqueue",
-                                  Q_ARG(QList<Patch::Operation>,
-                                        QList<Patch::Operation>({Patch::E_CHECKFORUPDATES,
-                                                                 Patch::E_DOWNLOAD,
-                                                                 Patch::E_INSTALL,
-                                                                 Patch::E_ACTIVATE})));
-    }
-}
-
-void PatchList::forceInstallPatches()
-{
-    if (active_operations_num_ > 0) {
-        qWarning() << "Trying to start force patch installation, while there are already some operations running!";
-    	return;
-    }
-
-    auto is_database_enabled = [](QString db_name) -> bool {
-        return Settings::getValue("DatabaseDownload/" + db_name).toBool();
-    };
-
-    for (const QString& db_name : QStringList(
-            {"text", "font", "image", "loadscreen", "texture", "sound", "video", "micro"})) {
-        Settings::setValue("DatabaseNeedInstall/" + db_name, is_database_enabled(db_name));
-    }
-
-    update();
-}
-
-void PatchList::cleanUpPatchDirectory()
-{
-    QStringList databases_filenames;
-
-    QSettings settings;
-    settings.beginGroup("PatchDatabases/");
-    qDebug() << "cleanUpPatchDirectory: Iterating through groups: " << settings.childGroups();
-
-    for (const QString& key : settings.childGroups()) {
-        settings.beginGroup(key);
-        QString filename = settings.value("path").toString();
-        if (!filename.isEmpty()) {
-            databases_filenames << filename;
-        }
-        settings.endGroup();
-    }
-    settings.endGroup();
-
-    QDirIterator patch_dir_iterator(
-                    Settings::getValue("General/PatchDownloadDir").toString(),
-                    QDir::NoDotAndDotDot | QDir::Files,
-                    QDirIterator::Subdirectories
-                );
-
-    while (patch_dir_iterator.hasNext()) {
-        qDebug() << "cleanUpPatchDirectory: found " << patch_dir_iterator.next();
-        bool is_file_actual = false;
-        for (const QString& file_path : databases_filenames) {
-            if (QFileInfo(file_path) == patch_dir_iterator.fileInfo()) {
-                is_file_actual = true;
-                break;
-            }
-        }
-
-        if (!is_file_actual) {
-            qDebug() << "cleanUpPatchDirectory: file" << patch_dir_iterator.filePath()
-                     << "is not in patch list. Removing";
-
-            QFile::remove(patch_dir_iterator.filePath());
-        }
-    }
-}

+ 0 - 84
src/Legacy/models/patchlist.h

@@ -1,84 +0,0 @@
-#ifndef PATCHLIST_H
-#define PATCHLIST_H
-
-#include <QObject>
-#include <QTimer>
-#include <QThread>
-#include <QList>
-
-#include "legacyapplication.h"
-
-#include "models/patch/patch.h"
-#include "models/patch/textspatch.h"
-#include "models/patch/graphicspatch.h"
-#include "models/patch/soundspatch.h"
-#include "models/patch/videospatch.h"
-
-class PatchList : public QObject
-{
-    Q_OBJECT
-public:
-    explicit PatchList(LotroDatManager* mgr, QObject *parent = nullptr);
-
-    ~PatchList();
-
-    QList<Patch *> getPatchList();
-
-    LotroDatManager* getManager();
-signals:
-    void progressChanged(Patch::OperationProgress total_status);
-    void patchOperationsStarted();
-    void patchOperationsFinished();
-    void backupSettingsInfoChanged();
-
-public slots:
-    void startAutoUpdate();
-
-    void stopAutoUpdate();
-
-    void update();
-
-    void initialize();
-
-    void createBackup();
-
-    void restoreFromBackup();
-
-    void removeBackup();
-
-    void forceInstallPatches();
-
-    void cleanUpPatchDirectory();
-private slots:
-    void onPatchOperationStarted(Patch::Operation operation, Patch* patch);
-    void onPatchOperationFinished(Patch::Operation operation, Patch* patch);
-    void onPatchOperationProgressChanged(Patch::OperationProgress operation_progress, Patch* patch);
-
-private slots:
-    void onLotroManagerOperationFinished(QString operation_name, QVector<QVariant> args, bool result);
-    void onLotroManagerOperationStarted(QString operation_name, QVector<QVariant> args);
-
-private:
-    LotroDatManager *lotro_mgr_ = nullptr;
-    bool lotro_mgr_initialised_ = false;
-    bool operations_running_ = false;
-
-    TextsPatch *texts_patch_ = nullptr;
-    GraphicsPatch *graphics_patch_ = nullptr;
-    SoundsPatch *sounds_patch_ = nullptr;
-    VideosPatch *videos_patch_ = nullptr;
-
-    QThread *texts_patch_thread_;
-    QThread *graphics_patch_thread_ = nullptr;
-    QThread *sounds_patch_thread_ = nullptr;
-    QThread *videos_patch_thread_ = nullptr;
-
-    QMap<Patch*, Patch::OperationProgress> patch_operations_status_;
-
-    quint32 active_operations_num_ = 0;
-    bool auto_updates_enabled_ = false;
-
-    QTimer patch_update_timer;    
-};
-
-#endif // PATCHLIST_H

+ 1 - 1
src/Legacy/widgets/aboutwidget.cpp

@@ -1,12 +1,12 @@
 #include "ui_aboutwidget.h"
 
-#include "models/patchlist.h"
 #include "models/settings.h"
 #include "constants.h"
 
 #include "widgets/aboutwidget.h"
 
 #include <QDesktopServices>
+#include <QUrl>
 
 AboutWidget::AboutWidget(QWidget *parent)
     : QWidget(parent)

+ 6 - 4
src/Legacy/widgets/chooseversiondialog.cpp

@@ -2,11 +2,11 @@
 #include "ui_chooseversiondialog.h"
 
 #include "models/settings.h"
+#include "models/patchinstaller.h"
 #include "widgets/mainwindow.h"
 #include "constants.h"
 
-ChooseVersionDialog::ChooseVersionDialog(LotroDatManager* mgr, QWidget *parent) :
-    mgr_(mgr),
+ChooseVersionDialog::ChooseVersionDialog(QWidget *parent) :
     QWidget(parent),
     ui(new Ui::ChooseVersionDialog)
 {
@@ -42,14 +42,16 @@ void ChooseVersionDialog::on_start_patched_clicked()
 {
     ui->wait_widget->show();
     ui->cancel_widget->hide();
-    QMetaObject::invokeMethod(mgr_, "startGame", Qt::QueuedConnection, Q_ARG(bool, true));
+    QMetaObject::invokeMethod(&PatchInstaller::instance(), "startGame",
+                              Qt::QueuedConnection, Q_ARG(bool, true));
 }
 
 void ChooseVersionDialog::on_start_original_clicked()
 {
     ui->wait_widget->show();
     ui->cancel_widget->hide();
-    QMetaObject::invokeMethod(mgr_, "startGame", Qt::QueuedConnection, Q_ARG(bool, false));
+    QMetaObject::invokeMethod(&PatchInstaller::instance(), "startGame",
+                              Qt::QueuedConnection, Q_ARG(bool, false));
 }
 
 void ChooseVersionDialog::on_cancel_clicked()

+ 2 - 3
src/Legacy/widgets/chooseversiondialog.h

@@ -4,7 +4,7 @@
 #include <QDialog>
 #include <QMouseEvent>
 #include <QSettings>
-#include "models/lotrodatmanager.h"
+#include "models/patchinstaller.h"
 
 class PatchDownloader;
 class LotroDatManager;
@@ -18,7 +18,7 @@ class ChooseVersionDialog : public QWidget
     Q_OBJECT
 
 public:
-    explicit ChooseVersionDialog(LotroDatManager* mgr, QWidget *parent = 0);
+    explicit ChooseVersionDialog(QWidget *parent = 0);
     ~ChooseVersionDialog();
 
 public slots:
@@ -44,7 +44,6 @@ signals:
 private:
     Ui::ChooseVersionDialog *ui;
     QPoint dragPosition;
-    LotroDatManager* mgr_;
 };
 
 #endif // CHOOSEVERSIONDIALOG_H

+ 0 - 2
src/Legacy/widgets/helpwidget.cpp

@@ -1,7 +1,5 @@
 #include "ui_HelpWidget.h"
 
-#include "models/patchlist.h"
-
 #include "widgets/helpwidget.h"
 
 #include <QDebug>

+ 2 - 2
src/Legacy/widgets/mainwindow.cpp

@@ -5,7 +5,7 @@
 #include "widgets/chooseversiondialog.h"
 #include "widgets/dialogwindow.h"
 #include "models/patchdownloader.h"
-#include "models/lotrodatmanager.h"
+#include "models/patchinstaller.h"
 
 #include <QBitmap>
 #include <QPainter>
@@ -49,7 +49,7 @@ MainWindow::MainWindow(QWidget *parent)
 
     qDebug() << __FUNCTION__ << "Initialising main frame...";
     status_widget_ = new StatusWidget(this);
-    settings_widget_ = new SettingsWidget(nullptr, this);
+    settings_widget_ = new SettingsWidget(this);
     help_widget_ = new HelpWidget(this);
     about_widget_ = new AboutWidget(this);
 

+ 7 - 8
src/Legacy/widgets/settingswidget.cpp

@@ -1,7 +1,7 @@
 #include "ui_settingswidget.h"
 
 #include "models/settings.h"
-#include "models/patchlist.h"
+#include "models/filesystem.h"
 
 #include "widgets/settingswidget.h"
 #include "widgets/mainwindow.h"
@@ -16,10 +16,9 @@
 
 using namespace SettingsWidgetPrivate;
 
-SettingsWidget::SettingsWidget(PatchList *legacy_patches, QWidget *parent)
+SettingsWidget::SettingsWidget(QWidget *parent)
     : QWidget(parent)
     , ui(new Ui::SettingsWidget)
-    , legacy_patches_(legacy_patches)
 {
     settings_changed_ = false;
 
@@ -197,7 +196,7 @@ void SettingsWidget::resizeEvent(QResizeEvent *)
     ui->apply_changes_button->setMinimumSize(QSize(160, 60) * coefficient);
 }
 
-void SettingsWidget::onLotroManagerProcessChanged(LotroDatManager::Status status)
+void SettingsWidget::onLotroManagerProcessChanged(PatchInstaller::Status status)
 {
 //    if (status.status != LOTRO_DAT::DatStatus::E_BACKUP_CREATING &&
 //            status.status != LOTRO_DAT::DatStatus::E_BACKUP_REMOVING &&
@@ -334,7 +333,7 @@ void SettingsWidget::on_backup_create_button_clicked()
         }
     }
 
-    QMetaObject::invokeMethod(legacy_patches_, "createBackup", Qt::QueuedConnection);
+//    QMetaObject::invokeMethod(legacy_patches_, "createBackup", Qt::QueuedConnection);
 }
 
 void SettingsWidget::on_backup_restore_button_clicked()
@@ -349,7 +348,7 @@ void SettingsWidget::on_backup_restore_button_clicked()
         return;
     }
 
-    QMetaObject::invokeMethod(legacy_patches_, "restoreFromBackup", Qt::QueuedConnection);
+//    QMetaObject::invokeMethod(legacy_patches_, "restoreFromBackup", Qt::QueuedConnection);
 }
 
 void SettingsWidget::on_backup_remove_button_clicked()
@@ -364,7 +363,7 @@ void SettingsWidget::on_backup_remove_button_clicked()
         return;
     }
 
-    QMetaObject::invokeMethod(legacy_patches_, "removeBackup", Qt::QueuedConnection);
+//    QMetaObject::invokeMethod(legacy_patches_, "removeBackup", Qt::QueuedConnection);
 }
 
 void SettingsWidget::on_patch_texts_checkbox_clicked()
@@ -458,7 +457,7 @@ void SettingsWidget::on_patch_video_checkbox_clicked()
 
 void SettingsWidget::on_patch_force_apply_button_clicked()
 {
-    QMetaObject::invokeMethod(legacy_patches_, "forceInstallPatches");
+//    QMetaObject::invokeMethod(legacy_patches_, "forceInstallPatches");
 }
 
 void SettingsWidget::on_micropatch_checkbox_clicked()

+ 3 - 6
src/Legacy/widgets/settingswidget.h

@@ -13,13 +13,12 @@
 #include <QWheelEvent>
 
 #include "models/settings.h"
-#include "models/lotrodatmanager.h"
+#include "models/patchinstaller.h"
 
 namespace Ui {
 class SettingsWidget;
 }
 
-class PatchList;
 
 namespace SettingsWidgetPrivate {
 
@@ -103,7 +102,7 @@ class SettingsWidget : public QWidget
 
 public:
 
-    explicit SettingsWidget(PatchList *legacy_patches, QWidget *parent = 0);
+    explicit SettingsWidget(QWidget *parent = 0);
 
     ~SettingsWidget();
 
@@ -123,7 +122,7 @@ protected:
     void resizeEvent(QResizeEvent *event) override;
 
 private slots:
-    void onLotroManagerProcessChanged(LotroDatManager::Status status);
+    void onLotroManagerProcessChanged(PatchInstaller::Status status);
 
     void onBackupSettingsInfoChanged();
 
@@ -179,8 +178,6 @@ private:
 
     Ui::SettingsWidget *ui = nullptr;
 
-    PatchList *legacy_patches_ = nullptr;
-
     SettingsWidgetPrivate::ComboboxScrollingDisabler* combobox_scrolling_disabler = nullptr;
     SettingsWidgetPrivate::SettingsTabsScroller* scroller = nullptr;
 

+ 21 - 21
src/Legacy/widgets/statuswidget.cpp

@@ -266,27 +266,27 @@ void StatusWidget::on_game_button_clicked()
     window->showChooseVersionDialog();
 }
 
-void StatusWidget::updatePatchProgressStatus(Patch::OperationProgress progress)
-{
-    if (last_statusbar_update_time_.elapsed() > 200) {
-        QString text = "Выполнение операций...";
-        if (progress.download_total_bytes != 0) {
-            text += "\nЗагрузка данных: " + QString::number(progress.getDownloadPercent(), 'f', 1) + "% ("
-                    + Downloader::getSizeFormatted(progress.download_finished_bytes) + "/"
-                    + Downloader::getSizeFormatted(progress.download_total_bytes) + ", "
-                    + Downloader::getSpeedFormatted(progress.download_speed) + ")\n"
-                    + "До конца загрузки: " + Downloader::getElapsedTimeFormatted(progress.download_elapsed_time);
-        }
-
-        if (progress.install_total_parts != 0) {
-            text += "\nПрименение патчей: " + QString::number(progress.getInstallPercent()) + "% "
-                    + "(часть " + QString::number(progress.install_finished_parts + 1) + " из " + QString::number(progress.install_total_parts);
-        }
-
-        setToolTipMessage(text, E_PROCESS);
-        last_statusbar_update_time_.restart();
-    }
-}
+//void StatusWidget::updatePatchProgressStatus(Patch::OperationProgress progress)
+//{
+//    if (last_statusbar_update_time_.elapsed() > 200) {
+//        QString text = "Выполнение операций...";
+//        if (progress.download_total_bytes != 0) {
+//            text += "\nЗагрузка данных: " + QString::number(progress.getDownloadPercent(), 'f', 1) + "% ("
+//                    + Downloader::getSizeFormatted(progress.download_finished_bytes) + "/"
+//                    + Downloader::getSizeFormatted(progress.download_total_bytes) + ", "
+//                    + Downloader::getSpeedFormatted(progress.download_speed) + ")\n"
+//                    + "До конца загрузки: " + Downloader::getElapsedTimeFormatted(progress.download_elapsed_time);
+//        }
+
+//        if (progress.install_total_parts != 0) {
+//            text += "\nПрименение патчей: " + QString::number(progress.getInstallPercent()) + "% "
+//                    + "(часть " + QString::number(progress.install_finished_parts + 1) + " из " + QString::number(progress.install_total_parts);
+//        }
+
+//        setToolTipMessage(text, E_PROCESS);
+//        last_statusbar_update_time_.restart();
+//    }
+//}
 
 void StatusWidget::createTooltipMessageWidget(QString tooltip_id)
 {

+ 3 - 3
src/Legacy/widgets/statuswidget.h

@@ -9,8 +9,8 @@
 #include <QGraphicsOpacityEffect>
 #include <QLabel>
 
-#include "models/patchlist.h"
 #include "legacyapplication.h"
+#include "models/downloader.h"
 
 namespace Ui {
 class StatusWidget;
@@ -58,7 +58,7 @@ private slots:
 
     void onPatchDownloaderProgressChanged(Downloader::Status status);
 
-    void updatePatchProgressStatus(Patch::OperationProgress progress);
+//    void updatePatchProgressStatus(Patch::OperationProgress progress);
 
     void on_game_button_clicked();
 
@@ -77,7 +77,7 @@ private:
     QMap<QString, QPropertyAnimation*> tooltip_animations_;
     QString current_tooltip_message_;
 
-    QMap<Patch*, Patch::Operation> patch_operations;
+//    QMap<Patch*, Patch::Operation> patch_operations;
 
     QTime last_statusbar_update_time_;