diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/AssocMgr | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AssocMgr')
-rw-r--r-- | plugins/AssocMgr/src/assoclist.cpp | 36 | ||||
-rw-r--r-- | plugins/AssocMgr/src/reg.cpp | 4 | ||||
-rw-r--r-- | plugins/AssocMgr/src/test.cpp | 2 |
3 files changed, 21 insertions, 21 deletions
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index cc2a58828a..4124b493f4 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -51,7 +51,7 @@ static BOOL IsAssocEnabled(const ASSOCDATA *assoc) {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
- return DBGetContactSettingByte(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED))!= 0;
+ return db_get_b(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED))!= 0;
}
static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
@@ -59,13 +59,13 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled) char szSetting[MAXMODULELABELLENGTH];
TCHAR szDLL[MAX_PATH], szBuf[MAX_PATH];
mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
- DBWriteContactSettingByte(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
+ db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
/* dll name for uninstall */
if(assoc->hInstance!= NULL && assoc->hInstance!= hInst && assoc->hInstance!= GetModuleHandle(NULL))
if( GetModuleFileName(assoc->hInstance, szBuf, SIZEOF(szBuf)))
if( PathToRelativeT(szBuf, szDLL)) {
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", assoc->pszClassName);
- DBWriteContactSettingTString(NULL, "AssocMgr", szSetting, szDLL);
+ db_set_ts(NULL, "AssocMgr", szSetting, szDLL);
}
}
@@ -73,10 +73,10 @@ static void DeleteAssocEnabledSetting(const ASSOCDATA *assoc) {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
- DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, "AssocMgr", szSetting);
/* dll name for uninstall */
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", assoc->pszClassName);
- DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, "AssocMgr", szSetting);
}
void CleanupAssocEnabledSettings(void)
@@ -95,13 +95,13 @@ void CleanupAssocEnabledSettings(void) for(i = 0;i<nSettingsCount;++i) {
pszSuffix = &ppszSettings[i][8];
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", pszSuffix);
- if (!DBGetContactSettingTString(NULL, "AssocMgr", szSetting, &dbv)) {
+ if (!db_get_ts(NULL, "AssocMgr", szSetting, &dbv)) {
if( PathToAbsoluteT(dbv.ptszVal, szDLL)) {
/* file still exists? */
hFile = CreateFile(szDLL, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if(hFile == INVALID_HANDLE_VALUE) {
- DBDeleteContactSetting(NULL, "AssocMgr", ppszSettings[i]);
- DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, "AssocMgr", ppszSettings[i]);
+ db_unset(NULL, "AssocMgr", szSetting);
} else CloseHandle(hFile);
}
mir_free(dbv.ptszVal);
@@ -119,8 +119,8 @@ static __inline void RememberMimeTypeAdded(const char *pszMimeType, const char * {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, sizeof(szSetting), "mime_%s", pszMimeType);
- if(fAdded) DBWriteContactSettingString(NULL, "AssocMgr", szSetting, pszFileExt);
- else DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ if(fAdded) db_set_s(NULL, "AssocMgr", szSetting, pszFileExt);
+ else db_unset(NULL, "AssocMgr", szSetting);
}
static __inline BOOL WasMimeTypeAdded(const char *pszMimeType)
@@ -129,8 +129,8 @@ static __inline BOOL WasMimeTypeAdded(const char *pszMimeType) DBVARIANT dbv;
BOOL fAdded = FALSE;
mir_snprintf(szSetting, sizeof(szSetting), "mime_%s", pszMimeType);
- if (!DBGetContactSetting(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
- else DBFreeVariant(&dbv);
+ if (!db_get(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
+ else db_free(&dbv);
return fAdded;
}
@@ -150,12 +150,12 @@ void CleanupMimeTypeAddedSettings(void) if (!lstrcmpA(pszSuffix, pAssocList[j].pszMimeType))
break; /* mime type in current list */
if(j == nAssocListCount) { /* mime type not in current list */
- if (!DBGetContactSetting(NULL, "AssocMgr", ppszSettings[i], &dbv)) {
+ if (!db_get(NULL, "AssocMgr", ppszSettings[i], &dbv)) {
if(dbv.type == DBVT_ASCIIZ)
RemoveRegMimeType(pszSuffix, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- DBDeleteContactSetting(NULL, "AssocMgr", ppszSettings[i]);
+ db_unset(NULL, "AssocMgr", ppszSettings[i]);
}
mir_free(ppszSettings[i]);
}
@@ -769,7 +769,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara ListView_SetItemState(hwndList, lvi.iItem, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE_USEHEADER); /* size to fit window */
/* only while running */
- CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)DBGetContactSettingByte(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT));
+ CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT));
/* autostart */
{ TCHAR *pszRunCmd;
pszRunCmd = MakeRunCommand(TRUE, TRUE);
@@ -915,7 +915,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara ASSOCDATA *assoc;
/* only while running */
- DBWriteContactSettingByte(NULL, "AssocMgr", "OnlyWhileRunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONLYWHILERUNNING)!= 0));
+ db_set_b(NULL, "AssocMgr", "OnlyWhileRunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONLYWHILERUNNING)!= 0));
/* save enabled assoc items */
hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST);
@@ -1063,7 +1063,7 @@ void UninitAssocList(void) DestroyServiceFunction(hServiceRemoveUrl);
/* Assoc List */
- fOnlyWhileRunning = DBGetContactSettingByte(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
+ fOnlyWhileRunning = db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
for(i = 0;i<nAssocListCount;++i) {
assoc = &pAssocList[i];
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 41e724025d..a34b02918a 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -509,7 +509,7 @@ static LONG RestoreRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPref mir_free(pData);
} else res=ERROR_INVALID_DATA;
if (res) break;
- DBDeleteContactSetting(NULL,"AssocMgr",ppszSettings[i]);
+ db_unset(NULL,"AssocMgr",ppszSettings[i]);
if (hSubKey!=hKey) RegCloseKey(hSubKey);
}
mir_free(ppszSettings[i]);
@@ -532,7 +532,7 @@ static void DeleteRegTreeBackup(const char *pszSubKey,const char *pszDbPrefix) if (pszPrefixWithSubKey!=NULL) {
if (EnumDbPrefixSettings("AssocMgr",pszPrefixWithSubKey,&ppszSettings,&nSettingsCount)) {
for(i=0;i<nSettingsCount;++i) {
- DBDeleteContactSetting(NULL,"AssocMgr",ppszSettings[i]);
+ db_unset(NULL,"AssocMgr",ppszSettings[i]);
mir_free(ppszSettings[i]);
}
mir_free(ppszSettings);
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index 2bf0149d52..db07567c82 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -143,7 +143,7 @@ static int ServiceParseAimLink(WPARAM wParam,LPARAM lParam) if(hContact==NULL) {
hContact=add_contact(sn); /* does not yet check if sn is current user */
if(hContact!=NULL)
- DBWriteContactSettingByte(hContact,MOD_KEY_CL,AIM_KEY_NL,1);
+ db_set_b(hContact,MOD_KEY_CL,AIM_KEY_NL,1);
}
if(hContact!=NULL)
CallService(MS_MSG_SENDMESSAGE,(WPARAM)hContact,(LPARAM)msg);
|