Messagelib
6 #include "localdatabasemanager.h"
7 #include "backoffmodemanager.h"
8 #include "checkphishingurlutil.h"
9 #include "createdatabasefilejob.h"
10 #include "localdatabasemanager_p.h"
11 #include "urlhashing.h"
12 #include "webengineviewer_debug.h"
14 #include <KSharedConfig>
16 #include <QCryptographicHash>
18 using namespace WebEngineViewer;
22 LocalDataBaseManager::LocalDataBaseManager(LocalDataBaseManagerPrivate *impl,
QObject *parent)
26 qRegisterMetaType<WebEngineViewer::UpdateDataBaseInfo>();
27 qRegisterMetaType<WebEngineViewer::CreatePhishingUrlDataBaseJob::DataBaseDownloadResult>();
28 qRegisterMetaType<WebEngineViewer::CreatePhishingUrlDataBaseJob::ContraintsCompressionType>();
31 LocalDataBaseManager::LocalDataBaseManager(
QObject *parent)
36 LocalDataBaseManager::~LocalDataBaseManager() =
default;
38 void LocalDataBaseManager::initialize()
43 void LocalDataBaseManager::checkUrl(
const QUrl &url)
47 WebEngineViewer::UrlHashing urlHashing(url);
61 Q_EMIT checkUrlFinished(url, WebEngineViewer::CheckPhishingUrlUtil::Ok);
64 if (d->mNewClientState.isEmpty()) {
65 qCWarning(WEBENGINEVIEWER_LOG) <<
"Database client state is unknown";
66 Q_EMIT checkUrlFinished(url, WebEngineViewer::CheckPhishingUrlUtil::Unknown);
69 job->setDatabaseState(
QStringList() << d->mNewClientState);
70 job->setSearchHashs(conflictHashs);
71 job->setSearchFullHashForUrl(url);
72 connect(job, &SearchFullHashJob::result,
this, [
this](CheckPhishingUrlUtil::UrlStatus
status,
const QUrl &url) {
73 Q_EMIT checkUrlFinished(url,
status);
79 qCWarning(WEBENGINEVIEWER_LOG) <<
"Database not ok";
80 Q_EMIT checkUrlFinished(url, WebEngineViewer::CheckPhishingUrlUtil::Unknown);
82 if (d->mFile.checkFileChanged()) {
The LocalDataBaseManager class.
QByteArray toBase64(QByteArray::Base64Options options) const const
QHash::iterator insert(const Key &key, const T &value)
Q_GLOBAL_STATIC(Internal::StaticControl, s_instance) class ControlPrivate
Q_SCRIPTABLE CaptureState status()
bool contains(char ch) const const
bool isEmpty() const const
The SearchFullHashJob class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:08:11 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.