Files
Andrey BocharnikovandCursor 319bb5d093 feat(browser): move browser preferences to the DB (#21015)
* feat(preferences): add secure storage for app settings (#7460)

* Should replace QSettings that are stored in files

refs status-im/status-app#20922

* chore(browser): extract browser preference key constants

* chore(browser): store base type

* fix(browser): align default JPEG quality with snapshot persistence

Set ImageEncoderUtils default quality to 65 so the C++ API default matches the browser snapshot persister behavior and avoids confusion about expected output quality.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(browser): register BrowserSessionUtils as shared QML library

Load BrowserSessionUtils through the webview module and mark it as a shared JS library so it can be reused across browser session components with consistent import wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(browser): add missing file

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 16:02:10 +02:00

25 lines
523 B
C++

#pragma once
#include <QObject>
#include <QImage>
class QJSEngine;
class QQmlEngine;
class QUrl;
class ImageEncoderUtils : public QObject
{
Q_OBJECT
explicit ImageEncoderUtils(QQmlEngine *engine);
public:
Q_INVOKABLE QString encodeJpegBase64(const QImage &image, int quality = 65) const;
Q_INVOKABLE QString encodeJpegBase64FromUrl(const QUrl &url, int quality = 65) const;
static QObject *qmlInstance(QQmlEngine *engine, QJSEngine *scriptEngine);
private:
QQmlEngine *m_engine = nullptr;
};