summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 14:33:30 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 14:33:30 +0000
commit05c989e58aeffcfb59cebaca6797cb69dd25cb1e (patch)
tree460bde28df51ea7b01109b56818b5880ac47ba66 /plugins/UserInfoEx
parentac7bf920f219a7aed7eb163c8b3195e66c12e4da (diff)
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r--plugins/UserInfoEx/ctrl_contact.cpp16
-rw-r--r--plugins/UserInfoEx/ex_import/dlg_ExImOpenSaveFile.cpp14
-rw-r--r--plugins/UserInfoEx/init.cpp16
-rw-r--r--plugins/UserInfoEx/mir_db.h9
-rw-r--r--plugins/UserInfoEx/mir_string.h18
-rw-r--r--plugins/UserInfoEx/svc_avatar.cpp6
6 files changed, 20 insertions, 59 deletions
diff --git a/plugins/UserInfoEx/ctrl_contact.cpp b/plugins/UserInfoEx/ctrl_contact.cpp
index 5c54693736..8b13ad9256 100644
--- a/plugins/UserInfoEx/ctrl_contact.cpp
+++ b/plugins/UserInfoEx/ctrl_contact.cpp
@@ -319,22 +319,10 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
EDITBALLOONTIP btt;
btt.cbStruct = SIZEOF(btt);
-#ifdef _UNICODE
+
btt.pszTitle = TranslateW(L"Syntax Error");
btt.pszText = TranslateW(L"The phone number should start with a + and consist of\nnumbers, spaces, brackets and hyphens only.");
-#else
- WCHAR wszTitle[MAX_PATH];
- WCHAR wszText[MAX_PATH];
- LPSTR pszTitle = Translate("Syntax Error");
- LPSTR pszText = Translate("The phone number should start with a + and consist of\nnumbers, spaces, brackets and hyphens only.");
- INT cbTitle = mir_strlen(pszTitle) + 1;
- INT cbText = mir_strlen(pszText) + 1;
-
- MultiByteToWideChar(myGlobals.CodePage, 0, pszTitle, -1, wszTitle, cbTitle);
- MultiByteToWideChar(myGlobals.CodePage, 0, pszText, -1, wszText, cbText);
- btt.pszTitle = wszTitle;
- btt.pszText = wszText;
-#endif
+
SendDlgItemMessage(hDlg, EDIT_PHONE, EM_SHOWBALLOONTIP, NULL, (LPARAM)&btt);
SetDlgItemText(hDlg, EDIT_PHONE, cbi->pszVal);
SendDlgItemMessage(hDlg, EDIT_PHONE, EM_SETSEL, errorPos, errorPos);
diff --git a/plugins/UserInfoEx/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/ex_import/dlg_ExImOpenSaveFile.cpp
index ae11ed0a5f..6e1bb7ad54 100644
--- a/plugins/UserInfoEx/ex_import/dlg_ExImOpenSaveFile.cpp
+++ b/plugins/UserInfoEx/ex_import/dlg_ExImOpenSaveFile.cpp
@@ -30,14 +30,14 @@ Last change by : $Author: ing.u.horn $
#include "commonheaders.h"
-#ifdef _UNICODE
+
#include <dlgs.h>
-#endif
+
#include "m_db3xSA.h"
#include "dlg_ExImOpenSaveFile.h"
-#ifdef _UNICODE
+
#define HKEY_MIRANDA_PLACESBAR _T("Software\\Miranda IM\\PlacesBar")
#define HKEY_WINPOL_PLACESBAR _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\ComDlg32\\PlacesBar")
@@ -227,7 +227,7 @@ static UINT_PTR CALLBACK OpenSaveFileDialogHook(HWND hDlg, UINT uMsg, WPARAM wPa
return FALSE;
}
-#endif
+
/**
* name: GetInitialDir
@@ -305,7 +305,7 @@ static VOID InitOpenFileNameStruct(OPENFILENAMEA *pofn, HWND hWndParent, LPCSTR
GetInitialDir(pszInitialDir);
pofn->lpstrInitialDir = pszInitialDir;
-#ifdef _UNICODE
+
if (IsWinVer2000Plus()) {
pofn->lStructSize = sizeof (OPENFILENAME);
pofn->Flags |= OFN_ENABLEHOOK|OFN_EXPLORER;
@@ -314,9 +314,7 @@ static VOID InitOpenFileNameStruct(OPENFILENAMEA *pofn, HWND hWndParent, LPCSTR
else {
pofn->lStructSize = OPENFILENAME_SIZE_VERSION_400;
}
-#else
- pofn->lStructSize = sizeof (OPENFILENAME);
-#endif
+
}
diff --git a/plugins/UserInfoEx/init.cpp b/plugins/UserInfoEx/init.cpp
index 886f3edb6c..0054755e33 100644
--- a/plugins/UserInfoEx/init.cpp
+++ b/plugins/UserInfoEx/init.cpp
@@ -183,15 +183,13 @@ static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam)
update.cpbBetaVersionPrefix = (INT)strlen((LPSTR)update.pbBetaVersionPrefix);
#ifdef _WIN64
- #ifdef _UNICODE
+
update.szBetaUpdateURL = "http://userinfoex.googlecode.com/files/uinfoex64.zip";
- #endif
+
#else
- #ifdef _UNICODE
+
update.szBetaUpdateURL = "http://userinfoex.googlecode.com/files/uinfoexW.zip";
- #else
- update.szBetaUpdateURL = "http://userinfoex.googlecode.com/files/uinfoex.zip";
- #endif
+
#endif
// url for displaying changelog for beta versions
@@ -240,12 +238,10 @@ static BOOL CoreCheck()
strlwr(szVer);
_tcslwr(tszExePath);
-#ifdef _UNICODE
+
bOk *= (GetVersion() & 0x80000000) == 0;
bOk *= strstr(szVer, "unicode") != 0;
-#else
- bOk *= strstr(szVer, "unicode") == 0;
-#endif
+
bOk *= _tcsstr(_tcsrchr(tszExePath, '\\'), _T("miranda")) != 0;
bOk *= !strstr(szVer, "coffee") && strncmp(szVer, "1.", 2) && !strstr(szVer, " 1.");
diff --git a/plugins/UserInfoEx/mir_db.h b/plugins/UserInfoEx/mir_db.h
index 708882a26c..e06a8788a6 100644
--- a/plugins/UserInfoEx/mir_db.h
+++ b/plugins/UserInfoEx/mir_db.h
@@ -170,17 +170,12 @@ namespace Setting {
static FORCEINLINE
BYTE WriteUString (LPCSTR pszSetting, LPSTR value) { return WriteUString(MODNAME, pszSetting, value); }
-#ifdef _UNICODE
+
#define GetTString GetWString
#define GetTStringEx GetWStringEx
#define GetTStringCtrl GetWStringCtrl
#define WriteTString WriteWString
-#else
- #define GetTString GetAString
- #define GetTStringEx GetAStringEx
- #define GetTStringCtrl GetAStringCtrl
- #define WriteTString WriteAString
-#endif
+
/**
* misc operations
diff --git a/plugins/UserInfoEx/mir_string.h b/plugins/UserInfoEx/mir_string.h
index 558e86e508..6e2dad0425 100644
--- a/plugins/UserInfoEx/mir_string.h
+++ b/plugins/UserInfoEx/mir_string.h
@@ -33,7 +33,7 @@ Last change by : $Author: ing.u.horn $
#define mir_wcsdup mir_wstrdup
-#ifdef _UNICODE
+
#define mir_tcslen mir_wcslen
#define mir_tcscpy mir_wcscpy
#define mir_tcsncpy mir_wcsncpy
@@ -47,21 +47,7 @@ Last change by : $Author: ing.u.horn $
#define mir_tcsrchr mir_wcsrchr
#define mir_tcsncat_c mir_wcsncat_c
#define mir_IsEmpty mir_IsEmptyW
-#else
- #define mir_tcslen mir_strlen
- #define mir_tcscpy mir_strcpy
- #define mir_tcsncpy mir_strncpy
- #define mir_tcsncat mir_strncat
- #define mir_tcsdup mir_strdup
- #define mir_tcscmp mir_strcmp
- #define mir_tcsncmp mir_strncmp
- #define mir_tcsicmp mir_stricmp
- #define mir_tcsnicmp mir_strnicmp
- #define mir_tcschr mir_strchr
- #define mir_tcsrchr mir_strrchr
- #define mir_tcsncat_c mir_strncat_c
- #define mir_IsEmpty mir_IsEmptyA
-#endif
+
#define mir_strlen(s) (((s)!=0)?strlen(s):0)
diff --git a/plugins/UserInfoEx/svc_avatar.cpp b/plugins/UserInfoEx/svc_avatar.cpp
index 45dd78e6c9..0010ec54b1 100644
--- a/plugins/UserInfoEx/svc_avatar.cpp
+++ b/plugins/UserInfoEx/svc_avatar.cpp
@@ -116,16 +116,14 @@ namespace NServices
if (!CallService(MS_DB_GETPROFILEPATH, (WPARAM)cchFileName, (LPARAM)szFileName))
{
size_t len = mir_strlen(szFileName);
- #ifdef _UNICODE
+
CHAR tmp[64];
if (WideCharToMultiByte(CP_ACP, 0, zodiac, 64, tmp, SIZEOF(tmp),0,0) > 0)
{
mir_snprintf(szFileName + len, cchFileName - len, "\\avatars\\%s.png", tmp);
}
- #else
- mir_snprintf(szFileName + len, cchFileName - len, "\\avatars\\%s.png", zodiac);
- #endif
+
return !PathFileExistsA(szFileName);
}
return 1;