Properly support disabled projects.

Until now, this only worked for SubProject items.

Change-Id: Id63424883d0c120567860f225f112635c7ea0c82
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>