summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/cachingimagemanager.cpp
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-01 15:31:27 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-01 15:31:27 +1000
commitd76c799dd22a44621b557564ed9606e04ba40e34 (patch)
treeea9dc55c4ef52a94e34f818003727b4170b9103b /plugin/src/Caelestia/cachingimagemanager.cpp
parentcmake: more compiler warnings (diff)
downloadcaelestia-shell-d76c799dd22a44621b557564ed9606e04ba40e34.tar.gz
caelestia-shell-d76c799dd22a44621b557564ed9606e04ba40e34.tar.bz2
caelestia-shell-d76c799dd22a44621b557564ed9606e04ba40e34.zip
plugin: fix warnings + const stuff
Diffstat (limited to 'plugin/src/Caelestia/cachingimagemanager.cpp')
-rw-r--r--plugin/src/Caelestia/cachingimagemanager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugin/src/Caelestia/cachingimagemanager.cpp b/plugin/src/Caelestia/cachingimagemanager.cpp
index 63826ea..4f37171 100644
--- a/plugin/src/Caelestia/cachingimagemanager.cpp
+++ b/plugin/src/Caelestia/cachingimagemanager.cpp
@@ -23,7 +23,7 @@ int CachingImageManager::effectiveWidth() const {
return 0;
}
- int width = std::ceil(m_item->width() * effectiveScale());
+ int width = static_cast<int>(std::ceil(m_item->width() * effectiveScale()));
m_item->setProperty("sourceWidth", width);
return width;
}
@@ -33,7 +33,7 @@ int CachingImageManager::effectiveHeight() const {
return 0;
}
- int height = std::ceil(m_item->height() * effectiveScale());
+ int height = static_cast<int>(std::ceil(m_item->height() * effectiveScale()));
m_item->setProperty("sourceHeight", height);
return height;
}
@@ -109,7 +109,7 @@ void CachingImageManager::updateSource(const QString& path) {
m_shaPath = path;
- QPointer<CachingImageManager> self(this);
+ const QPointer<CachingImageManager> self(this);
QThreadPool::globalInstance()->start([path, self] {
const QString sha = self->sha256sum(path);
@@ -119,8 +119,8 @@ void CachingImageManager::updateSource(const QString& path) {
return;
}
- int width = self->effectiveWidth();
- int height = self->effectiveHeight();
+ const int width = self->effectiveWidth();
+ const int height = self->effectiveHeight();
if (!self->m_item || !width || !height) {
return;
@@ -144,7 +144,7 @@ void CachingImageManager::updateSource(const QString& path) {
return;
}
- QImageReader reader(cache.toLocalFile());
+ const QImageReader reader(cache.toLocalFile());
if (reader.canRead()) {
self->m_item->setProperty("source", cache);
} else {