summaryrefslogtreecommitdiff
path: root/protocols/MinecraftDynmap/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-08 20:12:16 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-08 20:12:26 +0300
commit8ffc77be71507825a8f7585bcabff8ccc370206a (patch)
treeaa13a8070f31286db6ad22e17a577e547942f951 /protocols/MinecraftDynmap/src
parent41b2fdfc654e3eec07c97ceba00cda13d988ffff (diff)
db_get_sa / db_get_wsa to receive the default value, massive code simplification
Diffstat (limited to 'protocols/MinecraftDynmap/src')
-rw-r--r--protocols/MinecraftDynmap/src/chat.cpp6
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.cpp2
2 files changed, 2 insertions, 6 deletions
diff --git a/protocols/MinecraftDynmap/src/chat.cpp b/protocols/MinecraftDynmap/src/chat.cpp
index 50be132450..05b1385fb5 100644
--- a/protocols/MinecraftDynmap/src/chat.cpp
+++ b/protocols/MinecraftDynmap/src/chat.cpp
@@ -161,11 +161,7 @@ void MinecraftDynmapProto::SetChatStatus(int status)
if (status == ID_STATUS_ONLINE)
{
// Load actual name from database
- ptrA nick(db_get_sa(0, m_szModuleName, MINECRAFTDYNMAP_KEY_NAME));
- if (!nick) {
- nick = mir_strdup(Translate("You"));
- db_set_s(0, m_szModuleName, MINECRAFTDYNMAP_KEY_NAME, nick);
- }
+ ptrA nick(db_get_sa(0, m_szModuleName, MINECRAFTDYNMAP_KEY_NAME, Translate("You")));
m_nick = nick;
// Add self contact
diff --git a/protocols/MinecraftDynmap/src/dialogs.cpp b/protocols/MinecraftDynmap/src/dialogs.cpp
index f682fd5c7b..6c93788c81 100644
--- a/protocols/MinecraftDynmap/src/dialogs.cpp
+++ b/protocols/MinecraftDynmap/src/dialogs.cpp
@@ -48,7 +48,7 @@ HANDLE GetIconHandle(const char* name) {
static void LoadDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- ptrW tstr(db_get_wsa(NULL, ppro->m_szModuleName, szSetting));
+ ptrW tstr(db_get_wsa(0, ppro->m_szModuleName, szSetting));
if (tstr)
SetDlgItemText(hwnd, idCtrl, tstr);
}