diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-02 11:59:43 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-02 11:59:43 +0300 |
commit | 82e1444c01f0ab700c385ff0f846858c7f627c36 (patch) | |
tree | b33c5ce0918fb8b5053d0079eecdefe7c8f95b48 /plugins/Dbx_mdbx/src/init.cpp | |
parent | 704258cde008db0e80b9d5459833c3c2b6a3f09d (diff) |
Dbx_mdbx:
- unused class members removed;
- added function TouchFile() to change access date & time on loading & exit
Diffstat (limited to 'plugins/Dbx_mdbx/src/init.cpp')
-rw-r--r-- | plugins/Dbx_mdbx/src/init.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Dbx_mdbx/src/init.cpp b/plugins/Dbx_mdbx/src/init.cpp index 1fd64d825b..f90995b02c 100644 --- a/plugins/Dbx_mdbx/src/init.cpp +++ b/plugins/Dbx_mdbx/src/init.cpp @@ -43,15 +43,13 @@ static PLUGININFOEX pluginInfo = HINSTANCE g_hInst = nullptr;
-LIST<CDbxMDBX> g_Dbs(1, HandleKeySortT);
-
/////////////////////////////////////////////////////////////////////////////////////////
// returns 0 if the profile is created, EMKPRF*
static int makeDatabase(const TCHAR *profile)
{
std::unique_ptr<CDbxMDBX> db(new CDbxMDBX(profile, 0));
- return db->Create();
+ return (db->Map() == MDBX_SUCCESS) ? 0 : EGROKPRF_CANTREAD;
}
// returns 0 if the given profile has a valid header
@@ -68,10 +66,12 @@ static MDatabaseCommon* LoadDatabase(const TCHAR *profile, BOOL bReadOnly) mir_getLP(&pluginInfo);
std::unique_ptr<CDbxMDBX> db(new CDbxMDBX(profile, (bReadOnly) ? DBMODE_READONLY : 0));
- if (db->Load(false) != ERROR_SUCCESS)
+ if (db->Map() != ERROR_SUCCESS)
+ return nullptr;
+
+ if (db->Load() != ERROR_SUCCESS)
return nullptr;
- g_Dbs.insert(db.get());
return db.release();
}
|