summaryrefslogtreecommitdiff
path: root/plugins/PasteIt/src/Options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/PasteIt/src/Options.cpp')
-rw-r--r--plugins/PasteIt/src/Options.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp
index 6fc6439e40..a5c4fb5359 100644
--- a/plugins/PasteIt/src/Options.cpp
+++ b/plugins/PasteIt/src/Options.cpp
@@ -708,7 +708,7 @@ unsigned int Options::GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int
void Options::SetDefWeb(int web)
{
defWeb = web;
- DBWriteContactSettingWString(0, MODULE, "defWeb", pasteToWebs[web]->GetName());
+ db_set_ws(0, MODULE, "defWeb", pasteToWebs[web]->GetName());
DefWebPageChanged();
}
@@ -785,11 +785,11 @@ int Options::InitOptions(WPARAM wParam, LPARAM lParam)
void Options::Save()
{
- DBWriteContactSettingWString(0, MODULE, "defWeb", pasteToWebs[defWeb]->GetName());
- DBWriteContactSettingDword(0, MODULE, "codepage", codepage);
- DBWriteContactSettingByte(0, MODULE, "autoUTF", autoUTF ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "confDlg", confDlg ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "autoSend", autoSend ? 1 : 0);
+ db_set_ws(0, MODULE, "defWeb", pasteToWebs[defWeb]->GetName());
+ db_set_dw(0, MODULE, "codepage", codepage);
+ db_set_b(0, MODULE, "autoUTF", autoUTF ? 1 : 0);
+ db_set_b(0, MODULE, "confDlg", confDlg ? 1 : 0);
+ db_set_b(0, MODULE, "autoSend", autoSend ? 1 : 0);
for(int i = 0 ; i < PasteToWeb::pages; ++i)
{
char buf[256];
@@ -809,33 +809,33 @@ void Options::Save()
forms += it->id + L'=' + it->name + L';';
}
- DBWriteContactSettingWString(0, MODULE, buf, forms.c_str());
+ db_set_ws(0, MODULE, buf, forms.c_str());
strcpy_s(buf + j, 256 - j, "defFormatId");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->defFormatId.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->defFormatId.c_str());
if(webOptions[i]->isSendFileName)
{
strcpy_s(buf + j, 256 - j, "sendFileName");
- DBWriteContactSettingByte(0, MODULE, buf, webOptions[i]->sendFileName ? 1 : 0);
+ db_set_b(0, MODULE, buf, webOptions[i]->sendFileName ? 1 : 0);
}
if(webOptions[i]->isPublicPaste)
{
strcpy_s(buf + j, 256 - j, "publicPaste");
- DBWriteContactSettingByte(0, MODULE, buf, webOptions[i]->publicPaste ? 1 : 0);
+ db_set_b(0, MODULE, buf, webOptions[i]->publicPaste ? 1 : 0);
}
if(webOptions[i]->isCombo1)
{
strcpy_s(buf + j, 256 - j, "combo1");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->combo1.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->combo1.c_str());
}
if(webOptions[i]->isPastebin)
{
strcpy_s(buf + j, 256 - j, "pastebinUserKey");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->pastebinUserKey.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->pastebinUserKey.c_str());
}
}
}
@@ -843,7 +843,7 @@ void Options::Save()
void Options::Load()
{
DBVARIANT defWebV;
- if(!DBGetContactSettingWString(0, MODULE, "defWeb", &defWebV))
+ if(!db_get_ws(0, MODULE, "defWeb", &defWebV))
{
for(int i = 0; i < PasteToWeb::pages; ++i)
{
@@ -853,12 +853,12 @@ void Options::Load()
break;
}
}
- DBFreeVariant(&defWebV);
+ db_free(&defWebV);
}
- codepage = DBGetContactSettingDword(0, MODULE, "codepage", CP_ACP);
- autoUTF = DBGetContactSettingByte(0, MODULE, "autoUTF", 1) ? true : false;
- confDlg = DBGetContactSettingByte(0, MODULE, "confDlg", 1) ? true : false;
- autoSend = DBGetContactSettingByte(0, MODULE, "autoSend", 0) ? true : false;
+ codepage = db_get_dw(0, MODULE, "codepage", CP_ACP);
+ autoUTF = db_get_b(0, MODULE, "autoUTF", 1) ? true : false;
+ confDlg = db_get_b(0, MODULE, "confDlg", 1) ? true : false;
+ autoSend = db_get_b(0, MODULE, "autoSend", 0) ? true : false;
for(int i = 0 ; i < PasteToWeb::pages; ++i)
{
char buf[256];
@@ -873,7 +873,7 @@ void Options::Load()
strcpy_s(buf + j, 256 - j, "formats");
DBVARIANT forms;
- if(!DBGetContactSettingWString(0, MODULE, buf, &forms))
+ if(!db_get_ws(0, MODULE, buf, &forms))
{
webOptions[i]->formats.clear();
int k = 0;
@@ -899,37 +899,37 @@ void Options::Load()
++k;
}
- DBFreeVariant(&forms);
+ db_free(&forms);
}
strcpy_s(buf + j, 256 - j, "defFormatId");
DBVARIANT defForm;
- if(!DBGetContactSettingWString(0, MODULE, buf, &defForm))
+ if(!db_get_ws(0, MODULE, buf, &defForm))
{
webOptions[i]->defFormatId = defForm.pwszVal;
- DBFreeVariant(&defForm);
+ db_free(&defForm);
}
if(webOptions[i]->isSendFileName)
{
strcpy_s(buf + j, 256 - j, "sendFileName");
- webOptions[i]->sendFileName = DBGetContactSettingByte(0, MODULE, buf, 1) ? true : false;
+ webOptions[i]->sendFileName = db_get_b(0, MODULE, buf, 1) ? true : false;
}
if(webOptions[i]->isPublicPaste)
{
strcpy_s(buf + j, 256 - j, "publicPaste");
- webOptions[i]->publicPaste = DBGetContactSettingByte(0, MODULE, buf, 0) ? true : false;
+ webOptions[i]->publicPaste = db_get_b(0, MODULE, buf, 0) ? true : false;
}
if(webOptions[i]->isCombo1)
{
strcpy_s(buf + j, 256 - j, "combo1");
DBVARIANT combo1;
- if(!DBGetContactSettingWString(0, MODULE, buf, &combo1))
+ if(!db_get_ws(0, MODULE, buf, &combo1))
{
webOptions[i]->combo1 = combo1.pwszVal;
- DBFreeVariant(&combo1);
+ db_free(&combo1);
}
}
@@ -937,10 +937,10 @@ void Options::Load()
{
strcpy_s(buf + j, 256 - j, "pastebinUserKey");
DBVARIANT pastebinUserKey;
- if(!DBGetContactSettingWString(0, MODULE, buf, &pastebinUserKey))
+ if(!db_get_ws(0, MODULE, buf, &pastebinUserKey))
{
webOptions[i]->pastebinUserKey = pastebinUserKey.pwszVal;
- DBFreeVariant(&pastebinUserKey);
+ db_free(&pastebinUserKey);
}
}
}