core: support qs. imports

This commit is contained in:
outfoxxed 2025-07-10 00:48:15 -07:00
parent 3d594e16dd
commit 4b35d7b51b
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
7 changed files with 123 additions and 35 deletions

View file

@ -45,6 +45,7 @@ class QsInterceptNetworkAccessManager: public QNetworkAccessManager {
public:
QsInterceptNetworkAccessManager(
const QDir& configRoot,
const QHash<QString, QString>& fileIntercepts,
QObject* parent = nullptr
);
@ -57,15 +58,21 @@ protected:
) override;
private:
QDir configRoot;
const QHash<QString, QString>& fileIntercepts;
};
class QsInterceptNetworkAccessManagerFactory: public QQmlNetworkAccessManagerFactory {
public:
QsInterceptNetworkAccessManagerFactory(const QHash<QString, QString>& fileIntercepts)
: fileIntercepts(fileIntercepts) {}
QsInterceptNetworkAccessManagerFactory(
const QDir& configRoot,
const QHash<QString, QString>& fileIntercepts
)
: configRoot(configRoot)
, fileIntercepts(fileIntercepts) {}
QNetworkAccessManager* create(QObject* parent) override;
private:
QDir configRoot;
const QHash<QString, QString>& fileIntercepts;
};