Skip to content
Commit 004da955 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Don't call IBasicVersionControl::isVersionControlled in a loop

The allVersioned variable is used only when ctxUrls contains a single
element.

One call to GitPlugin::isVersionControlled() takes almost 100 ms. When
the user selects N files in Projects tool view, which are all under Git
version control, and right-clicks on them, this function is called 2*N
times, because VcsPluginHelperPrivate::createMenu(), which contains the
loop, is called twice. Consequently, KDevelop's UI freezes for 1 second
when the context menu is requested while 5 files are selected, for 4
seconds when 20 files are selected, and for 15 seconds when 80 files are
selected.

With this commit, there is no noticeable UI freeze even if more than 300
files are selected, and the Projects tool view's context menu always
appears almost instantly.
parent 8c3d53dc
Pipeline #405889 canceled with stage
in 1 minute and 42 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment