diff --git a/plugins/notifications/notification.cpp b/plugins/notifications/notification.cpp --- a/plugins/notifications/notification.cpp +++ b/plugins/notifications/notification.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -33,7 +34,8 @@ Notification::Notification(const NetworkPackage& np, QObject* parent) : QObject(parent) { - mImagesDir = QDir::temp().absoluteFilePath(QStringLiteral("kdeconnect")); + // Use CacheLocation instead of TempLocation because TempLocation may be accessible system-wide + mImagesDir = QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); mImagesDir.mkpath(mImagesDir.absolutePath()); mClosed = false; @@ -113,6 +115,7 @@ } else { mIconPath = mImagesDir.absoluteFilePath(filename); QUrl destinationUrl(mIconPath); + destinationUrl.setScheme(QStringLiteral("file")); FileTransferJob* job = np.createPayloadTransferJob(destinationUrl); job->start(); connect(job, &FileTransferJob::result, this, &Notification::applyIconAndShow);