diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-19 11:48:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-19 11:48:12 +0000 |
commit | 8dc7456651251bc112b9edd9b5fd1c4849d7c83d (patch) | |
tree | 3e2e376197c49e77488c109a129ea269b08cb38f /plugins/Db3x_mmap/src/dbcontacts.cpp | |
parent | 8d428350dc3307f8ada75fafece2049cca84e969 (diff) |
import to open a database in read-only mode
git-svn-id: http://svn.miranda-ng.org/main/trunk@8172 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbcontacts.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbcontacts.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index ae0ef7fd36..0f305a2532 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -234,10 +234,15 @@ void CDb3Mmap::FillContacts() if (p->signature != DBCONTACT_SIGNATURE)
break;
- if (p->dwContactID > m_dwMaxContactId)
- m_dwMaxContactId = p->dwContactID + 1;
+ DWORD dwContactID;
+ if (m_dbHeader.version == DB_095_VERSION) {
+ dwContactID = p->dwContactID;
+ if (dwContactID > m_dwMaxContactId)
+ m_dwMaxContactId = dwContactID + 1;
+ }
+ else dwContactID = m_dwMaxContactId++;
- DBCachedContact *cc = m_cache->AddContactToCache(p->dwContactID);
+ DBCachedContact *cc = m_cache->AddContactToCache(dwContactID);
cc->dwDriverData = dwOffset;
CheckProto(cc, "");
|