summaryrefslogtreecommitdiff
path: root/plugins/NotesAndReminders/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-30 12:16:44 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-30 12:16:44 +0000
commit25ec54ea27a7099f33573b260a620ed7273176fe (patch)
tree1810a0cb35d23deeed9ccdaf0ab276a4022f9a41 /plugins/NotesAndReminders/src
parenta546606709e6bb72e01eb38b2c8c8756608fd5d6 (diff)
- db_set_blob used everywhere for writing blobs
- DBCONTACTWRITESETTING left only in the event handlers git-svn-id: http://svn.miranda-ng.org/main/trunk@5191 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NotesAndReminders/src')
-rw-r--r--plugins/NotesAndReminders/src/miscutils.cpp15
-rw-r--r--plugins/NotesAndReminders/src/miscutils.h2
-rw-r--r--plugins/NotesAndReminders/src/notes.cpp2
-rw-r--r--plugins/NotesAndReminders/src/options.cpp2
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp2
5 files changed, 4 insertions, 19 deletions
diff --git a/plugins/NotesAndReminders/src/miscutils.cpp b/plugins/NotesAndReminders/src/miscutils.cpp
index 3031922af6..f29ef4c233 100644
--- a/plugins/NotesAndReminders/src/miscutils.cpp
+++ b/plugins/NotesAndReminders/src/miscutils.cpp
@@ -32,19 +32,6 @@ void FreeSettingBlob(WORD pSize,void *pbBlob)
db_free(&dbv);
}
-void WriteSettingBlob(HANDLE hContact,char *ModuleName,char *SettingName,WORD pSize,void *pbBlob)
-{
- DBCONTACTWRITESETTING cgs = {0};
- DBVARIANT dbv = {0};
- dbv.type = DBVT_BLOB;
- dbv.cpbVal = pSize;
- dbv.pbVal = (BYTE*)pbBlob;
- cgs.szModule = ModuleName;
- cgs.szSetting = SettingName;
- cgs.value = dbv;
- CallService(MS_DB_CONTACT_WRITESETTING,(DWORD)hContact,(DWORD)&cgs);
-}
-
void ReadSettingBlob(HANDLE hContact, char *ModuleName, char *SettingName, WORD *pSize, void **pbBlob)
{
DBVARIANT dbv = {0};
@@ -61,7 +48,7 @@ void ReadSettingBlob(HANDLE hContact, char *ModuleName, char *SettingName, WORD
void WriteSettingIntArray(HANDLE hContact,char *ModuleName,char *SettingName,const int *Value, int Size)
{
- WriteSettingBlob(hContact, ModuleName, SettingName, WORD(sizeof(int)*Size), (void*)Value);
+ db_set_blob(hContact, ModuleName, SettingName, (void*)Value, sizeof(int)*Size);
}
bool ReadSettingIntArray(HANDLE hContact,char *ModuleName,char *SettingName,int *Value, int Size)
diff --git a/plugins/NotesAndReminders/src/miscutils.h b/plugins/NotesAndReminders/src/miscutils.h
index 52652891d5..9b8106a7ff 100644
--- a/plugins/NotesAndReminders/src/miscutils.h
+++ b/plugins/NotesAndReminders/src/miscutils.h
@@ -1,7 +1,5 @@
void ReadSettingBlob(HANDLE hContact, char *ModuleName,
char *SettingName, WORD *pSize, void **pbBlob);
-void WriteSettingBlob(HANDLE hContact,char *ModuleName,
- char *SettingName,WORD pSize,void *pbBlob);
void FreeSettingBlob(WORD pSize,void * pbBlob);
BOOL ReadSettingBool(HANDLE hContact,char *ModuleName,
char *SettingName,BOOL Default);
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp
index d54b8ea03b..9eaca318a1 100644
--- a/plugins/NotesAndReminders/src/notes.cpp
+++ b/plugins/NotesAndReminders/src/notes.cpp
@@ -942,7 +942,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified)
sprintf(ValueName, "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB
- WriteSettingBlob(0, MODULENAME, ValueName, (WORD)(n+1), Value);
+ db_set_blob(0, MODULENAME, ValueName, Value, n+1);
SAFE_FREE((void**)&Value);
if (bDeleteTData)
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp
index aaa257163c..fefe500820 100644
--- a/plugins/NotesAndReminders/src/options.cpp
+++ b/plugins/NotesAndReminders/src/options.cpp
@@ -419,7 +419,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar
SendDlgItemMessage(hdlg,IDC_EDIT_EMAILSMS ,WM_GETTEXT,SzT+1,(LPARAM)g_RemindSMS);
}
P = g_RemindSMS;
- WriteSettingBlob(0,MODULENAME,"RemindEmail",SzT,P);
+ db_set_blob(0,MODULENAME,"RemindEmail",P,SzT);
SzT = (WORD)SendDlgItemMessage(hdlg,IDC_EDIT_ALTBROWSER,WM_GETTEXTLENGTH,0,0);
if (SzT != 0)
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index 25c2772251..f23bcbfdc4 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -450,7 +450,7 @@ void JustSaveReminders(void)
sprintf(ValueName, "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
- WriteSettingBlob(0, MODULENAME, ValueName, (WORD)(n+1), Value);
+ db_set_blob(0, MODULENAME, ValueName, Value, n+1);
SAFE_FREE((void**)&Value);
}