Codebase list sugar-read-activity / 0401f6e
Do not download again a shared book if is already in the journal This patch chnge the order of checks, to know if the file is in the journal, or if is shared, or if is a new instance. Before the first check was if the file was shared, then even when a file was in the Journal, tried to download it again. Gonzalo Odiard 9 years ago
1 changed file(s) with 13 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
360360
361361 self._progress_alert = None
362362
363 if self.shared_activity:
363 if self._jobject.file_path is not None and \
364 self._jobject.file_path != '':
365 self.read_file(self._jobject.file_path)
366 elif handle.uri:
367 self._load_document(handle.uri)
368 # TODO: we need trasfer the metadata and uodate
369 # bookmarks and urls
370
371 elif self.shared_activity:
364372 # We're joining
365373 if self.get_shared():
366374 # Already joined for some reason, just get the document
374382 # Wait for a successful join before trying to get the document
375383 self.connect("joined", self._joined_cb)
376384 else:
377 if self._jobject.file_path is not None and \
378 self._jobject.file_path != '':
379 self.read_file(self._jobject.file_path)
380 elif handle.uri:
381 self._load_document(handle.uri)
382 # TODO: we need trasfer the metadata and uodate
383 # bookmarks and urls
384 else:
385 # Not joining, not resuming or resuming session without file
386 emptypanel.show(self, 'activity-read',
387 _('No book'), _('Choose something to read'),
388 self._show_journal_object_picker_cb)
385 # Not joining, not resuming or resuming session without file
386 emptypanel.show(self, 'activity-read',
387 _('No book'), _('Choose something to read'),
388 self._show_journal_object_picker_cb)
389389
390390 def _create_back_button(self):
391391 back = ToolButton('go-previous-paired')