KURL and QMap

David Faure david at mandrakesoft.com
Mon Apr 8 13:59:38 BST 2002


On Sunday 07 April 2002 11:09, George Staikos wrote:
> Is there any reason why KURL doesn't using a QMap for the query?  It seems 
> like that would be the natural data structure to store the query in.  It 
> would make it very easy to manipulate URLs if this were the case.  (Simply 
> get a reference to the Map and add/remove/manipulate as needed)
> 
> Alternatively, would it make sense for me to add methods:
> 
> addToQuery(name,value);
> removeFromQuery(name);
> modifyInQuery(name,newvalue);
> 
> It saves writing loops everywhere, and it seems obvious that this would be one 
> of the great advantages of KURL (actually using a Map would be).

Ouch. KURL is memory-hungry enough as it is.
If you need much query manipulation stuff, I'd suggest to use a map in your
app. But don't clutter KURL with it, when 99% of the uses of KURL don't need this.

The recent query-manipulation stuff that was added there was just for
the convenience of very few apps, and was added since it had no cost,
just code, no data. But as soon as more data is required, I think this
shouldn't go into KURL itself. Maybe a separate KURLQuery class, which
has the map, the above methods, and can return the full query for KURL,
if there is indeed a need for a generic class in kdecore?

-- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today






More information about the kde-core-devel mailing list