Summary: | kcm_sddm AdvanceConfig Autologin save freeze | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | Leslie Zhai <zhaixiang> |
Component: | kcm_sddm | Assignee: | David Edmundson <kde> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bshah, mklapetek |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/sddm-kcm/e5e4c3507c20adf9b3d61efaa9c0ef0698919e43 | Version Fixed In: | |
Sentry Crash Report: |
Description
Leslie Zhai
2015-10-20 07:51:32 UTC
/usr/share/polkit-1/rules.d/sddm.rules polkit.addRule(function(action, subject) { if (action.id == "org.kde.kcontrol.kcmsddm.save" && subject.isInGroup("wheel") && subject.active) { return polkit.Result.YES; } }); https://projects.kde.org/projects/frameworks/kcoreaddons/repository/revisions/master/entry/src/lib/jobs/kjob.h#L243 the synchronous job->exec() might block, so I just simply change it to asynchronous one: diff --git a/src/sddmkcm.cpp b/src/sddmkcm.cpp index be07230..7e56727 100644 --- a/src/sddmkcm.cpp +++ b/src/sddmkcm.cpp @@ -83,17 +83,17 @@ void SddmKcm::save() saveAction.setArguments(args); auto job = saveAction.execute(); - job->exec(); - - if (job->error()){ - qDebug() << "Save Failed"; - qDebug() << job->errorString(); - qDebug() << job->errorText(); - } else { - changed(false); - qDebug() << "Option saved"; - } - + connect(job, &KJob::result, [this](KJob *job){ + if (job->error()) { + qDebug() << "Save Failed"; + qDebug() << job->errorString(); + qDebug() << job->errorText(); + } else { + changed(false); + qDebug() << "Option saved"; + } + }); + job->start(); } void SddmKcm::prepareUi() Git commit e5e4c3507c20adf9b3d61efaa9c0ef0698919e43 by Leslie Zhai. Committed on 20/10/2015 at 09:03. Pushed by lesliezhai into branch 'asynchronous-save'. Use KJob asynchronous instead of exec() M +14 -11 src/sddmkcm.cpp http://commits.kde.org/sddm-kcm/e5e4c3507c20adf9b3d61efaa9c0ef0698919e43 I believe you pushed it into wrong branch? Hi Bhushan, sorry that, Martin told me to upload my patches to http://git.reviewboard.kde.org for review at first, sorry for my mistake ;-( Hi David && Bhushan, Could you review this? thanks a lot! https://git.reviewboard.kde.org/r/125832/ |