From 708f51d4c078c5360d50c4e5995129891c3d551b Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 3 Feb 2019 22:41:49 +0100 Subject: Applications: secure rpm query after installation (mga#24095) --- qml/helpers.py | 4 +--- qml/mageiawelcome.py | 5 ++--- qml/mw-ui.qml | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/qml/helpers.py b/qml/helpers.py index 7d69eb1..f777f04 100644 --- a/qml/helpers.py +++ b/qml/helpers.py @@ -3,8 +3,6 @@ import gettext import rpm -ts = rpm.TransactionSet() - def get_desktop_name(x): return { '01plasma':'KDE Plasma', @@ -33,7 +31,7 @@ def get_desktop_name2(x): def is_installed(name): - mi = ts.dbMatch('name', name) + mi = rpm.TransactionSet().dbMatch('name', name) release = "" for h in mi: release = (h['release']).decode("utf-8") diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py index e8662b8..c7a320d 100644 --- a/qml/mageiawelcome.py +++ b/qml/mageiawelcome.py @@ -104,9 +104,8 @@ class Launcher(QObject): if cmd[0] == "gurpmi": proc.wait() print(proc.returncode) - if (proc.returncode == 0): - # Give the signal to reload the applist - self.installed.emit() + # Give the signal to reload the applist + self.installed.emit() class Norun(QObject): def __init__(self): diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml index 996938c..30545c8 100644 --- a/qml/mw-ui.qml +++ b/qml/mw-ui.qml @@ -987,6 +987,7 @@ This is a background process and you will be able to use your computer normally target: launch onInstalled: { // get the signal to reload the applist + console.log("Reload applications list") itemModel.update_list(categoriesList.currentItem.myGroup) } } -- cgit v1.2.1