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

List:       kfm-devel
Subject:    Re: KProtocolManager change proposal
From:       Tobias Anton <anton () stud ! fbi ! fh-darmstadt ! de>
Date:       2001-04-10 8:07:43
[Download RAW message or body]

On Tuesday 10 April 2001 01:31, Dawit Alemayehu wrote:
> Hi,
>
> There was a discussion a while back about applications wanting the ability
> to store their own IO-related settings that is currently handled by
> KProtocolManager for every application that uses it.  This is an
> idea/proposal that is intended to allow for that without breaking BC.
>
> My idea is to create two distinct new singleton classes KROProtocolManager
> and KRWProtocolManager KRWProtocolManager would inherit from
> KROProtocolManager and with the additional ability to specify your own
> config file, ex: setConfigObject(const KConfig* ).  KProtocolManager then
> can create one instance of KRWProtocolManager to allow manipulation of the
> global settings.
There's no need to add a new level of inheritance here. We could simply add a 
method "setConfigFile()".

> I see two advantages with doing this. The first is the obvious reason that
> app developers needed to keep or manipulate their own settings without
> having to dup the code in kprotocolmanager.   The second reason is that
> these settings would be of the same value so sharing such settings between
> applications as necessary would be a trivial task.  It would also allow
> application that want to only read the global information to obtain an
> instance of KROProtocolManager and do not worry about the rest of the
> baggage...
>
> Comments, opinions, ideas ?

I see the problem of keeping control over the different settings - the first 
problem arises if two applications use different timeouts, cache settings 
etc., because the ioslaves don't know which config object is used by the 
controlling application.
Hmm, this could be worked around by passing the config object name in the 
request, something like:

TransferJob *KIO::get( const KURL& url, bool reload, bool showProgressInfo )
{
    // Send decoded path and encoded query
    KIO_ARGS << url;
    TransferJob * job = new TransferJob( url, CMD_GET, packedArgs, 
QByteArray(), showProgressInfo );
    job->addMetaData("configFile", KProtocolManager::configFile());
    if (reload)
       job->addMetaData("cache", "reload");
    return job;
}

But we'd need to adapt the code for all concerned ioslaves then.

Greetings,
Tobias

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

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