Dolphin plugin for ownCloud
Dominik Schmidt
domme at tomahawk-player.org
Sun Nov 4 11:32:10 GMT 2012
On 04.11.2012 11:04, Frank Reininghaus wrote:
> Hi Dominik,
>
> thanks for your message!
Hey Frank,
thanks for replying ;-)
> You have the following in the constructor:
>
> m_owncloudSocket->connectToServer(m_socketPath);
>
> Isn't that a potentially expensive operation? I'm asking because that
> code will be executed even if the user does not use ownCloud at all.
At least it's async, so it doesn't make constructing the class slow. The
connection is established in sendCommand() anyways, so I can probably
just remove it in the ctor though.
>> Working on this I noticed the version control plugin is rather limited and
>> not really suited for syncing plugins. Are there any other APIs that I could
>> use?
>
> I'm afraid that KVersionControlPlugin2 and
> KAbstractFileItemActionPlugin are the only APIs that there are at the
> moment.
KAbstractFileItemActionPlugin looks good for adding a "sync this folder"
menu. Do I need two separate plugins then? I'm sorry, I dont know the
KDE plugin infrastructure too well :-)
>> This is what I couldn't realize with KVersionControlPlugin2:
>>
>> 1.) Show an icon for ~/ownCloud/ when looking at ~.
>> (e.g., basically for any tracked folder). The version control plugin can
>> only show icons for subfolders of the "top level tracked folder".
>
> Yes, it seems that this is not possible.
Bummer.
>> 2.) Add a context menu outside of the tracked folder for something like
>> "sync this folder to ownCloud". Normal service menus are only mime-type
>> dependent and I cant chose to not show that menu entry if a file is already
>> tracked by the client.
>
> Hm, the "Activities" submenu in the context menu does something
> similar ("Link to/Unlink from current activity"). That doesn't work
> here though, but maybe one has to create some activities to make it
> work (makes me wonder if we should really have that in the context
> menu by default, but that's a different question).
>
> So I think that it might be possible with
> KAbstractFileItemActionPlugin, but we really want to prevent any kind
> of expensive operation when opening the context menu.
I can just cache the tracked dirs in the plugin, then I don't need to
ask the client over the socket when opening the context menu.
>> 3.) Show custom icons. (?)
>> I would like to add a custom overlay to icons with my own sync icons because
>> the version control icons arent perfect fits for syncing and hard to
>> understand by users.
>
> Yes, it seems that this is not possible at the moment. I don't know
> what the best approach to resolve this would be because I've never had
> anything to do with the version control stuff, but maybe someone else
> has an idea?
Bummer once again. If I go for implementing it myself, would there be
any interest to take it upstream? (good code assumed ofc) :)
Regards,
Dominik
More information about the kfm-devel
mailing list