To align with other classes and for easier future usage, perhaps;:

QMailFolderId folderId(currentFolderId);
    if (folderId.isValid()) {
        m_currentFolderId = folderId;