summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-12 18:34:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-12 18:34:27 +0300
commit35a2b1771115068077ce6db13860766e70405de1 (patch)
tree3c58de2e19d5b3be66eb7b74cd631ca4fcc1bba3 /src/mir_core
parentfc1b90ac5521548d3062062faf72e7fc2196122e (diff)
MIDatabase became pure interface
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/db.cpp6
-rw-r--r--src/mir_core/src/mc.cpp10
-rw-r--r--src/mir_core/src/miranda.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index fc5d570423..c4da5668d1 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-MIDatabase *currDb = nullptr;
+MDatabaseCommon *currDb = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
// database functions
@@ -400,7 +400,7 @@ MIR_CORE_DLL(INT_PTR) db_unset(MCONTACT hContact, const char *szModule, const ch
MIR_CORE_DLL(DBCachedContact*) db_get_contact(MCONTACT hContact)
{
- return (currDb == nullptr) ? nullptr : currDb->m_cache->GetCachedContact(hContact);
+ return (currDb == nullptr) ? nullptr : currDb->getCache()->GetCachedContact(hContact);
}
MIR_CORE_DLL(MCONTACT) db_find_first(const char *szProto)
@@ -413,7 +413,7 @@ MIR_CORE_DLL(MCONTACT) db_find_next(MCONTACT hContact, const char *szProto)
return (currDb == nullptr) ? NULL : currDb->FindNextContact(hContact, szProto);
}
-extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase *_db)
+extern "C" MIR_CORE_DLL(void) db_setCurrent(MDatabaseCommon *_db)
{
currDb = _db;
diff --git a/src/mir_core/src/mc.cpp b/src/mir_core/src/mc.cpp
index ee87cbbb55..aa55f22331 100644
--- a/src/mir_core/src/mc.cpp
+++ b/src/mir_core/src/mc.cpp
@@ -38,7 +38,7 @@ DBCachedContact* CheckMeta(MCONTACT hMeta)
if (!g_bEnabled)
return nullptr;
- DBCachedContact *cc = currDb->m_cache->GetCachedContact(hMeta);
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hMeta);
return (cc == nullptr || cc->nSubs == -1) ? nullptr : cc;
}
@@ -79,7 +79,7 @@ MIR_CORE_DLL(BOOL) db_mc_isMeta(MCONTACT hContact)
{
if (currDb == nullptr || !g_bEnabled) return FALSE;
- DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
return (cc == nullptr) ? FALSE : cc->nSubs != -1;
}
@@ -87,7 +87,7 @@ MIR_CORE_DLL(BOOL) db_mc_isSub(MCONTACT hContact)
{
if (currDb == nullptr || !g_bEnabled) return FALSE;
- DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
return (cc == nullptr) ? FALSE : cc->parentID != 0;
}
@@ -120,7 +120,7 @@ MIR_CORE_DLL(MCONTACT) db_mc_getMeta(MCONTACT hSubContact)
{
if (currDb == nullptr) return NULL;
- DBCachedContact *cc = currDb->m_cache->GetCachedContact(hSubContact);
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hSubContact);
return (cc == nullptr) ? NULL : cc->parentID;
}
@@ -129,7 +129,7 @@ MIR_CORE_DLL(MCONTACT) db_mc_tryMeta(MCONTACT hContact)
{
if (currDb == nullptr) return hContact;
- DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
if (cc == nullptr) return hContact;
return (cc->IsSub()) ? cc->parentID : hContact;
diff --git a/src/mir_core/src/miranda.h b/src/mir_core/src/miranda.h
index adfd3ee846..cca2148589 100644
--- a/src/mir_core/src/miranda.h
+++ b/src/mir_core/src/miranda.h
@@ -43,7 +43,7 @@ extern HINSTANCE g_hInst;
extern HWND hAPCWindow;
extern HANDLE hThreadQueueEmpty;
extern HCURSOR g_hCursorNS, g_hCursorWE;
-extern MIDatabase *currDb;
+extern MDatabaseCommon *currDb;
/////////////////////////////////////////////////////////////////////////////////////////
// modules.cpp