remove UDSEntry from the public KIO API?

Thiago Macieira thiago at kde.org
Sat Jul 21 16:05:45 BST 2007


nf2 wrote:
>class KIO_EXPORT UDSEntry
>{
>public:
>  virtual QString stringValue( uint field );
>
>  virtual long long numberValue( uint field, long long defaultValue = 0
> );
>
>  // Convenience methods.
>  // Let's not add one method per field, only methods that have some
>more logic
>  // than just calling stringValue(field) or numberValue(field).
>
>  /// @return true if this entry is a directory (or a link to a
> directory) virtual bool isDir();
>  /// @return true if this entry is a link
>  virtual bool isLink();
> 
>  virtual void set(UDSFieldTypes t, QString string);
> 
>  virtual void set(UDSFieldTypes t, long long l);
> 
>private:
>   UDSEntryPrivate* const d;
>
>};

That's a good idea, but no virtuals please. There's no need to do that. 
The private should be QSharedDataPointer<UDSEntryPrivate> d;

If the new class mimics QHash, most code won't notice the changes. 
(insert, erase, remove, operator[]). I don't know if there's code using 
iterators over UDSEntry.

And the UDS types should be an enum inside UDSEntry, probably 
called "KnownTypes" or "KnownFields".
-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070721/2927f807/attachment.sig>


More information about the kde-core-devel mailing list