File indexing completed on 2025-03-09 04:54:55

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "webengineviewer_private_export.h"
0010 #include <QThread>
0011 #include <WebEngineViewer/CreatePhishingUrlDataBaseJob>
0012 namespace WebEngineViewer
0013 {
0014 class WEBENGINEVIEWER_TESTS_EXPORT DownloadLocalDatabaseThread : public QThread
0015 {
0016     Q_OBJECT
0017 public:
0018     explicit DownloadLocalDatabaseThread(QObject *parent = nullptr);
0019     ~DownloadLocalDatabaseThread() override;
0020 
0021     void setDataBaseState(const QString &value);
0022 
0023     void setDatabaseFullPath(const QString &databaseFullPath);
0024 
0025 Q_SIGNALS:
0026     void createDataBaseFinished(bool success, const QString &newClientState, const QString &minimumWaitDurationStr);
0027     void createDataBaseFailed();
0028 
0029 protected:
0030     void run() override;
0031 
0032 private:
0033     void installNewDataBase(const WebEngineViewer::UpdateDataBaseInfo &infoDataBase);
0034     void slotDownloadDataBaseFinished(const WebEngineViewer::UpdateDataBaseInfo &infoDataBase,
0035                                       WebEngineViewer::CreatePhishingUrlDataBaseJob::DataBaseDownloadResult status);
0036     void slotCreateDataBaseFileNameFinished(bool success, const QString &newClientState, const QString &minimumWaitDurationStr);
0037     QString mCurrentDataBaseState;
0038     QString mDatabaseFullPath;
0039 };
0040 }