From kopete-devel Mon Jun 06 19:38:58 2005 From: Richard Smith Date: Mon, 06 Jun 2005 19:38:58 +0000 To: kopete-devel Subject: [kopete-devel] Re: [PATCH] Decouple tabs from the ChatView class Message-Id: <200506062038.59012.kde () metafoo ! co ! uk> X-MARC-Message: https://marc.info/?l=kopete-devel&m=111808676517475 On Monday 06 June 2005 02:36, Duncan Mac-Vicar P. wrote: > On Sunday 05 June 2005 18:03, Richard Smith wrote: > > I'll give it some thought. I think Matt's right, and the tab bar > > implementation details belong to KopeteChatWindow, not to ChatView. > > yes, that is straightforward, the problem is, how do you abstract the tabs > in the chatview for the coloring issue. > Probably the ChatView could emit some signals like "typing" "newmessage" > and the chatwindow change color tabs on that. That is completely decoupled. There's a fundamental rule: two interacting components can never be completely decoupled from each other. Either you make them not interact with each other directly, or you make at least one of them (and ideally only one of them) make assumptions about the other. Where and how you make the split, and where you put the knowledge depends primarily on the direction you see the code changing in. Here, KopeteChatWindow currently knows that it's embedding ChatViews into itself, and I can't really imagine that changing any time soon, so it makes some sense for it to know a bit about the interface of ChatView. Therefore, we probably want to remove knowledge about KopeteChatWindow from ChatView, and an easy way to do that is for ChatView to emit signals at whatever times make sense for it, and for KopeteChatWindow to connect to those, and interpret them in a way which allows it to colour the tabs correctly, or to signal to KWin that it wants attention, or to close the tab, or whatever it deems most appropriate. In short: yes, ChatView can emit some signals. But it should emit the signals that make sense from the context of ChatView, not the signals that make sense from the context of KopeteChatWindow. What, not how. 'typing', not 'colourTheTabBlue'. -- Thanks, Richard _______________________________________________ kopete-devel mailing list kopete-devel@kde.org https://mail.kde.org/mailman/listinfo/kopete-devel