(→Installation) |
(→Important Commits) |
||
| (3 intermediate revisions by one user not shown) | |||
| Line 5: | Line 5: | ||
==Installation== | ==Installation== | ||
| − | Update (7 May 2008): commit 805075 merged changes related to the SQLite mode for KMail indices | + | Update (7 May 2008): commit 805075 merged changes related to the SQLite mode for KMail indices from /branches/work/kmail-nommap (r799390..804487) and /branches/work/kdepim-nommap/kmail (r804484..804960) back to trunk. |
| − | from /branches/work/kmail-nommap (r799390..804487) /branches/work/kdepim-nommap/kmail (r804484..804960). | + | |
'''Thus, it is enough to use kdepim trunk now.''' Users of kdepim-nommap should execute ''emerge --unmerge kdepim-nommap'' and then ''emerge kdepim''. | '''Thus, it is enough to use kdepim trunk now.''' Users of kdepim-nommap should execute ''emerge --unmerge kdepim-nommap'' and then ''emerge kdepim''. | ||
| Line 160: | Line 159: | ||
*[http://websvn.kde.org/?view=rev&revision=803451 803451] - 'messages' table creation is now: "CREATE TABLE messages( id INTEGER PRIMARY KEY AUTOINCREMENT, data BLOB )" - added autoincremented 'id' PK column; updated all the code for this design; the value of ID column is now used for updating the dirty records (Fri May 2 22:12:35 2008 UTC) | *[http://websvn.kde.org/?view=rev&revision=803451 803451] - 'messages' table creation is now: "CREATE TABLE messages( id INTEGER PRIMARY KEY AUTOINCREMENT, data BLOB )" - added autoincremented 'id' PK column; updated all the code for this design; the value of ID column is now used for updating the dirty records (Fri May 2 22:12:35 2008 UTC) | ||
*[http://websvn.kde.org/?view=rev&revision=804186 804186] - KMFolderIndex::updateIndex() - fix result checking of writeMessages() -fetching emails from (d)imap seems to work smoothly now (Mon May 5 09:51:46 2008 UTC) | *[http://websvn.kde.org/?view=rev&revision=804186 804186] - KMFolderIndex::updateIndex() - fix result checking of writeMessages() -fetching emails from (d)imap seems to work smoothly now (Mon May 5 09:51:46 2008 UTC) | ||
| + | *[http://websvn.kde.org/?view=rev&revision=805075 805075] - changes related to the SQLite mode for KMail indices from /branches/work/kmail-nommap (r799390..804487) /branches/work/kdepim-nommap/kmail (r804484..804960) merged into trunk | ||
| + | **'''See the page devoted to [[/merge|validation of the merege]]''' and the [[/merge#Results|results]]. | ||
==Open Questions== | ==Open Questions== | ||
There are issues with locking index files for KMail folders and mmap()/munmap() operations on Windows. Therefore, SQLite-based indices are in development. This page presents detailed development notes for this task.
Design and implementation started by jstaniek 11:35, 23 April 2008 (CEST)
Contents |
Update (7 May 2008): commit 805075 merged changes related to the SQLite mode for KMail indices from /branches/work/kmail-nommap (r799390..804487) and /branches/work/kdepim-nommap/kmail (r804484..804960) back to trunk.
Thus, it is enough to use kdepim trunk now. Users of kdepim-nommap should execute emerge --unmerge kdepim-nommap and then emerge kdepim.
Old instructions follow:
branches/work/kdepim-nommap branch has been created for SQLite mode, being synced with kdepim trunk. The only difference is kmail/ subdirectory. To build it on Windows:
The last command will download the source code from the branch, with altered kmail/ source code, compile it and install. All the resulting files have the same names as in regular kdepim trunk. sqlite package will be also installed as a hard dependency of the kdepim-nommap package.
| TOPIC | PORTED | TESTED | NOTES |
|---|---|---|---|
| QString KMFolderIndex::indexLocation() | yes | added .db suffix to indicate the index is sqlite-based | |
| int KMFolderIndex::updateIndex() | yes | implemented using extended version of writeMessages() - with UpdateExistingMessages mode; still calls writeIndex() on writeMessages() failure and still (properly) does nothing if mDirty == false. | |
| int KMFolderIndex::writeIndex( bool createEmptyIndex ) | yes | creates db; creates tables messages table, insert messages to messages table, encoded as blobs using KMMsgBase::asIndexString(); header is not needed, but INDEX_VERSION is saved using PRAGMA user_version; byte order info is not saved: every integer is written using network order or as string | |
| bool KMFolderIndex::readIndex() | yes | "SELECT id, data FROM messages" is called | |
| int KMFolderIndex::count(bool cache) | yes | no changes | |
| bool KMFolderIndex::readIndexHeader(int *gv) | |||
| bool KMFolderIndex::updateIndexStreamPtr(bool) | removed | removed | |
| KMFolderIndex::IndexStatus KMFolderIndex::indexStatus() | yes | no changes so far; we have problems with trash folder being regenerated due to mtime of its .db file | |
| void KMFolderIndex::truncateIndex() | yes | yes | recreate the db |
| void KMFolderIndex::fillMessageDict() | yes | no change as it just inserts messages from KMFolderIndex::mMsgList into KMMsgDict | |
| KMMsgInfo* KMFolderIndex::setIndexEntry( int idx, KMMessage *msg ) | yes | no change as it just sets creates a new KMMsgInfo object and inserts it into KMFolderIndex::mMsgList | |
| bool KMFolderIndex::recreateIndex() | yes | no changes as it just calls createIndexFromContents() and readIndex() | |
| off_t KMFolderIndex::mHeaderOffset | replace its public use (e.g. in KMFolderIndex::truncateIndex()) with additional bool indexOpened() | ||
| FILE* KMFolderIndex::mIndexStream, uchar* mIndexStreamPtr, size_t mIndexStreamPtrLength, bool mIndexSwapByteOrder, int mIndexSizeOfLong | these members are unused for SQLite mode because are related to file strorage; moreover byte order and size of long is handled by SQLite in a portable way | ||
| bool KMMsgBase::syncIndexString() const | removed | removed | completely removed in SQLite mode because we want to keep all SQLite-specific operations in kmfolderindex_sqlite.cpp; KMFolderIndex::updateIndex() does this now using SQL commands |
| QString KMMsgBase::getStringPart(MsgPartType t) const | yes | yes | data from mData member is returned and mIndexLength value is used; then KMFolderIndex uses SQL commands to save the date when needed |