diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-14 16:59:19 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-14 16:59:19 +1000 |
| commit | 4b221e2fd5b7faf4747cff6c590b6ddc38870901 (patch) | |
| tree | 3041635aa0e94a7783410ccf76424143060fa605 /plugin/src/Caelestia/cutils.cpp | |
| parent | internal: close panels when fullscreen app (diff) | |
| download | caelestia-shell-4b221e2fd5b7faf4747cff6c590b6ddc38870901.tar.gz caelestia-shell-4b221e2fd5b7faf4747cff6c590b6ddc38870901.tar.bz2 caelestia-shell-4b221e2fd5b7faf4747cff6c590b6ddc38870901.zip | |
utilities: add recording control
Diffstat (limited to 'plugin/src/Caelestia/cutils.cpp')
| -rw-r--r-- | plugin/src/Caelestia/cutils.cpp | 13 |
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); } |