[Patch] add serial devices to solid
Kevin Ottens
ervin at kde.org
Tue Jan 20 09:07:45 GMT 2009
On Tuesday 20 January 2009 09:29:46 Harald Fernengel wrote:
> > I'd change ifaceName() etc. to interfaceName() there's no need to
> > abbreviate it and using the full word is clearer.
>
> I agree, the reason I chose it was copy/paste from networkinterface.h :)
Yeah, that's one we failed at cleaning up in time. :-)
> looking at the other interfaces again, it seems that "QVariant
> driverHandle() const;" would be the consistent choice.
My opinion as well.
> I'll add a comment
> to change NetworkInterface::ifaceName() to interfaceName() for KDE 5 ;)
Thanks. ;-)
> > > * QString serialType()
> > > I'd really like this one use an enum instead, that's what we have
> > > everywhere else in the API for this kind of cases.
> >
> > I agree with Kevin that an enum would be good here. With Q_ENUM it's
> > easy to convert to a string if required.
>
> Trouble is that the HAL spec doesn't specify what serialType() will really
> be - from the spec, it looked more like a readable string to me so you can
> distinguish your USB->serial converter from the built-in serial ports.
Ah yeah indeed, it's loosely defined in the spec... That said, looking at
HAL's code the only three possible values are "platform", "usb" and "unknown"
for now. It seems unlikely to change soon, so it's probably safe to use an
enum based on that.
> > I'm also a bit worried about virtual int port() const; Doesn't this
> > only make sense for RS232 style serial ports?
>
> Again, stolen from the HAL spec. Agree that it only makes sense for the
> legacy serial ports, but there it's key to know the port number. How often
> did I try to send AT commands to my serial mouse instead of my modem in the
> good old days? :)
I admit I've no real opinion for that, apart from the fact that I don't have
any computer with RS232 left here. :-)
Well, probably means this one will have to be extra clear in the apidox on
when you should and shouldn't use it. Probably requires always returning -1
for anything not RS232.
Regards.
--
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090120/0ffcf9e6/attachment.sig>
More information about the kde-core-devel
mailing list