File fontinst-quits-after-KJob-is-done.patch of Package plasma5-desktop

From 60c895758f20bd2cb17ab12e57cf34cc37197098 Mon Sep 17 00:00:00 2001
From: Mathias Tillman <master.homer@gmail.com>
Date: Tue, 31 Jul 2018 12:34:29 +0200
Subject: fontinst quits after KJob is done

Summary:
As the summary says, when installing/removing multiple fonts to system the expected behaviour would be for fontinst to keep running after the first font has been installed or removed, instead it quits which causes a bunch of issues. fontinst uses KJob to authorize and internally KJob uses a QEventLoopLocker which causes the main event loop to quit when it's done.
I'm not entirely sure why the event loop locker is enabled by default for KJob, but the patch I have attached works around this by completely disabling that functionality for fontinst. There's a timer that runs in the background which checks for any connected clients, so it will quit after a little while regardless.

BUG: 379524
BUG: 379324
BUG: 349673
BUG: 361960
BUG: 392267

Test Plan: Make sure fonts are still installed and removed properly.

Reviewers: #plasma, dfaure, aacid, gateau

Reviewed By: dfaure

Subscribers: wbauer, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14493
---
 kcms/kfontinst/dbus/Main.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kcms/kfontinst/dbus/Main.cpp b/kcms/kfontinst/dbus/Main.cpp
index 3fc3cf9..5d2432a 100644
--- a/kcms/kfontinst/dbus/Main.cpp
+++ b/kcms/kfontinst/dbus/Main.cpp
@@ -27,6 +27,10 @@
 
 int main(int argc, char *argv[])
 {
+    // KJob uses a QEventLoopLocker which causes kfontinst to quit
+    // after the job is done, prevent this by disabling quit lock.
+    QCoreApplication::setQuitLockEnabled(false);
+
     QCoreApplication *app=new QCoreApplication(argc, argv);
     KFI::FontInst    fi;
 
-- 
cgit v0.11.2

openSUSE Build Service is sponsored by