Google Drive KIOSlave

Friedrich W. H. Kossebau kossebau at kde.org
Thu Sep 27 17:34:31 BST 2012


Hi Andrius,

Am Donnerstag, 27. September 2012, 08:23:46 schrieb Andrius da Costa Ribas:
> 2. Google drive allows identical filenames.
> -files have a unique id, but can have the very same filename. It would not
> be practical to use the id in the kio url, but using the filename may lead
> to conflicts. Google drive windows syncing program renames the second file
> (e.g. "file.txt" and "file (2).txt") but only in the syncing folder,
> however I don't think this is a clean solution for a kioslave.

You can prevent the conflicts by using the field UDS_DISPLAY_NAME in the 
UDSEntry object you create for a file. Set that field to the filename. In the 
url you better use the id, does not look pretty, but usually people only look 
at the names of the items in the currently selected folder.

See http://api.kde.org/4.x-api/kdelibs-
apidocs/kio/html/classKIO_1_1UDSEntry.html#a8c3c5c6ee998a9f0e413b8aafcc98597a95885a6aae5b1fce559e8c61a9d88dca

(In a perfect world the breadcrumbbar would also use the display name data for 
the display if not in url mode, no idea if it does, if not file a bug :) )

Only problem here will be that programs which get a file passed from your kio-
slave will see the id name, not the nice display name, as that information 
gets dropped. This is a problem your kio-slave will share with all others that 
use UDS_DISPLAY_NAME I guess.

Have a look at other kio-slaves using it:
http://lxr.kde.org/ident?i=UDS_DISPLAY_NAME

> 3. It apparently has no character restriction on filenames.
> -windows syncing app replaces unsupported characters with underscores. I
> think percent encoding would be a better solution.

In theory linux file systems (at least the oldschool ones) also have no 
character restriction, they are just strings of bytes, interpretation left to 
user/programs. No idea how the KIO system handles copying of files between 
filesystems with different character restrictions.
Still I think nothing you have to care about in your kio slave, that is left 
to the parts of KIO which get a file from your kio slave, e.g. if copying, and 
have more restrictions.

Cheers
Friedrich




More information about the kde-core-devel mailing list