Unselect layer in catalogtree when removed in layer manager
Use function to access element
Refactoring based on comments
Adding comment
Merge pull request #375 from geoadmin/dev_catalogtree_unselect

Unselect layer in catalogtree when removed in layer manager

Adapted according to @elemoine's comment. Thanks alot for the reviews.