Move commhistory data dir getter to its own header

To avoid dependency on QSqlDatabase