From 4b221e2fd5b7faf4747cff6c590b6ddc38870901 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 14 Sep 2025 16:59:19 +1000 Subject: utilities: add recording control --- plugin/src/Caelestia/cutils.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'plugin/src/Caelestia/cutils.cpp') 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); } -- cgit v1.2.3-freya