diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-09 22:02:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-09 22:02:18 +0000 |
commit | d5d50b471277d5d69f59a8f29bf87201149ce191 (patch) | |
tree | 92d10ad5b0a1116ba08eca98cf025cb07578784e /protocols/IcqOscarJ/src/changeinfo | |
parent | 9dd56da9d9ccbce2f1e1539acb5cfcad7650916a (diff) |
applied protocol helpers
git-svn-id: http://svn.miranda-ng.org/main/trunk@5305 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/changeinfo')
-rw-r--r-- | protocols/IcqOscarJ/src/changeinfo/db.cpp | 27 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/changeinfo/upload.cpp | 2 |
2 files changed, 12 insertions, 17 deletions
diff --git a/protocols/IcqOscarJ/src/changeinfo/db.cpp b/protocols/IcqOscarJ/src/changeinfo/db.cpp index ba231acebe..b5d4e81348 100644 --- a/protocols/IcqOscarJ/src/changeinfo/db.cpp +++ b/protocols/IcqOscarJ/src/changeinfo/db.cpp @@ -27,7 +27,6 @@ // -----------------------------------------------------------------------------
#include "icqoscar.h"
-
void ChangeInfoData::LoadSettingsFromDb(int keepChanged)
{
for (int i=0; i < settingCount; i++)
@@ -86,7 +85,6 @@ void ChangeInfoData::LoadSettingsFromDb(int keepChanged) }
}
-
void ChangeInfoData::FreeStoredDbSettings(void)
{
for (int i=0; i < settingCount; i++ )
@@ -94,7 +92,6 @@ void ChangeInfoData::FreeStoredDbSettings(void) SAFE_FREE((void**)&settingData[i].value);
}
-
int ChangeInfoData::ChangesMade(void)
{
for (int i=0; i < settingCount; i++ )
@@ -103,7 +100,6 @@ int ChangeInfoData::ChangesMade(void) return 0;
}
-
void ChangeInfoData::ClearChangeFlags(void)
{
for (int i=0; i < settingCount; i++)
@@ -163,17 +159,16 @@ static INT_PTR CALLBACK PwConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, return FALSE;
}
-
int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg)
{
int ret = 1;
for (int i = 0; i < settingCount; i++)
- {
+ {
if (!settingData[i].changed) continue;
if (!(setting[i].displayType & LIF_ZEROISVALID) && settingData[i].value==0)
- {
- ppro->deleteSetting(NULL, setting[i].szDbSetting);
+ {
+ db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting);
continue;
}
switch(setting[i].dbType) {
@@ -198,25 +193,25 @@ int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg) }
else {
if (*(char*)settingData[i].value)
- ppro->setSettingStringUtf(NULL, setting[i].szDbSetting, (char*)settingData[i].value);
+ db_set_utf(NULL, ppro->m_szModuleName, setting[i].szDbSetting, (char*)settingData[i].value);
else
- ppro->deleteSetting(NULL, setting[i].szDbSetting);
+ db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting);
}
break;
- case DBVT_UTF8:
+ case DBVT_UTF8:
if (*(char*)settingData[i].value)
- ppro->setSettingStringUtf(NULL, setting[i].szDbSetting, (char*)settingData[i].value);
+ db_set_utf(NULL, ppro->m_szModuleName, setting[i].szDbSetting, (char*)settingData[i].value);
else
- ppro->deleteSetting(NULL, setting[i].szDbSetting);
- break;
+ db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting);
+ break;
case DBVT_WORD:
- ppro->setSettingWord(NULL, setting[i].szDbSetting, (WORD)settingData[i].value);
+ ppro->setWord(setting[i].szDbSetting, (WORD)settingData[i].value);
break;
case DBVT_BYTE:
- ppro->setSettingByte(NULL, setting[i].szDbSetting, (BYTE)settingData[i].value);
+ ppro->setByte(setting[i].szDbSetting, (BYTE)settingData[i].value);
break;
}
}
diff --git a/protocols/IcqOscarJ/src/changeinfo/upload.cpp b/protocols/IcqOscarJ/src/changeinfo/upload.cpp index 165d65fa22..13d017e7cb 100644 --- a/protocols/IcqOscarJ/src/changeinfo/upload.cpp +++ b/protocols/IcqOscarJ/src/changeinfo/upload.cpp @@ -87,7 +87,7 @@ int ChangeInfoData::UploadSettings(void) CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(ptmp), (LPARAM)ptmp);
- ppro->setSettingString(NULL, "Password", ptmp);
+ ppro->setString("Password", ptmp);
}
}
}
|