[PATCH] Renaming entries with KDirLister
Allen Winter
winter at kde.org
Tue Sep 4 15:07:50 BST 2007
On Tuesday 31 July 2007 4:10:55 pm Jeff Mitchell wrote:
> The attached patch fixes a problem that I run into when writing a custom
> kioslave.
Whatever happened with this patch?
Was it committed?
>
> Entries (directories or files) are returned from a slave to the
> requestor via UDSEntry objects. These objects must have a UDS_NAME
> property defined; usually this UDS_NAME property is appended to the
> directory to form the full path/url.
>
> However, it is possible to define a separate UDS_URL. If this is done,
> the UDS_NAME becomes the "display name" shown in a file browser whereas
> the UDS_URL becomes the actual object URL that is accessed when you i.e.
> double-click on it.
>
> At the moment a rename operation on such an object will modify both
> properties. If a UDS_URL is set, this is almost certainly not what the
> user wants to do, as the URL is not visible to the user anyways --
> instead, the user wanted to modify the "display name" associated with
> the URL. The result is that the name looks correct in the file browser,
> but links to an invalid URL.
>
> A couple points:
> * Dolphin (at least) will display the URL instead of the "display name"
> when the user chooses to rename the file. This is rather weird
> behavior, but I'm not sure if this is Dolphin-specific or not.
> * Another way around this, but more hacky, is to call a
> KDirNotify::emitFileAdded on the directory, causing a re-list.
> Obviously this can have performance problems, but there is also a race
> condition between the fileAdded call and the fileRenamed call (that is
> automatically sent by Job when the slave is finished), so that sometimes
> doing this works, but not always. This race condition should probably
> get sorted out anyways but I so far have not had luck figuring it out.
>
> Comments appreciated.
>
> Thanks,
> Jeff
>
--
KDEPIM Developer
I accept PayPal payments to awinterz at earthlink.net
More information about the kde-core-devel
mailing list