Re: [GnomeMeeting-devel-list] [PATCH] removes unneeded begin/end call notification in text-chat



On jeu, 2004-01-22 at 21:49, Damien Sandras wrote:
> > * in src/gnomemeeting.cpp, there is a: chat = new GmTextChat (); (that
> > doesn't really initialize anything as far as I know, since GmTextChat is
> > just a struct) and in src/main_window.cpp: gw->chat_window =
> > gnomemeeting_text_chat_new (chat); (that has the side-effect that it
> > really does initialize the chat!). I find it wrong...
> > 
> 
> The structure are initialized in the gnomemeeting constructor and
> destroyed in the gnomemeeting destructor. I understand your approach,
> but I think it is cleaner the way it is. Otherwise you would have
> allocation at several places in the code and destruction concentrated
> elsewhere.

Not exactly: the gnomemeeting constructor creates a non-initialized
structure that should be internal to the text-chat, then gives a pointer
to that structure to a function of the text chat that does the actual
initialization (both of that structure and of the text-chat).

I would rather see the text chat provide both initialization and
destruction functions, and if needed (which should be quite rare apart
from what's necessary to embed it into the main window) functions to get
access to the variables that live in the structure for now. After all,
the text-chat knows what it needs, how to get it, and how to dispose of
it... That would make a cleaner source, both easier to understand for
new contributors, and easier to modify. But it is probably a post-1.00
project.

Snark




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]