diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-26 16:50:14 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-26 16:50:14 +0000 |
commit | c992cb2fdc11f1cac4bc5cbce26e8e2bb3b57da0 (patch) | |
tree | 697bdbf38a8a1f6b828a8bfbd08a478e19a82c6b /src/modules/database | |
parent | f616294363c642d138f9dc0ef6eceae639e2434c (diff) |
- microkernel addded;
- version bumped to 0.92.2
git-svn-id: http://svn.miranda-ng.org/main/trunk@641 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database')
-rw-r--r-- | src/modules/database/database.cpp | 6 | ||||
-rw-r--r-- | src/modules/database/dbini.cpp | 27 | ||||
-rw-r--r-- | src/modules/database/dbutils.cpp | 2 | ||||
-rw-r--r-- | src/modules/database/profilemanager.cpp | 12 |
4 files changed, 30 insertions, 17 deletions
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index 407cc4b4b2..c8743b3b30 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -77,7 +77,7 @@ int getProfilePath(TCHAR * buf, size_t cch) _tcscpy(profiledir, _T("%miranda_path%\\Profiles"));
TCHAR* exprofiledir = Utils_ReplaceVarsT(profiledir);
- size_t len = pathToAbsoluteT(exprofiledir, buf, NULL);
+ size_t len = PathToAbsoluteT(exprofiledir, buf, NULL);
mir_free(exprofiledir);
if (buf[len-1] == '/' || buf[len-1] == '\\')
@@ -184,7 +184,7 @@ void getProfileCmdLine(TCHAR * szProfile, size_t cch, TCHAR * profiledir) p = _tcsrchr(profileName, '.'); if (p) *p = 0;
mir_sntprintf(newProfileDir, cch, _T("%s\\%s\\"), profiledir, profileName);
- pathToAbsoluteT(buf, szProfile, newProfileDir);
+ PathToAbsoluteT(buf, szProfile, newProfileDir);
if (_tcschr(buf, '\\'))
{
@@ -511,7 +511,7 @@ static int FindMirandaForProfile(TCHAR * szProfile) int LoadDatabaseModule(void)
{
TCHAR szProfile[MAX_PATH];
- pathToAbsoluteT(_T("."), szProfile, NULL);
+ PathToAbsoluteT(_T("."), szProfile, NULL);
_tchdir(szProfile);
szProfile[0] = 0;
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index e8836114c1..af15390857 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -193,7 +193,20 @@ int SettingsEnumProc(const char *szSetting, LPARAM lParam) return 0;
}
-void ConvertBackslashes(char *, UINT);
+static void ConvertBackslashes(char *str, UINT fileCp)
+{
+ char *pstr;
+ for (pstr = str; *pstr; pstr = CharNextExA(fileCp, pstr, 0)) {
+ if (*pstr == '\\') {
+ switch(pstr[1]) {
+ case 'n': *pstr = '\n'; break;
+ case 't': *pstr = '\t'; break;
+ case 'r': *pstr = '\r'; break;
+ default: *pstr = pstr[1]; break;
+ }
+ memmove(pstr+1, pstr+2, strlen(pstr+2) + 1);
+} } }
+
static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsafeSections, int secur, bool secFN)
{
FILE *fp = _tfopen(szIniPath, _T("rt"));
@@ -286,7 +299,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf warnInfo.szValue=szValue;
warnInfo.warnNoMore=0;
warnInfo.cancel=0;
- if (warnThisSection && IDNO == DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_WARNINICHANGE), NULL, WarnIniChangeDlgProc, (LPARAM)&warnInfo))
+ if (warnThisSection && IDNO == DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_WARNINICHANGE), NULL, WarnIniChangeDlgProc, (LPARAM)&warnInfo))
continue;
if (warnInfo.cancel)
break;
@@ -392,14 +405,14 @@ static void DoAutoExec(void) if (dbCreated && szOnCreateFilename[0]) {
str2 = Utils_ReplaceVarsT(szOnCreateFilename);
- pathToAbsoluteT(str2, szIniPath, NULL);
+ PathToAbsoluteT(str2, szIniPath, NULL);
mir_free(str2);
ProcessIniFile(szIniPath, szSafeSections, szUnsafeSections, 0, 1);
}
str2 = Utils_ReplaceVarsT(szFindPath);
- pathToAbsoluteT(str2, szFindPath, NULL);
+ PathToAbsoluteT(str2, szFindPath, NULL);
mir_free(str2);
WIN32_FIND_DATA fd;
@@ -419,7 +432,7 @@ static void DoAutoExec(void) mir_sntprintf(szIniPath, SIZEOF(szIniPath), _T("%s%s"), szFindPath, fd.cFileName);
if ( !lstrcmpi(szUse, _T("prompt")) && !secFN) {
- int result=DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath);
+ int result=DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath);
if (result == IDC_NOTOALL) break;
if (result == IDCANCEL) continue;
}
@@ -451,7 +464,7 @@ static void DoAutoExec(void) MoveFile(szIniPath, szNewPath);
}
else if ( !lstrcmpi(szOnCompletion, _T("ask")))
- DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_INIIMPORTDONE), NULL, IniImportDoneDlgProc, (LPARAM)szIniPath);
+ DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INIIMPORTDONE), NULL, IniImportDoneDlgProc, (LPARAM)szIniPath);
}
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -473,7 +486,7 @@ int InitIni(void) bModuleInitialized = true;
DoAutoExec();
- pathToAbsoluteT(_T("."), szMirandaDir, NULL);
+ PathToAbsoluteT(_T("."), szMirandaDir, NULL);
hIniChangeNotification=FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
CreateServiceFunction("DB/Ini/CheckImportNow", CheckIniImportNow);
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index dede30691b..54b352bb4d 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -207,7 +207,7 @@ static INT_PTR DbEventGetStringT(WPARAM wParam, LPARAM lParam) char* string = (char*)lParam;
if (dbei->flags & DBEF_UTF)
- return (INT_PTR)Utf8DecodeUcs2(string);
+ return (INT_PTR)Utf8DecodeW(string);
return (INT_PTR)mir_a2t(string);
}
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index 1ddccf0c95..898fc323d6 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -312,11 +312,11 @@ BOOL EnumProfilesForList(TCHAR * fullpath, TCHAR * profile, LPARAM lParam) } }
item2.iSubItem = 3;
- item2.pszText = rtrim(_tctime(&statbuf.st_ctime));
+ item2.pszText = trtrim(_tctime(&statbuf.st_ctime));
SendMessage(hwndList, LVM_SETITEMTEXT, iItem, (LPARAM)&item2);
item2.iSubItem = 4;
- item2.pszText = rtrim(_tctime(&statbuf.st_mtime));
+ item2.pszText = trtrim(_tctime(&statbuf.st_mtime));
SendMessage(hwndList, LVM_SETITEMTEXT, iItem, (LPARAM)&item2);
}
return TRUE;
@@ -537,8 +537,8 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, struct DlgProfData * prof = (struct DlgProfData *)lParam;
PROPSHEETHEADER *psh = prof->psh;
TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(hMirandaInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0));
dat = (struct DetailsData*)mir_alloc(sizeof(struct DetailsData));
dat->prof = prof;
prof->hwndOK = GetDlgItem(hwndDlg, IDOK);
@@ -805,7 +805,7 @@ int getProfileManager(PROFILEMANAGERDATA * pd) odp.pszTitle = LPGEN("My Profiles");
odp.pfnDlgProc = DlgProfileSelect;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PROFILE_SELECTION);
- odp.hInstance = hMirandaInst;
+ odp.hInstance = hInst;
AddProfileManagerPage(&opi, &odp);
odp.pszTitle = LPGEN("New Profile");
@@ -825,7 +825,7 @@ int getProfileManager(PROFILEMANAGERDATA * pd) DlgProfData prof;
prof.pd = pd;
prof.psh = &psh;
- int rc = DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_PROFILEMANAGER), NULL, DlgProfileManager, (LPARAM)&prof);
+ int rc = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_PROFILEMANAGER), NULL, DlgProfileManager, (LPARAM)&prof);
if (rc != -1)
for (int i=0; i < opi.pageCount; i++) {
|