diff options
Diffstat (limited to 'plugins/Clist_nicer/src/clcitems.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 6f4324c90e..0d2f452208 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -83,7 +83,7 @@ void LoadAvatarForContact(ClcContact *p) if (p->pExtra)
dwFlags = p->pExtra->dwDFlags;
else
- dwFlags = cfg::getDword(p->hContact, "CList", "CLN_Flags", 0);
+ dwFlags = db_get_dw(p->hContact, "CList", "CLN_Flags", 0);
if (cfg::dat.dwFlags & CLUI_FRAME_AVATARS)
p->cFlags = (dwFlags & ECF_HIDEAVATAR ? p->cFlags & ~ECF_AVATAR : p->cFlags | ECF_AVATAR);
@@ -107,8 +107,8 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact) int i = coreCli.pfnAddContactToGroup(dat, group, hContact);
ClcContact* p = group->cl.items[i];
- p->wStatus = cfg::getWord(hContact, p->proto, "Status", ID_STATUS_OFFLINE);
- p->xStatus = cfg::getByte(hContact, p->proto, "XStatusId", 0);
+ p->wStatus = db_get_w(hContact, p->proto, "Status", ID_STATUS_OFFLINE);
+ p->xStatus = db_get_b(hContact, p->proto, "XStatusId", 0);
if (p->proto)
p->bIsMeta = !mir_strcmp(p->proto, META_PROTO);
@@ -124,8 +124,8 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact) p->metaProto = NULL;
}
- p->codePage = cfg::getDword(hContact, "Tab_SRMsg", "ANSIcodepage", cfg::getDword(hContact, "UserInfo", "ANSIcodepage", CP_ACP));
- p->bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", cfg::dat.dualRowMode);
+ p->codePage = db_get_dw(hContact, "Tab_SRMsg", "ANSIcodepage", db_get_dw(hContact, "UserInfo", "ANSIcodepage", CP_ACP));
+ p->bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", cfg::dat.dualRowMode);
if (dat->bisEmbedded)
p->pExtra = 0;
@@ -143,7 +143,7 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact) RTL_DetectAndSet(p, p->hContact);
p->avatarLeft = p->extraIconRightBegin = -1;
- p->flags |= cfg::getByte(p->hContact, "CList", "Priority", 0) ? CONTACTF_PRIORITY : 0;
+ p->flags |= db_get_b(p->hContact, "CList", "Priority", 0) ? CONTACTF_PRIORITY : 0;
return i;
}
@@ -158,11 +158,11 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) RowHeight::getMaxRowHeight(dat, hwnd);
dat->list.expanded = 1;
- dat->list.hideOffline = cfg::getByte("CLC", "HideOfflineRoot", 0);
+ dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", 0);
dat->list.cl.count = 0;
dat->list.totalMembers = 0;
dat->selection = -1;
- dat->SelectMode = cfg::getByte("CLC", "SelectMode", 0);
+ dat->SelectMode = db_get_b(NULL, "CLC", "SelectMode", 0);
{
for (int i = 1;; i++) {
DWORD groupFlags;
@@ -176,7 +176,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (style & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(hContact, NULL, dat)) {
memset(&dbv, 0, sizeof(dbv));
- if (cfg::getTString(hContact, "CList", "Group", &dbv))
+ if (db_get_ts(hContact, "CList", "Group", &dbv))
group = &dat->list;
else {
group = pcli->pfnAddGroup(hwnd, dat, dbv.ptszVal, (DWORD)-1, 0, 0);
@@ -191,7 +191,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) if (!pcli->pfnIsHiddenMode(dat, ID_STATUS_OFFLINE))
AddContactToGroup(dat, group, hContact);
}
- else if (!pcli->pfnIsHiddenMode(dat, (WORD)cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
+ else if (!pcli->pfnIsHiddenMode(dat, (WORD)db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
AddContactToGroup(dat, group, hContact);
}
else AddContactToGroup(dat, group, hContact);
@@ -239,7 +239,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) MCONTACT hContact = p->hContact;
DBVARIANT dbv = { 0 };
- INT_PTR result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv);
+ INT_PTR result = db_get_ts(hContact, "CList", "StatusMsg", &dbv);
if (!result && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
@@ -248,11 +248,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (szProto) {
if (!result)
db_free(&dbv);
- if (!(result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ if (!(result = db_get_ts(hContact, szProto, "YMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if (!(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "StatusDescr", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if (!(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ts(hContact, szProto, "XStatusMsg", &dbv)) && mir_tstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -260,7 +260,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid == STATUSMSG_NOTFOUND) { // no status msg, consider xstatus name (if available)
if (!result)
db_free(&dbv);
- result = cfg::getTString(hContact, szProto, "XStatusName", &dbv);
+ result = db_get_ts(hContact, szProto, "XStatusName", &dbv);
if (!result && mir_tstrlen(dbv.ptszVal) > 1) {
size_t iLen = mir_tstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
@@ -402,40 +402,40 @@ void GetExtendedInfo(ClcContact *contact, ClcData *dat) if (p == NULL)
return;
- p->msgFrequency = cfg::getDword(contact->hContact, "CList", "mf_freq", 0x7fffffff);
+ p->msgFrequency = db_get_dw(contact->hContact, "CList", "mf_freq", 0x7fffffff);
if (p->valid)
return;
p->valid = TRUE;
- p->isChatRoom = cfg::getByte(contact->hContact, contact->proto, "ChatRoom", 0);
+ p->isChatRoom = db_get_b(contact->hContact, contact->proto, "ChatRoom", 0);
}
void LoadSkinItemToCache(TExtraCache *cEntry)
{
MCONTACT hContact = cEntry->hContact;
- if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
+ if (db_get_b(hContact, "EXTBK", "VALID", 0)) {
if (cEntry->status_item == NULL)
cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
memset(cEntry->status_item, 0, sizeof(StatusItems_t));
mir_strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
cEntry->status_item->IGNORED = 0;
- cEntry->status_item->TEXTCOLOR = cfg::getDword(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
- cEntry->status_item->COLOR = cfg::getDword(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
- cEntry->status_item->COLOR2 = cfg::getDword(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
- cEntry->status_item->ALPHA = (BYTE)cfg::getByte(hContact, "EXTBK", "ALPHA", 100);
+ cEntry->status_item->TEXTCOLOR = db_get_dw(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
+ cEntry->status_item->COLOR = db_get_dw(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
+ cEntry->status_item->COLOR2 = db_get_dw(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
+ cEntry->status_item->ALPHA = (BYTE)db_get_b(hContact, "EXTBK", "ALPHA", 100);
- cEntry->status_item->MARGIN_LEFT = (DWORD)cfg::getByte(hContact, "EXTBK", "LEFT", 0);
- cEntry->status_item->MARGIN_RIGHT = (DWORD)cfg::getByte(hContact, "EXTBK", "RIGHT", 0);
- cEntry->status_item->MARGIN_TOP = (DWORD)cfg::getByte(hContact, "EXTBK", "TOP", 0);
- cEntry->status_item->MARGIN_BOTTOM = (DWORD)cfg::getByte(hContact, "EXTBK", "BOTTOM", 0);
+ cEntry->status_item->MARGIN_LEFT = (DWORD)db_get_b(hContact, "EXTBK", "LEFT", 0);
+ cEntry->status_item->MARGIN_RIGHT = (DWORD)db_get_b(hContact, "EXTBK", "RIGHT", 0);
+ cEntry->status_item->MARGIN_TOP = (DWORD)db_get_b(hContact, "EXTBK", "TOP", 0);
+ cEntry->status_item->MARGIN_BOTTOM = (DWORD)db_get_b(hContact, "EXTBK", "BOTTOM", 0);
- cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)cfg::getByte(hContact, "EXTBK", "TRANS", 1);
- cEntry->status_item->BORDERSTYLE = cfg::getDword(hContact, "EXTBK", "BDR", 0);
+ cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)db_get_b(hContact, "EXTBK", "TRANS", 1);
+ cEntry->status_item->BORDERSTYLE = db_get_dw(hContact, "EXTBK", "BDR", 0);
- cEntry->status_item->CORNER = cfg::getByte(hContact, "EXTBK", "CORNER", 0);
- cEntry->status_item->GRADIENT = cfg::getByte(hContact, "EXTBK", "GRAD", 0);
+ cEntry->status_item->CORNER = db_get_b(hContact, "EXTBK", "CORNER", 0);
+ cEntry->status_item->GRADIENT = db_get_b(hContact, "EXTBK", "GRAD", 0);
}
else if (cEntry->status_item) {
free(cEntry->status_item);
@@ -451,7 +451,7 @@ void LoadSkinItemToCache(TExtraCache *cEntry) int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData *dat)
{
- int dbHidden = cfg::getByte(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
+ int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
// always hide subcontacts (but show them on embedded contact lists)
if (dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && db_mc_isSub(hContact))
@@ -464,10 +464,10 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str szProto = GetContactProto(hContact);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
- DWORD dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0);
+ DWORD dwLocalMask = db_get_dw(hContact, "CLVM", cfg::dat.current_viewmode, 0);
if (dwLocalMask != 0) {
if (cfg::dat.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
}
return 0;
@@ -496,7 +496,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str }
if (cfg::dat.bFilterEffective & CLVM_FILTER_STATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
filterResult = (cfg::dat.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0));
}
|