diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-19 17:00:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-19 17:00:58 +0000 |
commit | 1bbbc601b0bb2297c8074bdacf3d6ef6cb3491e1 (patch) | |
tree | f7d5ca8118963a5c39bccb1db8d50a7e1d27ff51 /plugins/Db3x_mmap/src/dbheaders.cpp | |
parent | 2bded955e286f0fcb860e0ed3a1ff3574f7db52c (diff) |
dbx_mmap:
- support for the obsolete profiles detection;
- don't print errors during headers change
git-svn-id: http://svn.miranda-ng.org/main/trunk@9866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbheaders.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbheaders.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index f279b98cfa..005b0022ec 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -57,15 +57,16 @@ int CDb3Mmap::CreateDbHeaders(const DBSignature& _sign) static TCHAR tszOldHeaders[] =
LPGENT("This profile is too old to be updated with PluginUpdater, your database must be converted first.\n\nWould you like to read how to fix this?");
-int CDb3Mmap::CheckDbHeaders()
+int CDb3Mmap::CheckDbHeaders(bool bInteractive)
{
if (memcmp(m_dbHeader.signature, &dbSignatureU, sizeof(m_dbHeader.signature)) &&
memcmp(m_dbHeader.signature, &dbSignatureE, sizeof(m_dbHeader.signature)))
{
if (!memcmp(&m_dbHeader.signature, &dbSignatureIM, sizeof(m_dbHeader.signature)) ||
- !memcmp(&m_dbHeader.signature, &dbSignatureSA, sizeof(m_dbHeader.signature)) ||
- !memcmp(&m_dbHeader.signature, &dbSignatureSD, sizeof(m_dbHeader.signature)))
- {
+ !memcmp(&m_dbHeader.signature, &dbSignatureSA, sizeof(m_dbHeader.signature)))
+ return EGROKPRF_OBSOLETE;
+
+ if (bInteractive && !memcmp(&m_dbHeader.signature, &dbSignatureSD, sizeof(m_dbHeader.signature))) {
if (IDYES == MessageBox(NULL, TranslateTS(tszOldHeaders), TranslateT("Obsolete database format"), MB_YESNO | MB_ICONWARNING)) {
TCHAR tszCurPath[MAX_PATH];
GetModuleFileName(NULL, tszCurPath, SIZEOF(tszCurPath));
@@ -87,9 +88,12 @@ int CDb3Mmap::CheckDbHeaders() }
switch (m_dbHeader.version) {
+ case DB_OLD_VERSION:
case DB_094_VERSION:
- case DB_095_1_VERSION:
case DB_095_VERSION:
+ return EGROKPRF_OBSOLETE;
+
+ case DB_095_1_VERSION:
break;
default:
|