Skip to content
Permalink
Browse files
Journal - update favourite icon when clicked
When there is only one journal entry or Documents file, and the favourite icon is clicked, it is not updated and stays in the previous state, even though the entry is now favourite.

The cause is unknown.

Use a hack to force a refresh when the icon is clicked.

Fixes https://bugs.sugarlabs.org/ticket/4944

Part of #788

Tested-by: Rahul Bothra <f2016015@pilani.bits-pilani.ac.in>  # Ubuntu 16.04
Tested-by: James Cameron <quozl@laptop.org>  # Ubuntu 18.04
  • Loading branch information
rahul-bothra authored and quozl committed Mar 3, 2018
1 parent c1f98db commit b6393af
Showing 1 changed file with 5 additions and 0 deletions.
@@ -415,6 +415,11 @@ def _favorite_clicked_cb(self, cell, path):
self.tree_view.queue_draw_area(cell_rect.x, cell_rect.y,
cell_rect.width, cell_rect.height)

# HACK for https://bugs.sugarlabs.org/ticket/4944
# Icon does not update automatically if there is only one journal entry
if len(self._model.get_all_ids()) == 1:
self._do_refresh()

def __select_set_data_cb(self, column, cell, tree_model, tree_iter,
data):
uid = tree_model[tree_iter][ListModel.COLUMN_UID]

0 comments on commit b6393af

Please sign in to comment.