diff options
Diffstat (limited to 'protocols/IcqOscarJ/src')
-rw-r--r-- | protocols/IcqOscarJ/src/changeinfo/editlist.cpp | 49 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_fieldnames.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_fieldnames.h | 2 |
3 files changed, 27 insertions, 26 deletions
diff --git a/protocols/IcqOscarJ/src/changeinfo/editlist.cpp b/protocols/IcqOscarJ/src/changeinfo/editlist.cpp index 33c0a1e53a..a7092a7165 100644 --- a/protocols/IcqOscarJ/src/changeinfo/editlist.cpp +++ b/protocols/IcqOscarJ/src/changeinfo/editlist.cpp @@ -149,36 +149,37 @@ void ChangeInfoData::EndListEdit(int save) int i = SendMessage(hwndListEdit, LB_GETITEMDATA, iItem, 0);
if (iItem != -1 && i != -1) {
FieldNamesItem *list = (FieldNamesItem*)si.pList;
- if (list == timezonesField)
+ if (list == timezonesField) {
tmi.storeListResults(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB);
- else {
- FieldNamesItem &pItem = list[i];
-
- if (si.dbType == DBVT_ASCIIZ) {
- char *szNewValue = pItem.text;
- if (pItem.code || (si.displayType & LIF_ZEROISVALID)) {
- sid.changed = strcmpnull(szNewValue, (char*)sid.value);
- SAFE_FREE((void**)&sid.value);
- sid.value = (LPARAM)null_strdup(szNewValue);
- }
- else {
- sid.changed = (char*)sid.value != NULL;
- SAFE_FREE((void**)&sid.value);
- }
+ list[i = 0].code = ppro->getDword("Timezone", 0);
+ }
+
+ FieldNamesItem &pItem = list[i];
+
+ if (si.dbType == DBVT_ASCIIZ) {
+ char *szNewValue = pItem.text;
+ if (pItem.code || (si.displayType & LIF_ZEROISVALID)) {
+ sid.changed = strcmpnull(szNewValue, (char*)sid.value);
+ SAFE_FREE((void**)&sid.value);
+ sid.value = (LPARAM)null_strdup(szNewValue);
}
else {
- sid.changed = pItem.code != sid.value;
- sid.value = pItem.code;
+ sid.changed = (char*)sid.value != NULL;
+ SAFE_FREE((void**)&sid.value);
}
+ }
+ else {
+ sid.changed = pItem.code != sid.value;
+ sid.value = pItem.code;
+ }
- if (sid.changed) {
- char buf[MAX_PATH];
- TCHAR tbuf[MAX_PATH];
- if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, SIZEOF(buf)), tbuf, SIZEOF(buf)))
- ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
+ if (sid.changed) {
+ char buf[MAX_PATH];
+ TCHAR tbuf[MAX_PATH];
+ if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, SIZEOF(buf)), tbuf, SIZEOF(buf)))
+ ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
- EnableDlgItem(GetParent(hwndList), IDC_SAVE, TRUE);
- }
+ EnableDlgItem(GetParent(hwndList), IDC_SAVE, TRUE);
}
}
}
diff --git a/protocols/IcqOscarJ/src/icq_fieldnames.cpp b/protocols/IcqOscarJ/src/icq_fieldnames.cpp index a5aed0f8f9..136b838af0 100644 --- a/protocols/IcqOscarJ/src/icq_fieldnames.cpp +++ b/protocols/IcqOscarJ/src/icq_fieldnames.cpp @@ -30,7 +30,7 @@ #include "icqoscar.h"
-const FieldNamesItem timezonesField[] =
+FieldNamesItem timezonesField[] =
{
{ -100, NULL }
};
diff --git a/protocols/IcqOscarJ/src/icq_fieldnames.h b/protocols/IcqOscarJ/src/icq_fieldnames.h index de11bbe961..31f29c292e 100644 --- a/protocols/IcqOscarJ/src/icq_fieldnames.h +++ b/protocols/IcqOscarJ/src/icq_fieldnames.h @@ -33,7 +33,7 @@ struct FieldNamesItem char *text;
};
-extern const FieldNamesItem timezonesField[];
+extern FieldNamesItem timezonesField[];
extern const FieldNamesItem countryField[];
extern const FieldNamesItem interestsField[];
extern const FieldNamesItem languageField[];
|