[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    RE: QMap bug ? (Re: kioslaves don't die?)
From:       David Faure <David.Faure () cramersystems ! com>
Date:       1999-11-10 9:12:23
[Download RAW message or body]

> On Wed, 10 Nov 1999, Alexander Feigl wrote:
> > At Die, 09 Nov 1999 Rik Hemsley wrote:
> > > Just as an aside, what's the problem with generating unique keys ?
> > >
> > 
> > The keys are used are used for a "quick lookup". In this special case
the key
> > is the protocol (http,ftp,file). What unique key do you want to use? a
serial
> > numbers that are increased for each entry? we would lose the only real
> > advantage of QMap I can see. Without a quick lookup for a special
protocol we
> > could use QList or similar - that is what we have to do if the current
> > behaviour of QMap is not a bug.
> 
> Use a QMap in conjunction with a QList.
> 
> typedef QList<myItem>;
> 
> QDict<MyList> dict;
> 
> add(QString Key, myITem value)
> {
>    MyList *list = dict[key];
>    if (!list)
>    {
>       list = new MyList();
>       dict[key] = list;
>    }
>    list->append(value);
> }

Looks good.

> BTW. I have used this code in kcookiejar. Where is the cookie 
> jar gone?
> I can't find it anywere in CVS.

Oops, it still needs to be ported from kfm. Like some other things as well.
I'm not sure I could have done it anyway since I know nothing about cookies.

--
David Faure
faure@kde.org - KDE developer
david@mandrakesoft.com - Mandrake
david.faure@cramersystems.com - Cramer Systems

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic