Ticket #1042: sugar-multi-version-bundles-fix.patch

File sugar-multi-version-bundles-fix.patch, 1.9 KB (added by sascha_silbe, 15 years ago)

Fix upgrading of activities

  • src/jarabe/desktop/activitieslist.py

    diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
    index 299df14..1284af4 100644
    a b class ListModel(gtk.TreeModelSort): 
    203203        for row in self._model:
    204204            if row[ListModel.COLUMN_BUNDLE_ID] == bundle_id and \
    205205                    row[ListModel.COLUMN_VERSION] == version:
    206                 self.remove(row.iter)
     206                self._model.remove(row.iter)
    207207                return
    208208
    209209    def _add_activity(self, activity_info):
  • src/jarabe/model/bundleregistry.py

    diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
    index 068cf8d..88d30c1 100644
    a b class BundleRegistry(gobject.GObject): 
    324324        return False
    325325
    326326    def install(self, bundle):
     327        logging.debug("Trying to install bundle %r %r",
     328            bundle.get_bundle_id(), bundle.get_activity_version())
    327329        activities_path = env.get_user_activities_path()
    328330
    329         if self.get_bundle(bundle.get_bundle_id()):
    330             raise AlreadyInstalledException
    331 
    332331        for installed_bundle in self._bundles:
    333332            if bundle.get_bundle_id() == installed_bundle.get_bundle_id() and \
    334333                    bundle.get_activity_version() == \
    class BundleRegistry(gobject.GObject): 
    347346        elif not self.add_bundle(install_path):
    348347            raise RegistrationException
    349348
    350     def uninstall(self, bundle, force=False):       
     349    def uninstall(self, bundle, force=False):
     350        logging.debug("Trying to uninstall bundle %r %r",
     351            bundle.get_bundle_id(), bundle.get_activity_version())
    351352        # TODO treat ContentBundle in special way
    352353        # needs rethinking while fixing ContentBundle support
    353354        if isinstance(bundle, ContentBundle):