I think I found an elegant solution to my problem: instead of storing anything else, widgets can reclaim a reference to the GitgRepository to the GitgWindow via the properties of the widgets. I created a gitg_utils_get_repository_from_widget to reuse code later. Please, find the patch attached. Any comments are welcome. 2009/6/23 Guilhem Bonnefille <guilhem bonnefille gmail com>: > Hi, > > Hacking on gitg, I have a new idea I want to debate. Each "object" > running a git object needs an instance of repository (GitgRepository) > to launch the command. Currently, these objects store a reference to > the repository inside their properties. > > But, sometimes, it could begin hard to propagate the reference of the > repository, mainly when the object chain is long: in my case > main window -> commit view -> author dialog -> author list store. > > As Gitg only handles a repository at a time, why not using a singleton? > > -- > Guilhem BONNEFILLE > -=- JID: guyou im apinc org MSN: guilhem_bonnefille hotmail com > -=- mailto:guilhem bonnefille gmail com > -=- http://nathguil.free.fr/ > -- Guilhem BONNEFILLE -=- JID: guyou im apinc org MSN: guilhem_bonnefille hotmail com -=- mailto:guilhem bonnefille gmail com -=- http://nathguil.free.fr/
Attachment:
commit-fa0718c
Description: Binary data