From a6b9f6570b4cb4a425f91d4694e6b027f12cc8b7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 14 Nov 2018 15:57:47 +0300 Subject: hContact, MODULENAME -> g_plugin --- plugins/BasicHistory/src/HistoryWindow.cpp | 26 +++++++++++++------------- plugins/BasicHistory/src/Options.cpp | 8 ++++---- plugins/BasicHistory/src/Scheduler.cpp | 3 --- 3 files changed, 17 insertions(+), 20 deletions(-) (limited to 'plugins/BasicHistory') diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index ebac3bd0c5..17c78befc3 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1608,14 +1608,14 @@ void HistoryWindow::RestorePos() contactToLoad = NULL; } - if (db_get_b(contactToLoad, MODULENAME, "history_ismax", 0)) + if (g_plugin.getByte(contactToLoad, "history_ismax")) ShowWindow(m_hWnd, SW_SHOWMAXIMIZED); - LONG pos = db_get_dw(contactToLoad, MODULENAME, "history_splitterv", 0); + LONG pos = g_plugin.getDword(contactToLoad, "history_splitterv"); if (pos > 0) SplitterMoved(splitterYhWnd, pos, false); - pos = db_get_dw(contactToLoad, MODULENAME, "history_splitter", 0); + pos = g_plugin.getDword(contactToLoad, "history_splitter"); if (pos > 0) SplitterMoved(splitterXhWnd, pos, false); } @@ -1625,13 +1625,13 @@ void HistoryWindow::SavePos(bool all) MCONTACT contactToSave = m_hContact; if (all) { for (auto &_hContact : Contacts()) { - db_unset(_hContact, MODULENAME, "history_x"); - db_unset(_hContact, MODULENAME, "history_y"); - db_unset(_hContact, MODULENAME, "history_width"); - db_unset(_hContact, MODULENAME, "history_height"); - db_unset(_hContact, MODULENAME, "history_ismax"); - db_unset(_hContact, MODULENAME, "history_splitterv"); - db_unset(_hContact, MODULENAME, "history_splitter"); + g_plugin.delSetting(_hContact, "history_x"); + g_plugin.delSetting(_hContact, "history_y"); + g_plugin.delSetting(_hContact, "history_width"); + g_plugin.delSetting(_hContact, "history_height"); + g_plugin.delSetting(_hContact, "history_ismax"); + g_plugin.delSetting(_hContact, "history_splitterv"); + g_plugin.delSetting(_hContact, "history_splitter"); } contactToSave = NULL; @@ -1641,9 +1641,9 @@ void HistoryWindow::SavePos(bool all) WINDOWPLACEMENT wp; wp.length = sizeof(wp); GetWindowPlacement(m_hWnd, &wp); - db_set_b(contactToSave, MODULENAME, "history_ismax", wp.showCmd == SW_MAXIMIZE ? 1 : 0); - db_set_dw(contactToSave, MODULENAME, "history_splitterv", splitterX); - db_set_dw(contactToSave, MODULENAME, "history_splitter", splitterY); + g_plugin.setByte(contactToSave, "history_ismax", wp.showCmd == SW_MAXIMIZE ? 1 : 0); + g_plugin.setDword(contactToSave, "history_splitterv", splitterX); + g_plugin.setDword(contactToSave, "history_splitter", splitterY); } #define DEF_FILTERS_START 50000 diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index f1434cf30e..0190050341 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -545,10 +545,10 @@ void Options::SaveTasks(std::list* tasks) mir_snprintf(buf, "IsInTask_%d", i); for (auto &hContact : Contacts()) - db_unset(hContact, MODULENAME, buf); + g_plugin.delSetting(hContact, buf); for (size_t j = 0; j < it->contacts.size(); ++j) - db_set_b(it->contacts[j], MODULENAME, buf, 1); + g_plugin.setByte(it->contacts[j], buf, 1); it->orderNr = i++; taskOptions.push_back(*it); @@ -600,7 +600,7 @@ void Options::SaveTasks(std::list* tasks) mir_snprintf(buf, "IsInTask_%d", i); for (auto &hContact : Contacts()) - db_unset(hContact, MODULENAME, buf); + g_plugin.delSetting(hContact, buf); } } @@ -686,7 +686,7 @@ void Options::LoadTasks() mir_snprintf(buf, "IsInTask_%d", i); for (auto &hContact : Contacts()) - if (db_get_b(hContact, MODULENAME, buf, 0) == 1) + if (g_plugin.getByte(hContact, buf) == 1) to.contacts.push_back(hContact); to.orderNr = i; diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 9e15d37eeb..695f7b286d 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -21,9 +21,6 @@ along with this program. If not, see . #include "ExportManager.h" #include "HistoryWindow.h" -// Sorry for plain C implementation -#define MODULENAME "BasicHistory" - bool bPopupsEnabled; bool DoTask(TaskOptions& to); bool IsValidTask(TaskOptions& to, std::list* top = nullptr, std::wstring* err = nullptr, std::wstring* errDescr = nullptr); -- cgit v1.2.3