mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
[flatpak] refactoring: proper model callbacks
This commit is contained in:
@@ -231,7 +231,7 @@ class FlatpakManager(SoftwareManager, SettingsController):
|
||||
latest_version=ref_split[-1],
|
||||
runtime=True,
|
||||
installation=installation,
|
||||
installed=True,
|
||||
installed=False,
|
||||
update_component=True,
|
||||
update=True)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from packaging.version import Version
|
||||
|
||||
from bauh.api.abstract.model import SoftwarePackage, PackageStatus
|
||||
from bauh.commons import resource
|
||||
from bauh.gems.flatpak import ROOT_DIR, VERSION_1_2, VERSION_1_5
|
||||
from bauh.gems.flatpak import ROOT_DIR, VERSION_1_2
|
||||
from bauh.view.util.translation import I18n
|
||||
|
||||
|
||||
@@ -137,6 +137,12 @@ class FlatpakApplication(SoftwarePackage):
|
||||
else:
|
||||
return f'{self.installation}/{self.ref}'
|
||||
|
||||
def can_be_installed(self) -> bool:
|
||||
return not self.update_component and not self.installed
|
||||
|
||||
def can_be_updated(self) -> bool:
|
||||
return self.update_component or super(FlatpakApplication, self).can_be_updated()
|
||||
|
||||
def can_be_uninstalled(self) -> bool:
|
||||
return not self.update_component and super(FlatpakApplication, self).can_be_uninstalled()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user