From e35464b3a1c3a5af68b348803049d90d73c1bc0d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 Jul 2014 11:09:16 +0000 Subject: all profile conversion stuff moved to dbchecker git-svn-id: http://svn.miranda-ng.org/main/trunk@9880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbintf.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbintf.cpp') diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp index 5b1b8e9712..99d0126696 100644 --- a/plugins/Db3x_mmap/src/dbintf.cpp +++ b/plugins/Db3x_mmap/src/dbintf.cpp @@ -116,9 +116,6 @@ CDb3Mmap::~CDb3Mmap() free(m_pNull); } -static TCHAR szMsgConvert[] = - LPGENT("Your database must be converted into the new format. This is potentially dangerous operation and might damage your profile, so please make a backup before.\n\nClick Yes to proceed with conversion or No to exit Miranda"); - int CDb3Mmap::Load(bool bSkipInit) { log0("DB logging running"); @@ -146,17 +143,8 @@ int CDb3Mmap::Load(bool bSkipInit) // everything is ok, go on if (!m_bReadOnly) { - if (m_dbHeader.version < DB_095_1_VERSION) { - if (IDYES != MessageBox(NULL, TranslateTS(szMsgConvert), TranslateT("Database conversion required"), MB_YESNO | MB_ICONWARNING)) - return EGROKPRF_CANTREAD; - - if (m_dbHeader.version < DB_095_VERSION) - ConvertContacts(); - ConvertEvents(); - - m_dbHeader.version = DB_095_1_VERSION; - DBWrite(sizeof(dbSignatureU), &m_dbHeader.version, sizeof(m_dbHeader.version)); - } + if (m_dbHeader.version < DB_095_1_VERSION) + return EGROKPRF_CANTREAD; // we don't need events in the service mode if (ServiceExists(MS_DB_SETSAFETYMODE)) { @@ -183,11 +171,18 @@ int CDb3Mmap::Create() return (m_hDbFile == INVALID_HANDLE_VALUE); } -int CDb3Mmap::PrepareCheck() +int CDb3Mmap::PrepareCheck(int *error) { int ret = CheckDbHeaders(true); - if (ret != ERROR_SUCCESS) + switch (ret) { + case ERROR_SUCCESS: + case EGROKPRF_OBSOLETE: + *error = ret; + break; + + default: return ret; + } InitMap(); InitModuleNames(); -- cgit v1.2.3