Changeset View
Changeset View
Standalone View
Standalone View
src/accountinfo.cpp
Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Line(s) | 182 | if (m_infoToSave.contains(AccountModel::Face)) { | |||
---|---|---|---|---|---|
183 | const QString path = m_infoToSave[AccountModel::Face].toString(); | 183 | const QString path = m_infoToSave[AccountModel::Face].toString(); | ||
184 | QString faceFile = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); | 184 | QString faceFile = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); | ||
185 | faceFile.append(QLatin1String("/.face")); | 185 | faceFile.append(QLatin1String("/.face")); | ||
186 | 186 | | |||
187 | QFile::remove(faceFile); | 187 | QFile::remove(faceFile); | ||
188 | KIO::CopyJob* moveJob = KIO::move(QUrl::fromLocalFile(path), QUrl::fromLocalFile(faceFile), KIO::HideProgressInfo); | 188 | KIO::CopyJob* moveJob = KIO::move(QUrl::fromLocalFile(path), QUrl::fromLocalFile(faceFile), KIO::HideProgressInfo); | ||
189 | connect(moveJob, SIGNAL(finished(KJob*)), SLOT(avatarModelChanged(KJob*))); | 189 | connect(moveJob, SIGNAL(finished(KJob*)), SLOT(avatarModelChanged(KJob*))); | ||
190 | moveJob->setUiDelegate(0); | 190 | moveJob->setUiDelegate(0); | ||
191 | moveJob->start(); | 191 | // Run it synchronously to be sure the job ends before the KCM gets deleted. | ||
192 | moveJob->exec(); | ||||
192 | 193 | | |||
193 | QString faceFile2 = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); | 194 | QString faceFile2 = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); | ||
194 | faceFile2.append(QLatin1String("/.face.icon")); | 195 | faceFile2.append(QLatin1String("/.face.icon")); | ||
195 | QFile::remove(faceFile2); | 196 | QFile::remove(faceFile2); | ||
196 | QFile::link(faceFile, faceFile2); | 197 | QFile::link(faceFile, faceFile2); | ||
197 | } | 198 | } | ||
198 | 199 | | |||
199 | if (!failed.isEmpty()) { | 200 | if (!failed.isEmpty()) { | ||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |