Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/widgets/fullscreenbackground.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2011 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -743,16 +743,24 @@ QString FullScreenBackground::sizeToString(const QSize &size)

bool FullScreenBackground::getScaledBlurImage(const QString &originPath, QString &scaledPath)
{
#ifndef ENABLE_DSS_SNIPE
// 为了兼容没有安装壁纸服务环境;Qt5.15高版本可以使用activatableServiceNames()遍历然后可判断系统有没有安装服务
const QString wallpaperServicePath = "/lib/systemd/system/dde-wallpaper-cache.service";
if (!QFile::exists(wallpaperServicePath)) {
qWarning() << "dde-wallpaper-cache service not existed";
return false;
}
#endif

// 壁纸服务dde-wallpaper-cache
QDBusInterface wallpaperCacheInterface("org.deepin.dde.WallpaperCache", "/org/deepin/dde/WallpaperCache",
"org.deepin.dde.WallpaperCache", QDBusConnection::systemBus());
#ifdef ENABLE_DSS_SNIPE
if (!wallpaperCacheInterface.isValid()) {
qWarning() << "dde-wallpaper-cache service not existed";
return false;
}
#endif

QFile file(originPath);
if (!file.open(QIODevice::ReadOnly)) {
Expand All @@ -775,6 +783,8 @@ bool FullScreenBackground::getScaledBlurImage(const QString &originPath, QString
return false;
}

file.close();

QString path = pathList.value().at(0);
if (!path.isEmpty() && path != originPath) {
scaledPath = path;
Expand Down
Loading