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

List:       kde-devel
Subject:    Re: Lower case URLs?
From:       "Petter E. Stokke" <gibreel () project23 ! no>
Date:       2003-08-10 21:32:32
[Download RAW message or body]

On Sunday 10 August 2003 22:38, Thiago Macieira wrote:
> Petter E. Stokke wrote:
> >Has anyone got a suggestion as to how I can find the .protocol files
> > (ie. in most cases $KDEDIR/share/services or ~/.kde/share/services) in
> > a clean manner without access to a KInstance, or how to proceed if
> > this proves to be impossible? Is it safe to make the assumption I did
> > above about the paths to search in the absence of a KInstance?
>
> What I'd recommend is that you revert to the default in the absence of a
> KInstance.

My current working copy uses a simple hardcoded list ("ed2k" is raw, 
"mailto" is mailto, and everything else is a normal URL), I guess it could 
fall back on that if no KInstance is available.

> But you should also provide a means of the user setting the 
> URI type and handling method.

I added that as an option to the constructor, with the present processing 
mode being the default one.

> KURL should be lightweight. So, I don't recommend writing code to find
> files in the disk.

I'm trying hard to keep it lightweight, but I don't know any other way to 
do it except to hardcode the protocol list into KURL, which doesn't really 
appeal to me. I was planning on writing a very lightweight parser to fetch 
the protocol mode from the .protocol file, and storing it in a hard cache 
for future use (so it doesn't care if the .protocol file changes) in order 
to maintain some semblance of efficiency.

-- 
Petter E. Stokke <gibreel@project23.no> http://www.gibreel.net/
PGP key: http://www.gibreel.net/key.asc
Fingerprint: 4FF3 12BD 692A 0FFF 984F  78DA 4776 81FB 1906 3A9F
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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