summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-09-30 15:07:34 (GMT)
committerTobias Markmann <tm@ayena.de>2016-09-30 15:07:34 (GMT)
commitcb41a41239bd75db8a3ed6d5b3013104e393d0ad (patch)
treeee10953bf0fee961fddcd3ff41a3ad87fd650871
parent9abfaaa771f91010dbe01a1b9b5b9e2801956718 (diff)
downloadswift-cb41a41239bd75db8a3ed6d5b3013104e393d0ad.zip
swift-cb41a41239bd75db8a3ed6d5b3013104e393d0ad.tar.bz2
Only scale avatars that are not embedded Qt resources
The default avatar is a embedded SVG which doesn't need to be scaled specifically. Test-Information: Builds on macOS 10.12 with Qt 5.6.1 and tooltip avatars are still shown without an error message being logged. Change-Id: I5aff38856e97dee9133b1daf9039cabc063dc01c
-rw-r--r--Swift/QtUI/QtScaledAvatarCache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtScaledAvatarCache.cpp b/Swift/QtUI/QtScaledAvatarCache.cpp
index 8c37dac..37ea6a9 100644
--- a/Swift/QtUI/QtScaledAvatarCache.cpp
+++ b/Swift/QtUI/QtScaledAvatarCache.cpp
@@ -50,7 +50,7 @@ static QPixmap cropToBiggestCenteredSquare(const QPixmap& input) {
QString QtScaledAvatarCache::getScaledAvatarPath(const QString& path) {
QFileInfo avatarFile(path);
- if (avatarFile.exists()) {
+ if (avatarFile.exists() && !avatarFile.absolutePath().startsWith(":/")) {
QString cacheSubPath = QString("ScaledAvatarCacheV%1/%2").arg(QString::number(QT_SCALED_AVATAR_CACHE_VERSION), QString::number(size));
if (!avatarFile.dir().mkpath(cacheSubPath)) {
SWIFT_LOG(error) << "avatarFile.dir(): " << Q2PSTRING(avatarFile.dir().absolutePath()) << std::endl;