summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-22 20:19:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-22 20:19:01 +0300
commit581319b8cd1f774e5fc42db570d44ec2b4e41485 (patch)
tree42234da7ead10b3f9421602f5636913ffcb35c72 /plugins/Dbx_mdbx/src
parent3285170a72a34d78e178b2b8117a3622f3a1840a (diff)
temporary return of DbChecker
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r--plugins/Dbx_mdbx/src/dbcheck.cpp29
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp29
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.h16
3 files changed, 73 insertions, 1 deletions
diff --git a/plugins/Dbx_mdbx/src/dbcheck.cpp b/plugins/Dbx_mdbx/src/dbcheck.cpp
new file mode 100644
index 0000000000..e636e196c4
--- /dev/null
+++ b/plugins/Dbx_mdbx/src/dbcheck.cpp
@@ -0,0 +1,29 @@
+/*
+
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright (C) 2012-20 Miranda NG team (https://miranda-ng.org)
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "stdafx.h"
+
+int CDbxMDBX::CheckEvents1(void)
+{
+ return 0;
+}
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp
index 328a981880..6822eda603 100644
--- a/plugins/Dbx_mdbx/src/dbintf.cpp
+++ b/plugins/Dbx_mdbx/src/dbintf.cpp
@@ -289,3 +289,32 @@ void CDbxMDBX::DBFlush(bool bForce)
else if (m_safetyMode)
m_impl.m_timer.Start(50);
}
+
+///////////////////////////////////////////////////////////////////////////////
+// MIDatabaseChecker
+
+typedef int (CDbxMDBX::*CheckWorker)(void);
+
+int CDbxMDBX::Start(DBCHeckCallback *callback)
+{
+ cb = callback;
+ return ERROR_SUCCESS;
+}
+
+static CheckWorker Workers[] =
+{
+ &CDbxMDBX::CheckEvents1
+};
+
+int CDbxMDBX::CheckDb(int phase, int)
+{
+ if (phase >= _countof(Workers))
+ return ERROR_OUT_OF_PAPER;
+
+ return (this->*Workers[phase])();
+}
+
+void CDbxMDBX::Destroy()
+{
+ delete this;
+}
diff --git a/plugins/Dbx_mdbx/src/dbintf.h b/plugins/Dbx_mdbx/src/dbintf.h
index 0a29c30a78..a16b7f85ee 100644
--- a/plugins/Dbx_mdbx/src/dbintf.h
+++ b/plugins/Dbx_mdbx/src/dbintf.h
@@ -136,7 +136,7 @@ struct EventItem
MEVENT eventId;
};
-class CDbxMDBX : public MDatabaseCommon, public MZeroedObject
+class CDbxMDBX : public MDatabaseCommon, public MIDatabaseChecker, public MZeroedObject
{
friend class CMdbxEventCursor;
@@ -251,6 +251,8 @@ public:
void StoreKey(void);
void SetPassword(const wchar_t *ptszPassword);
+ int CheckEvents1(void);
+
__forceinline LPSTR GetMenuTitle() const { return m_bUsesPassword ? (char*)LPGEN("Change/remove password") : (char*)LPGEN("Set password"); }
__forceinline bool isEncrypted() const { return m_bEncrypted; }
@@ -300,6 +302,18 @@ public:
STDMETHODIMP_(DB::EventCursor *) EventCursor(MCONTACT hContact, MEVENT hDbEvent) override;
STDMETHODIMP_(DB::EventCursor *) EventCursorRev(MCONTACT hContact, MEVENT hDbEvent) override;
+protected:
+ STDMETHODIMP_(MIDatabaseChecker *) GetChecker() override
+ {
+ return this;
+ }
+
+ STDMETHODIMP_(BOOL) Start(DBCHeckCallback *callback);
+ STDMETHODIMP_(BOOL) CheckDb(int phase, int firstTime);
+ STDMETHODIMP_(VOID) Destroy();
+
+ DBCHeckCallback *cb;
+
public:
MICryptoEngine *m_crypto;
};