KDirLister keeps mounted devices in use

Waldo Bastian bastian at kde.org
Tue Jan 7 23:17:08 GMT 2003


On Tuesday 07 January 2003 23:22, Michael Brade wrote:
> Well ok, seriously. I could make KDirLister not put things like floppy and
> cdrom (wich is flawed anyways, who wants to watch a cdrom? :) in KDirWatch
> once that dir is in itemsCached. I think it's worth the speed we loose,
> right? ;) But, how to detect if an url is a floppy, cdrom, Zip or not? And
> furthermore, I occasionally mount harddisks temporarily. I can't think of a
> solution here... besides removing the "speedy caching" feature altogether
> :/

Instead of relying on KDirWatch, can't you somehow check whether the cache is 
still valid before you reuse it? Maybe something like:

check mtime/ctime of dir
if modified
  throw away cache
else
  show cache
  validate (and update) cached items 

Checking the mtime/ctime should detect new/deleted files I think, so you only 
need to validate to update any file attributes (time/size)

You could also check with KIO::probably_slow_mounted and keep using KDirWatch 
when it isn't slow.

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





More information about the kfm-devel mailing list