PATCH: KIO::NetAccess and Password Caching

Waldo Bastian bastian at kde.org
Sat Jan 4 15:55:22 GMT 2003


On Saturday 04 January 2003 10:38, David Faure wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Saturday 04 January 2003 07:54, Dawit A. wrote:
> > Hi,
> >
> > I'm try reposting this again since people might have missed it due to
> > holiday breaks.
> >
> > The patch is intended to make it possible for proper password caching
> > when using KIO::NetAccess.  It simply allows people to pass a pointer to
> > the main window so that it could be passed on to the jobs used
> > internally.  The solution is not ideal (atleast it does not look clean to
> > me), but I do not see any other way to handle it.  Any comments,
> > suggestion ?

+bool NetAccess::mkdir( const KURL & url, QWidget* window, int permissions )

Why is QWidget* not the last argument as with all other functions?

> Ah yes .... Hmm, I really don't like this. What if I'm using NetAccess to
> upload/ download something in a program that doesn't have a GUI? Why should
> network operations be tied to a window? I'm still not sure what that window
> is used for... simply for clearing the password(s) when the window is
> closed? Why?

If you have a sequence of IO-operations you want to be able to cache passwords 
for that sequence to prevent that the user gets 5 password dialogs in a row. 
Since such a sequence is typically associated with a user interface element, 
it is by far the easiest to tie password caching to the lifetime of the user 
interface element. Partly also because that way it is easy for the user to 
make a mental model of the password caching by pretending that the password 
is stored in the user interface element.

Another option would be to have an explicit IO-sequence-id that the 
application would need to request first and then pass along to every 
KIO-operation part of that sequence. I am not convinced of a need for that 
though.

Note that passing a widget to NetAccess is usefull for a completely different 
reason as well. In a process with multiple mainwindows, KIO::NetAccess 
currently blocks *ALL* access to all mainwindows. When it gets informed about 
the proper mainwindow that is repsonsable for the KIO::NetAccess call it 
could do the correct thing and only block access to this particular 
mainwindow, leaving the other ones accessible.

Cheers,
Waldo
-- 
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com





More information about the kfm-devel mailing list