summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/cutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/src/Caelestia/cutils.cpp')
-rw-r--r--plugin/src/Caelestia/cutils.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugin/src/Caelestia/cutils.cpp b/plugin/src/Caelestia/cutils.cpp
index e93a590..f0902c3 100644
--- a/plugin/src/Caelestia/cutils.cpp
+++ b/plugin/src/Caelestia/cutils.cpp
@@ -87,10 +87,6 @@ void CUtils::saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, Q
});
}
-bool CUtils::copyFile(const QUrl& source, const QUrl& target) const {
- return this->copyFile(source, target, true);
-}
-
bool CUtils::copyFile(const QUrl& source, const QUrl& target, bool overwrite) const {
if (!source.isLocalFile()) {
qWarning() << "CUtils::copyFile: source" << source << "is not a local file";
@@ -108,6 +104,15 @@ bool CUtils::copyFile(const QUrl& source, const QUrl& target, bool overwrite) co
return QFile::copy(source.toLocalFile(), target.toLocalFile());
}
+bool CUtils::deleteFile(const QUrl& path) const {
+ if (!path.isLocalFile()) {
+ qWarning() << "CUtils::deleteFile: path" << path << "is not a local file";
+ return false;
+ }
+
+ return QFile::remove(path.toLocalFile());
+}
+
void CUtils::getDominantColour(QQuickItem* item, QJSValue callback) {
this->getDominantColour(item, 128, callback);
}