Half fix a problem with not being able to select folders while downloading mail.
Half fix a problem with not being able to select folders while downloading
mail.

Add some (probably ineffective) sanity checks. Probably I should convert
the static_casts to dynamic ones but this means I have to bloat kmail
with -rtti.

svn path=/trunk/kdenetwork/kmail/; revision=56599

lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi