summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/dialogs.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-12-20 03:22:13 +0000
committerRobert Pösel <robyer@seznam.cz>2014-12-20 03:22:13 +0000
commit1705273c443d069c82fac78ad34d909513af519b (patch)
tree0ca1a5a0aa1977ca69afd09371985032da06b45e /protocols/Omegle/src/dialogs.cpp
parent1f70e7a998a41fa0c85b129eb4584d44c166036c (diff)
Omegle: Various fixes and code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@11541 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Omegle/src/dialogs.cpp')
-rw-r--r--protocols/Omegle/src/dialogs.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp
index 01dbe75516..5678d6c50b 100644
--- a/protocols/Omegle/src/dialogs.cpp
+++ b/protocols/Omegle/src/dialogs.cpp
@@ -38,12 +38,9 @@ static BOOL StoreDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const ch
static void LoadDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- DBVARIANT dbv;
- if ( !db_get_ts(NULL, ppro->m_szModuleName, szSetting, &dbv))
- {
- SetDlgItemText(hwnd, idCtrl, dbv.ptszVal);
- db_free(&dbv);
- }
+ ptrT tstr( db_get_tsa(NULL, ppro->m_szModuleName, szSetting));
+ if (tstr)
+ SetDlgItemText(hwnd, idCtrl, tstr);
}
static void StoreDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
@@ -51,7 +48,7 @@ static void StoreDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* sz
TCHAR tstr[250+1];
GetDlgItemText(hwnd, idCtrl, tstr, SIZEOF(tstr));
- if ( _tcsclen( tstr ) > 0 ) {
+ if (tstr[0] != '\0') {
db_set_ts(NULL, ppro->m_szModuleName, szSetting, tstr);
} else {
db_unset(NULL, ppro->m_szModuleName, szSetting);