KDirLister::rootItem() sometimes returns a null KFileItem

Frank Reininghaus frank78ac at googlemail.com
Sun Jan 19 22:31:42 GMT 2014


Hi,

2014/1/19 David Faure:
> On Saturday 18 January 2014 18:28:02 Frank Reininghaus wrote:
>> Dear KIO experts,
>>
>> to determine if the "Create New..." menu should be enabled for the
>> current URL in Dolphin, we wait for the KDirLister's completed()
>> signal, then create a KFileItemListProperties instance for a
>> KFileItemList containing the dir lister's root item, and check the
>> return value of KFileItemListProperties::supportsWriting().
>>
>> This works fine most of the time, but now we have this bug:
>>
>> https://bugs.kde.org/show_bug.cgi?id=330001
>>
>> The "Create New..." menu is disabled in a writable directory for the
>> reporter, and according to the debug output that we got, this is
>> because the dir lister's rootItem() is a null KFileItem.
>>
>> The documentation of this function says "Can return an empty
>> KFileItem.", but it was my understanding that the root item should be
>> valid after the completed() signal is emitted.
>
> It depends on the kioslave's listDir() sending an item for "."
> Sounds like it's missing in kio_smb, then.

thanks. According to

https://bugs.kde.org/show_bug.cgi?id=330015

it did work with smb at some point, but not any more. However,

https://bugs.kde.org/show_bug.cgi?id=330001

is about accessing an NTFS drive that is mounted using a driver called
"ufsd". I'm not sure what ufsd does, but I guess that we're still
using kio_file then? It seems strange that kio_file does not send an
item for "." if the drive is mounted in a particular way, but I'm not
an expert for these things.

Regards,
Frank




More information about the kfm-devel mailing list