Fix automatic switch to list mode in staging view
When the view automatically switched from list to compact tree mode
because there were too many nodes in the tree viewer and then some nodes
are removed such that it got below the limit, the switch back to list
mode occurred before the new input (with fewer nodes) had been set.
The switch back was also done by running the action, which refreshes
the viewer. As a result, the viewer then tried to display the old input
as a flat list, but that old input still had too many nodes.
Resolve by not running the action. Only update the presentation setting
and don't refresh; the subsequent setting of the input will cause a
refresh anyway, but then with the correct new input with fewer nodes.
This solves the case mentioned in [1]: a folder containing 50000 files,
visible (not expanded) in the staging view, then ignored: took several
minutes on GTK because the view then tried to display 50000+ files as a
flat list before setting the new input, which doesn't contain that huge
folder anymore.
Note that this change does not fix the other performance problems
mentioned in bug 500106.
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=500106#c7
Bug: 500106
Change-Id: I5ce21fa6675cab949a100ccd8fab0c05c7314328
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>