MainWindow: Make activateView activate a view in another space if needed
So far activateView looked in the current viewspace for a document's view, if it didn't exist it just created a new one. Our previous implemention of views always had the same views open everywhere so it didn't matter.
However, since a year or so each viewspace can have different set of views. This change will change the behaviour in the following way:
- If no views exist for a doc => create new
- If there is only one viewspace => switch to the view / create new
- If the doc has a view in the current space => switch to the view
- If the doc does not have a view in the current space => finding the viewspace that has it and activate that view
This doesnot change openUrl() behaviour. It only affects direct calls to activateView which are made from Documents plugin and TabSwitcher plugin.
Edited by Waqar Ahmed