diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-20 11:09:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-20 11:09:16 +0000 |
commit | e35464b3a1c3a5af68b348803049d90d73c1bc0d (patch) | |
tree | be5f05a3cb1b490653132afb735d9befeba4352b /plugins/Db3x_mmap/src/dbcontacts.cpp | |
parent | 7663d8886a2e059232287b6652ead02142f6d6fc (diff) |
all profile conversion stuff moved to dbchecker
git-svn-id: http://svn.miranda-ng.org/main/trunk@9880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbcontacts.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbcontacts.cpp | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index 218080763a..44af1cdc95 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -376,36 +376,6 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) return ret;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-// contacts convertor
-
-#define OLD_CONTACT_SIZE offsetof(DBContact, dwContactID)
-
-void CDb3Mmap::ConvertContacts()
-{
- DBContact *pPrev = NULL;
-
- m_dbHeader.ofsUser = ReallocSpace(m_dbHeader.ofsUser, OLD_CONTACT_SIZE, sizeof(DBContact));
- DBWrite(0, &m_dbHeader, sizeof(m_dbHeader));
-
- for (DWORD dwOffset = m_dbHeader.ofsFirstContact; dwOffset != 0;) {
- DBContact *pOld = (DBContact*)DBRead(dwOffset, sizeof(DBContact), NULL);
- DWORD dwNew = ReallocSpace(dwOffset, OLD_CONTACT_SIZE, sizeof(DBContact));
- DBContact *pNew = (DBContact*)DBRead(dwNew, sizeof(DBContact), NULL);
- pNew->dwContactID = m_dwMaxContactId++;
-
- if (pPrev == NULL)
- m_dbHeader.ofsFirstContact = dwNew;
- else
- pPrev->ofsNext = dwNew;
- pPrev = pNew;
-
- m_contactsMap.insert(new ConvertedContact(dwOffset, pNew->dwContactID));
- dwOffset = pNew->ofsNext;
- }
-
- FlushViewOfFile(m_pDbCache, 0);
-}
void CDb3Mmap::FillContacts()
{
@@ -416,13 +386,9 @@ void CDb3Mmap::FillContacts() if (p->signature != DBCONTACT_SIGNATURE)
break;
- DWORD dwContactID;
- if (m_dbHeader.version >= DB_095_VERSION) {
- dwContactID = p->dwContactID;
- if (dwContactID >= m_dwMaxContactId)
- m_dwMaxContactId = dwContactID + 1;
- }
- else dwContactID = m_dwMaxContactId++;
+ DWORD dwContactID = p->dwContactID;
+ if (dwContactID >= m_dwMaxContactId)
+ m_dwMaxContactId = dwContactID + 1;
DBCachedContact *cc = m_cache->AddContactToCache(dwContactID);
cc->dwDriverData = dwOffset;
|