A Maschke Type Theorem for Doi–Hopf Modules and Applications