propertiesdialog and remote files gives problems in kfileitem.cpp

David Faure dfaure at klaralvdalens-datakonsult.se
Sun Mar 23 09:46:20 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 22 March 2003 22:30, Willy De la Court wrote:
> The last few hours i'v been trying to track down a bug i noticed and
> confirmed.
> 
> http://bugs.kde.org/show_bug.cgi?id=52062
> 
> which is not only related to fish but is also noteced with ftp
> 
> when using an ioslave to view a remote directory let it be fish or ftp
> right clicking on any file in konquoror choosing properties changing some
> permission and then clicking OK works ok when looking at the file in another
> way say by using ls in a shell the changes are made. BUT konquoror believes
> the file or dir has the time set to 01/01/70 01:00 size 0 owner and group are
> blank permissions are all blank.
> 
> I finally traced down the path it follows
> 
> propertiesdialog calls a dcop method with a list of urls that are changed
> 
>   KDirNotify_stub allDirNotify("*", "KDirNotify*");
>   allDirNotify.FilesChanged( lst );
> 
> which is picked up by
> 
> void KDirListerCache::FilesChanged( const KURL::List &fileList )
> ...
>       KFileItem* fileitem = findByURL( 0, *it );
> ...
>           fileitem->refresh();
> 
> and calls the refresh() for that fileitem
> 
> In KFileItem::refresh all the attributes of the FileItem are cleared and then
> the init is called. BUT init does not do anything for remote files.

Hmm, it sounds to me like 
1) refresh() shouldn't clear the attributes of the KFileItem
  if it's remote, knowing that init() won't recalc them
2) actually refreshing the stuff should be done somewhere else.
I'd suggest letting KDirListerCache update the current dir instead of
emitting "refreshItems" (with no new info yet).
Can you test the attached patch?

(Using NetAccess::stat here would _really_ be the wrong solution. If you
change 10 files, you'd have to wait for 10 synchronous network access....)

- -- 
David Faure -- faure at kde.org, dfaure at klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+fYJu72KcVAmwbhARAtdBAKCB3CZFN6RbBNAt7gpoi/7CxdTc3QCbBb3A
DqBfJUUE1tBL1JcP1PEsGVY=
=f7st
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdirlister.diff
Type: text/x-diff
Size: 1512 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030323/67882510/attachment.diff>


More information about the kde-core-devel mailing list