[Spice-devel] [PATCH spice-gtk 06/15] webdav: move initialization to session

Marc-André Lureau mlureau at redhat.com
Wed Nov 26 08:00:24 PST 2014



----- Original Message -----
> On Wed, 2014-11-26 at 13:58 +0100, Marc-André Lureau wrote:
> > Hi
> > 
> > On Tue, Nov 25, 2014 at 11:49 PM, Jonathon Jongsma <jjongsma at redhat.com>
> > wrote:
> > > I find this name a little inconsistent. Generally the first part of the
> > > function name indicates the type of object that this method belongs to.
> > 
> > Except constructors, like here.
> 
> But the convention for constructors is that the name of the function
> matches the name of the returned type. For example:
> 
> FooType* foo_type_new()
> 
> So I would expect a constructor named channel_webdav_server_new() to
> return an object of type ChannelWebdavServer rather than PhodavServer. I
> realize this might sound pedantic, but it does make it easier to
> understand the code at a glance if conventions are followed. What about
> something like phodav_server_new_for_spice_session() ?

The convention is also to name it to the file/object where it is created.
So I'd prefer to keep channel_webdav prefix if you don't mind too much.
  
> > 
> > > So I'd expect channel_webdav_server_new() to take a SpiceWebdavChannel*
> > > as its first argument, but it takes a SpiceSession* instead. So it seems
> > > that spice_session_webdav_server_new() would be a more appropriate name?
> > > Maybe even move it along to spice-session.c since its only caller just
> > > got moved there?
> > 
> > It can't easily, the constructor sets up callback in channel-webdav.
> > 
> 
> ok
> 
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list