Commit 826e4142 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Make sure the new avatar is always saved

Summary:
The KIO job needs to be run synchronously, otherwise the KCM might be
deleted before the job finished. This happens when closing the KCM
module with the Ok button, or when closing the System Settings window
and clicking Apply.

BUG: 350836
FIXED-IN: 5.8.7

Test Plan: Change avatar from System Settings, then close System Settings and click Apply.

Reviewers: #plasma, jriddell

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5779
parent 78bfa370
......@@ -188,7 +188,8 @@ bool AccountInfo::save()
KIO::CopyJob* moveJob = KIO::move(QUrl::fromLocalFile(path), QUrl::fromLocalFile(faceFile), KIO::HideProgressInfo);
connect(moveJob, SIGNAL(finished(KJob*)), SLOT(avatarModelChanged(KJob*)));
moveJob->setUiDelegate(0);
moveJob->start();
// Run it synchronously to be sure the job ends before the KCM gets deleted.
moveJob->exec();
QString faceFile2 = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
faceFile2.append(QLatin1String("/.face.icon"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment