cache icons based on pixel content instead of image string
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtQuick/qquickitem.h>
|
||||
#include <qjsvalue.h>
|
||||
#include <qobject.h>
|
||||
#include <QImage>
|
||||
#include <QJSValue>
|
||||
#include <QObject>
|
||||
#include <qqmlintegration.h>
|
||||
#include <qurl.h>
|
||||
#include <QUrl>
|
||||
|
||||
namespace ZShell {
|
||||
|
||||
@@ -23,9 +24,9 @@ Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, QJSValue onSaved
|
||||
Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, QJSValue onSaved);
|
||||
Q_INVOKABLE void saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, QJSValue onSaved, QJSValue onFailed);
|
||||
|
||||
Q_INVOKABLE void saveImage(const QUrl& source, const QUrl& target);
|
||||
Q_INVOKABLE void saveImage(const QUrl& source, const QUrl& target, QJSValue onSaved);
|
||||
Q_INVOKABLE void saveImage(const QUrl& source, const QUrl& target, QJSValue onSaved, QJSValue onFailed);
|
||||
Q_INVOKABLE void cacheImage(const QUrl& source, const QString& cacheDir);
|
||||
Q_INVOKABLE void cacheImage(const QUrl& source, const QString& cacheDir, QJSValue onSaved);
|
||||
Q_INVOKABLE void cacheImage(const QUrl& source, const QString& cacheDir, QJSValue onSaved, QJSValue onFailed);
|
||||
// clang-format on
|
||||
|
||||
Q_INVOKABLE bool copyFile(const QUrl& source, const QUrl& target, bool overwrite = true) const;
|
||||
@@ -33,7 +34,7 @@ Q_INVOKABLE bool deleteFile(const QUrl& path) const;
|
||||
Q_INVOKABLE QString toLocalFile(const QUrl& url) const;
|
||||
|
||||
private:
|
||||
bool saveImageInternal(const QUrl& source, const QUrl& target) const;
|
||||
bool loadSourceImage(const QUrl& source, QImage& image) const;
|
||||
};
|
||||
|
||||
} // namespace ZShell
|
||||
|
||||
Reference in New Issue
Block a user