Always create the "." UDSEntry
ClosedPublic

Authored by madcatx on Jul 10 2017, 9:37 PM.

Details

Summary

The smb_kio plugin does not create the "." UDSEntry, relying on the underlying KIO infrastructure to create a default one. This patch ensures that the UDSEntry is always created with proper access permissions.

Diff Detail

Repository
R320 KIO Extras
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
madcatx created this revision.Jul 10 2017, 9:37 PM
smb/kio_smb_browse.cpp
359

Wrong indentation?

madcatx updated this revision to Diff 16493.Jul 11 2017, 8:48 AM

Fix indentation issue.

elvisangelaccio requested changes to this revision.Jul 11 2017, 9:04 AM
elvisangelaccio added inline comments.
smb/kio_smb_browse.cpp
354–356

This if branch does nothing, it can be removed.

This revision now requires changes to proceed.Jul 11 2017, 9:04 AM
madcatx added inline comments.Jul 11 2017, 9:27 AM
smb/kio_smb_browse.cpp
354–356

This empty if is actually quite essential. It makes sure that the "." file does not get processed in the loop. Unless this is done, Dolphin throws nonsensical error messages about non-existent files because the processing loop expands the m_current_url by the entry that is being processed, calls browse_stat_path() on it and then cd()s back up. If the "." gets handled in this fashion, the m_current_url is incorrectly cd()ed one level up to the parent directory.

I will update the patch to include a comment about this not so apparent behavior.

smb/kio_smb_browse.cpp
354–356

Oh, I see. Then maybe also add a continue in the if block

madcatx updated this revision to Diff 16497.Jul 11 2017, 9:31 AM
madcatx edited edge metadata.

Explain the need for the empty if in the loop.

madcatx added inline comments.Jul 11 2017, 9:35 AM
smb/kio_smb_browse.cpp
354–356

udsentry.clear() has to be called an the end of the loop because the udsentry object that is reused in each iteration is manipulated before the loop reaches that if. continueing from the empty if would skip that call.

elvisangelaccio accepted this revision.Jul 11 2017, 9:37 AM
elvisangelaccio added inline comments.
smb/kio_smb_browse.cpp
354–356

Right, didn't notice that (quite an huge loop...).

This revision is now accepted and ready to land.Jul 11 2017, 9:37 AM
This revision was automatically updated to reflect the committed changes.