diff options
Diffstat (limited to 'plugins/Popup/src/common.h')
-rw-r--r-- | plugins/Popup/src/common.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 6f0f1b8ab2..819d9fabe0 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -53,17 +53,8 @@ inline int Percentile2Byte(int vPerc) { return (vPerc * 255) / 100; } //===== Strings & MirandaDB ==================
inline char *db_get_s(MCONTACT hContact, const char *ModuleName, const char *SettingName, const char *Default)
{
- DBVARIANT dbv;
- db_get(hContact, ModuleName, SettingName, &dbv);
-
- char *result = 0;
- if (dbv.type == DBVT_ASCIIZ)
- result = mir_strdup(dbv.pszVal);
- else if (Default)
- result = mir_strdup(Default);
-
- db_free(&dbv);
- return result;
+ char *result = db_get_sa(hContact, ModuleName, SettingName);
+ return result ? result : mir_strdup(Default);
}
inline INT_PTR DBGetContactSettingStringX(MCONTACT hContact, const char *ModuleName, const char *SettingName, const char *Default, const int retType)
|