summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/cachingimagemanager.hpp
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-13 14:38:44 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-13 14:38:44 +1000
commit306cfc06ed38a2f86616c1f2fe64de45321f21a6 (patch)
treea27c79d9c4d01c2dadeeae74c844875ab7ab4eed /plugin/src/Caelestia/cachingimagemanager.hpp
parentpopouts/tray: better interaction (diff)
downloadcaelestia-shell-306cfc06ed38a2f86616c1f2fe64de45321f21a6.tar.gz
caelestia-shell-306cfc06ed38a2f86616c1f2fe64de45321f21a6.tar.bz2
caelestia-shell-306cfc06ed38a2f86616c1f2fe64de45321f21a6.zip
plugin: refactor into modules
Diffstat (limited to 'plugin/src/Caelestia/cachingimagemanager.hpp')
-rw-r--r--plugin/src/Caelestia/cachingimagemanager.hpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/plugin/src/Caelestia/cachingimagemanager.hpp b/plugin/src/Caelestia/cachingimagemanager.hpp
deleted file mode 100644
index f05ea34..0000000
--- a/plugin/src/Caelestia/cachingimagemanager.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-#pragma once
-
-#include <QtQuick/qquickitem.h>
-#include <qobject.h>
-#include <qqmlintegration.h>
-
-namespace caelestia {
-
-class CachingImageManager : public QObject {
- Q_OBJECT
- QML_ELEMENT
-
- Q_PROPERTY(QQuickItem* item READ item WRITE setItem NOTIFY itemChanged REQUIRED)
- Q_PROPERTY(QUrl cacheDir READ cacheDir WRITE setCacheDir NOTIFY cacheDirChanged REQUIRED)
-
- Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
- Q_PROPERTY(QUrl cachePath READ cachePath NOTIFY cachePathChanged)
-
-public:
- explicit CachingImageManager(QObject* parent = nullptr)
- : QObject(parent)
- , m_item(nullptr) {}
-
- [[nodiscard]] QQuickItem* item() const;
- void setItem(QQuickItem* item);
-
- [[nodiscard]] QUrl cacheDir() const;
- void setCacheDir(const QUrl& cacheDir);
-
- [[nodiscard]] QString path() const;
- void setPath(const QString& path);
-
- [[nodiscard]] QUrl cachePath() const;
-
- Q_INVOKABLE void updateSource();
- Q_INVOKABLE void updateSource(const QString& path);
-
-signals:
- void itemChanged();
- void cacheDirChanged();
-
- void pathChanged();
- void cachePathChanged();
- void usingCacheChanged();
-
-private:
- QString m_shaPath;
-
- QQuickItem* m_item;
- QUrl m_cacheDir;
-
- QString m_path;
- QUrl m_cachePath;
-
- QMetaObject::Connection m_widthConn;
- QMetaObject::Connection m_heightConn;
-
- [[nodiscard]] qreal effectiveScale() const;
- [[nodiscard]] QSize effectiveSize() const;
-
- void createCache(const QString& path, const QString& cache, const QString& fillMode, const QSize& size) const;
- [[nodiscard]] static QString sha256sum(const QString& path);
-};
-
-} // namespace caelestia