rem: fwrite(&msgid, sizeof(msgid), 1, sortStream); fwrite(&parent_id, sizeof(parent_id), 1, sortStream);
add: unsigned long msgSerNum; unsigned long parentSerNum; msgSerNum = kernel->msgDict()->getMsgSerNum( folder, msgid ); if (parent_id >= 0) parentSerNum = kernel->msgDict()->getMsgSerNum( folder, parent_id ) + KMAIL_RESERVED; else parentSerNum = (unsigned long)(parent_id + KMAIL_RESERVED);  fwrite(&msgSerNum, sizeof(msgSerNum), 1, sortStream); fwrite(&parentSerNum, sizeof(parentSerNum), 1, sortStream);
context: static void internalWriteItem(FILE *sortStream, int msgid, int parent_id,			      QString key, bool update_discover=TRUE){  fwrite(&msgid, sizeof(msgid), 1, sortStream);  fwrite(&parent_id, sizeof(parent_id), 1, sortStream);  Q_INT32 len = key.length() * sizeof(QChar);  fwrite(&len, sizeof(len), 1, sortStream);  if (len)    fwrite(key.unicode(), QMIN(len, KMAIL_MAX_KEY_LEN), 1, sortStream);  if (update_discover) {    //update the discovered change count      Q_INT32 discovered_count = 0;      fseek(sortStream, KMAIL_MAGIC_HEADER_OFFSET + 16, SEEK_SET);      fread(&discovered_count, sizeof(discovered_count), 1, sortStream);      discovered_count++;      fseek(sortStream, KMAIL_MAGIC_HEADER_OFFSET + 16, SEEK_SET);      fwrite(&discovered_count, sizeof(discovered_count), 1, sortStream);  }}