Made changes to comply with modified message_db api. Attempted quick fix of using parent pointer to fix crash in ATopLevelWindow as suggested in the issue, but it didn't work (maybe it needs to be cast to KeyhoteeMainWindow instead of just QWidget?), so instead I just commented out the crashing code in ATopLevelWindow as a workaround. Left some comments about suggested changes to mail handling, needs discussion with vogel (assuming he disagrees with me :-).