summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2019-01-10 10:03:51 +0100
committerPapoteur <papoteur@mageia.org>2019-01-10 10:03:51 +0100
commit1ba9d8a7ae188d71406bed725408d101f37ad7b2 (patch)
tree000866f4b1c44f1ff843c0c751326a3705c36d6f
parent6a01d20b66509c4e2945b6859f4d6fc07b5db7cc (diff)
downloadmageiawelcome-1ba9d8a7ae188d71406bed725408d101f37ad7b2.tar
mageiawelcome-1ba9d8a7ae188d71406bed725408d101f37ad7b2.tar.gz
mageiawelcome-1ba9d8a7ae188d71406bed725408d101f37ad7b2.tar.bz2
mageiawelcome-1ba9d8a7ae188d71406bed725408d101f37ad7b2.tar.xz
mageiawelcome-1ba9d8a7ae188d71406bed725408d101f37ad7b2.zip
Applications: don't display core application when tainted one is installed
-rw-r--r--qml/mageiawelcome.py8
-rw-r--r--qml/mw-ui.qml4
2 files changed, 9 insertions, 3 deletions
diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py
index b5e13da..c0be01d 100644
--- a/qml/mageiawelcome.py
+++ b/qml/mageiawelcome.py
@@ -136,9 +136,15 @@ class Installable(QObject):
@pyqtSlot(str, str, result=bool)
def installable(self, app,repo):
is_app_installed, inst_repo = is_installed(app)
- installable = (not is_app_installed) or (repo != inst_repo and inst_repo != "")
+ installable = (not is_app_installed) or (repo != inst_repo and inst_repo == "")
return installable
+ @pyqtSlot(str, str, result=bool)
+ def other(self, app, repo):
+ is_app_installed, inst_repo = is_installed(app)
+ return (is_app_installed and repo == '' and inst_repo != "")
+
+
def username():
user = pwd.getpwuid(os.getuid())[4] # pw_gecos, i e the real name
if user == "":
diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml
index cebd7aa..3cc1223 100644
--- a/qml/mw-ui.qml
+++ b/qml/mw-ui.qml
@@ -484,7 +484,7 @@ Rectangle {
{
var entry = appList.get(i);
var pattern = new RegExp(group, "g");
- if(pattern.test(entry.group) ) {
+ if(pattern.test(entry.group) && !pyinstallable.other(entry.name, entry.repo)) {
appListDM.items.insert(entry, "group");
}
}
@@ -596,7 +596,7 @@ Rectangle {
{
var entry = appList.get(i);
var pattern = /featured/g;
- if(pattern.test(entry.group) ) {
+ if(pattern.test(entry.group) && !pyinstallable.other(entry.name, entry.repo) ) {
items.insert(entry, "group");
}
}