mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: 获取到应用程序的预览图后删除产生的临时文件
通过KWin接口获取到应用的缩略图后及时删除临时文件,避免临时文件过多占用硬盘空间 Log: 修复/tmp目录下有很多Kwin的截图的问题 Bug: https://pms.uniontech.com/bug-view-113822.html Influence: 预览时不会在tmp目录产生临时文件 Change-Id: I258425279b6cb7448d9636308e2a1e65eec010fe
This commit is contained in:
parent
49d37a6c06
commit
b377b0136c
@ -222,8 +222,14 @@ void AppSnapshot::fetchSnapshot()
|
|||||||
|
|
||||||
QDBusReply<QString> reply = interface.callWithArgumentList(QDBus::Block,QStringLiteral("screenshotForWindowExtend"), args);
|
QDBusReply<QString> reply = interface.callWithArgumentList(QDBus::Block,QStringLiteral("screenshotForWindowExtend"), args);
|
||||||
if(reply.isValid()){
|
if(reply.isValid()){
|
||||||
m_snapshot.load(reply.value());
|
const QString tmpFile = reply.value();
|
||||||
qDebug() << "reply: "<<reply.value();
|
if (QFile::exists(tmpFile)) {
|
||||||
|
m_snapshot.load(tmpFile);
|
||||||
|
qDebug() << "reply: " << tmpFile;
|
||||||
|
QFile::remove(tmpFile);
|
||||||
|
} else {
|
||||||
|
qDebug() << "get current workspace bckground error, file does not exist : " << tmpFile;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "get current workspace bckground error: "<< reply.error().message();
|
qDebug() << "get current workspace bckground error: "<< reply.error().message();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user