Ticket #2979: 0001-Jobject-value-is-being-created-after-joining-2979.patch

File 0001-Jobject-value-is-being-created-after-joining-2979.patch, 1.8 KB (added by alsroot, 12 years ago)
  • src/sugar/activity/activity.py

    From c10ad101a013b4f50677dfdefe2c1e70d3b109ea Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@activitycentral.org>
    Date: Fri, 15 Jul 2011 20:51:19 +0000
    Subject: [PATCH sugar-toolkit] Jobject value is being created after joining
     #2979
    
    ---
     src/sugar/activity/activity.py |   11 +++++------
     1 files changed, 5 insertions(+), 6 deletions(-)
    
    diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
    index 443799a..f94af46 100644
    a b class Activity(Window, gtk.Container): 
    307307
    308308        share_scope = SCOPE_PRIVATE
    309309
    310         if handle.object_id:
     310        if handle.object_id is not None:
    311311            self._jobject = datastore.get(handle.object_id)
    312312            self.set_title(self._jobject.metadata['title'])
    313313
    314314            if 'share-scope' in self._jobject.metadata:
    315315                share_scope = self._jobject.metadata['share-scope']
     316        elif create_jobject:
     317            logging.debug('Creating a jobject.')
     318            self._jobject = self._initialize_journal_object()
     319            self.set_title(self._jobject.metadata['title'])
    316320
    317321        self.shared_activity = None
    318322        self._join_id = None
    class Activity(Window, gtk.Container): 
    332336                                                  warn_if_none=False)
    333337            self._set_up_sharing(mesh_instance, share_scope)
    334338
    335         if handle.object_id is None and create_jobject:
    336             logging.debug('Creating a jobject.')
    337             self._jobject = self._initialize_journal_object()
    338             self.set_title(self._jobject.metadata['title'])
    339 
    340339    def _initialize_journal_object(self):
    341340        title = _('%s Activity') % get_bundle_name()
    342341        if self.shared_activity and self.shared_activity.props.name != title: