diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-03 22:25:13 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-03 22:25:13 +0000 |
commit | 67e460ae2bf43109b9095c518cd2ede4e043e202 (patch) | |
tree | d4b6afb98a75fa4142b2980b792e92ee8f8fc11a /protocols/JabberG/src/jabber_xstatus.cpp | |
parent | 784c2757e8c791b4c76a6e739f08b0fb92ec093a (diff) |
ptrT/A/W is used everywhere instead of DBVARIANT to read database strings
git-svn-id: http://svn.miranda-ng.org/main/trunk@6322 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_xstatus.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index e220c14302..1e18c1fbc2 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -283,13 +283,8 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *) if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
mir_snprintf(szSetting, SIZEOF(szSetting), "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
- DBVARIANT dbv;
- if ( !m_proto->getTString(szSetting, &dbv)) {
- m_txtDescription.SetText(dbv.ptszVal);
- db_free(&dbv);
- }
- else m_txtDescription.SetTextA("");
-
+ ptrT szDescr( m_proto->getTStringA(szSetting));
+ m_txtDescription.SetText((szDescr != NULL) ? szDescr : _T(""));
m_txtDescription.Enable(true);
}
else {
@@ -1494,32 +1489,18 @@ void CJabberProto::WriteAdvStatus(HANDLE hContact, const char *pszSlot, const TC }
}
-char *CJabberProto::ReadAdvStatusA(HANDLE hContact, const char *pszSlot, const char *pszValue)
+char* CJabberProto::ReadAdvStatusA(HANDLE hContact, const char *pszSlot, const char *pszValue)
{
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
-
- DBVARIANT dbv;
- if ( db_get_s(hContact, "AdvStatus", szSetting, &dbv))
- return NULL;
-
- char *res = mir_strdup(dbv.pszVal);
- db_free(&dbv);
- return res;
+ return db_get_sa(hContact, "AdvStatus", szSetting);
}
-TCHAR *CJabberProto::ReadAdvStatusT(HANDLE hContact, const char *pszSlot, const char *pszValue)
+TCHAR* CJabberProto::ReadAdvStatusT(HANDLE hContact, const char *pszSlot, const char *pszValue)
{
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
-
- DBVARIANT dbv;
- if ( db_get_ts(hContact, "AdvStatus", szSetting, &dbv))
- return NULL;
-
- TCHAR *res = mir_tstrdup(dbv.ptszVal);
- db_free(&dbv);
- return res;
+ return db_get_tsa(hContact, "AdvStatus", szSetting);
}
///////////////////////////////////////////////////////////////////////////////
|