Bug 330605 - Dropbox plugin prevents git plugin from working
Summary: Dropbox plugin prevents git plugin from working
Status: REOPENED
Alias: None
Product: dolphin
Classification: Applications
Component: plugins: dropbox (show other bugs)
Version: 21.12.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Richard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-31 10:04 UTC by Philipp A.
Modified: 2022-04-07 15:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp A. 2014-01-31 10:04:28 UTC
git and hg plugins work together, but the dropbox plugin prevents the icons from showing up in a git repo.

Reproducible: Always
Comment 1 Emmanuel Pescosta 2014-01-31 11:48:56 UTC
Do you have the git repo in the Dropbox directory or somewhere else?

Both cases work for me. (Tested with https://git.reviewboard.kde.org/r/114812/)
Comment 2 Philipp A. 2014-02-03 10:26:13 UTC
that one isn’t yet in 4.12, is it? or do dolphin’s plugins have GetHotNewStuff?

if so, i’ll try it once i get home, else i’ll patiently wait for 4.13
Comment 3 Emmanuel Pescosta 2014-02-03 12:36:04 UTC
> that one isn’t yet in 4.12, is it?
Nope is not in 4.12

> or do dolphin’s plugins have GetHotNewStuff?
Nope

Dolphin does select the best suitable plugin automatically. So we need to find the special case (Please answer my question in comment # 2) were Dolphin does only use the Dropbox plugin and no other plugins, even if git is available.
Comment 4 Philipp A. 2014-02-03 14:47:46 UTC
> Please answer my question in comment # 2

Nope, no repo of any kind anywhere in my dropbox.

But, as you know from the review request, my ~/Dropbox is a symlink to another HD, so the old plugin doesn’t even work. Still it prevents the git plugin from working in my git repos. (Which live in ~/Dev/**)
Comment 5 Emmanuel Pescosta 2014-02-24 14:09:05 UTC
Review-Request: https://git.reviewboard.kde.org/r/116019/

It would be great if you can test this patch, because I can't reproduce this bug on my machine.

Thanks!
Comment 6 Philipp A. 2014-02-24 18:53:54 UTC
shouldn’t we wait until https://git.reviewboard.kde.org/r/114812 is there and look if it’s fixed there?

and if not, how do i compile and add such a plugin to dolphin?
Comment 7 Philipp A. 2014-02-24 18:54:37 UTC
PS: much thanks, of course!
Comment 8 Emmanuel Pescosta 2014-02-24 19:16:53 UTC
> shouldn’t we wait until https://git.reviewboard.kde.org/r/114812 is there and look if it’s fixed there?
This bug has nothing in common with the plugin implementation, the problem is in Dolphin itself.

Dolphin only selects one version control plugin for a given directory. The current implementation depends on the order of available/loaded plugins, so it doesn't always select the best one. (e.g. ["dropbox", "git"] prefers dropbox over git)

The patched version tries to find the best one in all different cases, see the comments in the code if you are interested ;)

> and if not, how do i compile and add such a plugin to dolphin?
This isn't a plugin, this is a patch for Dolphin itself.
You have to clone the kde-baseapps repo, download and apply the patch of review request 114812 and then compile it.

Maybe it's easier if we include it into the next Dolphin version (after I have a ship it), then you can easily test it and if you can still reproduce this bug, you can reopen this report. ;)

> PS: much thanks, of course!
You're welcome!
Comment 9 Philipp A. 2014-02-24 20:06:15 UTC
(In reply to comment #8)
> > and if not, how do i compile and add such a plugin to dolphin?
> This isn't a plugin, this is a patch for Dolphin itself.

Aah, OK. Didn’t realize that.

> You have to clone the kde-baseapps repo, download and apply the patch of
> review request 114812 and then compile it.

Can do that. I’m a Kate Dev ;)
Comment 10 Philipp A. 2014-02-24 20:35:28 UTC
done. it works!
Comment 11 Emmanuel Pescosta 2014-02-24 20:40:04 UTC
Thanks for testing! Always great to get fast feedback from users/devs :)
Comment 12 Philipp A. 2014-02-24 20:56:30 UTC
ugh, and i now understand why there’s even a bug.

FileViewDropboxPlugin::fileName() returns ".dropbox"

– which is idiotic, because that isn’t only a file in dropbox-synced directories, but also config directory in ~. This of course means that dolphin chooses the dropbox plugin for *everything in ~*.

Your patch fixes that the dropbox plugin is always chosen for systems where it is earlier in the list than other plugins (i guess it’s simply later in the list for you, which is why you can’t reproduce it). It also makes everything more robust.

I also propose that we add a “fileIsDirectory()” method to KVersionControlPlugin2, which will be checked in addition to “fileName()” (or sth. more powerful, which allows more sophisticated checks if the file truly means we’re in a repo)
Comment 13 Emmanuel Pescosta 2014-02-24 21:09:39 UTC
Yes exactly ;)

> I also propose that we add a “fileIsDirectory()” method to KVersionControlPlugin2
This will result in KVersionControlPlugin3 

Yes we definitely need smth. better in future. - I already have some ideas, how we can make a much more powerful and future proof version control plugin system - I'll write it down when we plan the future roadmap of Dolphin.
Comment 14 Emmanuel Pescosta 2014-02-25 18:45:36 UTC
Git commit 2a6a1f5acd6d1d8810bbf45e784c85fa9561922f by Emmanuel Pescosta.
Committed on 25/02/2014 at 18:38.
Pushed by emmanuelp into branch 'KDE/4.12'.

Fix Bug 330605 - Dropbox plugin prevents git plugin from working

Use scoring to find the best matching plugin for the given directory.

Thanks to Phil Schaf for testing this patch!
FIXED-IN: 4.12.3
REVIEW: 116019

M  +16   -3    dolphin/src/views/versioncontrol/versioncontrolobserver.cpp

http://commits.kde.org/kde-baseapps/2a6a1f5acd6d1d8810bbf45e784c85fa9561922f
Comment 15 Christophe Muller 2022-04-07 15:20:44 UTC
I noticed that my git plugin was not working at all (in any directory)
so I tried with another account (i.e., without dropbox) and.. it worked!

So I ended up to see this bug and it seems that the issue is still there
or at least I don't know how to configure Dolphin so that it recognize
directories with a ".git" folder and triggers the Git plugin.

My Dolphin version (and plugins) = 21.12.3 on Ubuntu 22.04

After selecting both Dropbox and Git, I had in .config/dolphinrc
~~~
enabledPlugins=Dropbox,Git
~~~
so after reading the comments here I also tried:
~~~
enabledPlugins=Git,Dropbox
~~~
but it did not change the behavior: my $HOME/Dropbox directory
is still taken into account and my git folders are still not.