diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-11 22:34:04 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-11 22:34:04 +1000 |
| commit | ca8c56d473c3c7d5af9f3122633890474ce9b1e8 (patch) | |
| tree | 793f8abec53c4c65a984558f93646be8a1954c2b /plugin/src/Caelestia/requests.hpp | |
| parent | plugin: format + refactor (diff) | |
| download | caelestia-shell-ca8c56d473c3c7d5af9f3122633890474ce9b1e8.tar.gz caelestia-shell-ca8c56d473c3c7d5af9f3122633890474ce9b1e8.tar.bz2 caelestia-shell-ca8c56d473c3c7d5af9f3122633890474ce9b1e8.zip | |
plugin: add requests
Replaces QML Requests singleton
Diffstat (limited to 'plugin/src/Caelestia/requests.hpp')
| -rw-r--r-- | plugin/src/Caelestia/requests.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/plugin/src/Caelestia/requests.hpp b/plugin/src/Caelestia/requests.hpp new file mode 100644 index 0000000..1db2f4c --- /dev/null +++ b/plugin/src/Caelestia/requests.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include <qnetworkaccessmanager.h> +#include <qobject.h> +#include <qqmlengine.h> + +namespace caelestia { + +class Requests : public QObject { + Q_OBJECT + QML_ELEMENT + QML_SINGLETON + +public: + explicit Requests(QObject* parent = nullptr); + + Q_INVOKABLE void get(const QUrl& url, QJSValue callback, QJSValue onError = QJSValue()) const; + +private: + QNetworkAccessManager* m_manager; +}; + +} // namespace caelestia |