summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-19 22:48:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-19 22:48:01 +0000
commit95aa036670a1ce2c461ffd9bd3a586d191ee4675 (patch)
treecd244db18622df3462166ed39593ca924c890f6b /protocols
parentf6e0db0590e2f8feeacc29d4e50007fbe358f9d5 (diff)
- various icolib fixes;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@1061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/theme.cpp3
-rw-r--r--protocols/Gadu-Gadu/icolib.cpp54
-rw-r--r--protocols/IRCG/options.cpp44
-rw-r--r--protocols/IcqOscarJ/iconlib.cpp1
-rw-r--r--protocols/JabberG/jabber_icolib.cpp19
-rw-r--r--protocols/MSN/msn_opts.cpp7
-rw-r--r--protocols/Yahoo/icolib.cpp4
7 files changed, 64 insertions, 68 deletions
diff --git a/protocols/AimOscar/theme.cpp b/protocols/AimOscar/theme.cpp
index e0bf133f61..9217c68d1c 100644
--- a/protocols/AimOscar/theme.cpp
+++ b/protocols/AimOscar/theme.cpp
@@ -83,8 +83,7 @@ void InitIcons(void)
sid.pszSection = szSectionName;
sid.flags = SIDF_PATH_TCHAR;
- for (int i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i = 0; i < SIZEOF(iconList); i++) {
mir_snprintf(szSettingName, sizeof(szSettingName), "AIM_%s", iconList[i].szName);
if (iconList[i].szSection)
diff --git a/protocols/Gadu-Gadu/icolib.cpp b/protocols/Gadu-Gadu/icolib.cpp
index 58d5c2fe2a..f99540ac76 100644
--- a/protocols/Gadu-Gadu/icolib.cpp
+++ b/protocols/Gadu-Gadu/icolib.cpp
@@ -22,48 +22,48 @@
struct tagiconList
{
- const char* szDescr;
- const char* szName;
- int defIconID;
+ char* szDescr;
+ char* szName;
+ int defIconID;
}
static const iconList[] =
{
- { LPGEN("Protocol icon"), "main", IDI_GG },
- { LPGEN("Import list from server"), "importserver", IDI_IMPORT_SERVER },
- { LPGEN("Import list from text file"), "importtext", IDI_IMPORT_TEXT },
- { LPGEN("Remove list from server"), "removeserver", IDI_REMOVE_SERVER },
- { LPGEN("Export list to server"), "exportserver", IDI_EXPORT_SERVER },
- { LPGEN("Export list to text file"), "exporttext", IDI_EXPORT_TEXT },
- { LPGEN("Account settings"), "settings", IDI_SETTINGS },
- { LPGEN("Contact list"), "list", IDI_LIST },
- { LPGEN("Block user"), "block", IDI_BLOCK },
- { LPGEN("Previous image"), "previous", IDI_PREV },
- { LPGEN("Next image"), "next", IDI_NEXT },
- { LPGEN("Send image"), "image", IDI_IMAGE },
- { LPGEN("Save image"), "save", IDI_SAVE },
- { LPGEN("Delete image"), "delete", IDI_DELETE },
- { LPGEN("Open new conference"), "conference", IDI_CONFERENCE },
- { LPGEN("Clear ignored conferences"), "clearignored", IDI_CLEAR_CONFERENCE },
- { LPGEN("Concurrent sessions"), "sessions", IDI_SESSIONS }
+ { LPGEN("Protocol icon"), "main", IDI_GG },
+ { LPGEN("Import list from server"), "importserver", IDI_IMPORT_SERVER },
+ { LPGEN("Import list from text file"), "importtext", IDI_IMPORT_TEXT },
+ { LPGEN("Remove list from server"), "removeserver", IDI_REMOVE_SERVER },
+ { LPGEN("Export list to server"), "exportserver", IDI_EXPORT_SERVER },
+ { LPGEN("Export list to text file"), "exporttext", IDI_EXPORT_TEXT },
+ { LPGEN("Account settings"), "settings", IDI_SETTINGS },
+ { LPGEN("Contact list"), "list", IDI_LIST },
+ { LPGEN("Block user"), "block", IDI_BLOCK },
+ { LPGEN("Previous image"), "previous", IDI_PREV },
+ { LPGEN("Next image"), "next", IDI_NEXT },
+ { LPGEN("Send image"), "image", IDI_IMAGE },
+ { LPGEN("Save image"), "save", IDI_SAVE },
+ { LPGEN("Delete image"), "delete", IDI_DELETE },
+ { LPGEN("Open new conference"), "conference", IDI_CONFERENCE },
+ { LPGEN("Clear ignored conferences"), "clearignored", IDI_CLEAR_CONFERENCE },
+ { LPGEN("Concurrent sessions"), "sessions", IDI_SESSIONS }
};
HANDLE hIconLibItem[SIZEOF(iconList)];
void gg_icolib_init()
{
- SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- char szSectionName[100];
- int i;
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInstance, szFile, MAX_PATH);
+ char szSectionName[100];
mir_snprintf(szSectionName, sizeof( szSectionName ), "%s/%s", LPGEN("Protocols"), LPGEN(GGDEF_PROTO));
- GetModuleFileNameA(hInstance, szFile, MAX_PATH);
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
- sid.pszDefaultFile = szFile;
+ sid.ptszDefaultFile = szFile;
sid.pszSection = szSectionName;
+ sid.flags = SIDF_PATH_TCHAR;
- for(i = 0; i < SIZEOF(iconList); i++) {
+ for (int i = 0; i < SIZEOF(iconList); i++) {
char szSettingName[100];
mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", GGDEF_PROTO, iconList[i].szName);
sid.pszName = szSettingName;
diff --git a/protocols/IRCG/options.cpp b/protocols/IRCG/options.cpp
index e3f8bd1746..ae727d5443 100644
--- a/protocols/IRCG/options.cpp
+++ b/protocols/IRCG/options.cpp
@@ -193,41 +193,41 @@ static void removeSpaces( TCHAR* p )
struct
{
- TCHAR* szDescr;
+ char* szDescr;
char* szName;
int iSize;
int defIconID;
}
static iconList[] =
{
- { LPGENT("Main"), "main", 0, IDI_MAIN },
- { LPGENT("Add"), "add", 0, IDI_ADD },
- { LPGENT("Apply"), "apply", 0, IDI_APPLY },
- { LPGENT("Rename"), "rename", 0, IDI_RENAME },
- { LPGENT("Edit"), "edit", 0, IDI_EDIT },
- { LPGENT("Cancel"), "delete", 0, IDI_DELETE },
- { LPGENT("Ignore"), "block", 0, IDI_BLOCK },
- { LPGENT("Channel list"), "list", 0, IDI_LIST },
- { LPGENT("Channel manager"), "manager", 0, IDI_MANAGER },
- { LPGENT("Quick connect"), "quick", 0, IDI_QUICK },
- { LPGENT("Server window"), "server", 0, IDI_SERVER },
- { LPGENT("Show channel"), "show", 0, IDI_SHOW },
- { LPGENT("Question"), "question", 0, IDI_IRCQUESTION},
- { LPGENT("WhoIs"), "whois", 0, IDI_WHOIS },
- { LPGENT("Incoming DCC Chat"), "dcc", 0, IDI_DCC },
- { LPGENT("Logo (48x48)"), "logo", 48, IDI_LOGO }
+ { LPGEN("Main"), "main", 0, IDI_MAIN },
+ { LPGEN("Add"), "add", 0, IDI_ADD },
+ { LPGEN("Apply"), "apply", 0, IDI_APPLY },
+ { LPGEN("Rename"), "rename", 0, IDI_RENAME },
+ { LPGEN("Edit"), "edit", 0, IDI_EDIT },
+ { LPGEN("Cancel"), "delete", 0, IDI_DELETE },
+ { LPGEN("Ignore"), "block", 0, IDI_BLOCK },
+ { LPGEN("Channel list"), "list", 0, IDI_LIST },
+ { LPGEN("Channel manager"), "manager", 0, IDI_MANAGER },
+ { LPGEN("Quick connect"), "quick", 0, IDI_QUICK },
+ { LPGEN("Server window"), "server", 0, IDI_SERVER },
+ { LPGEN("Show channel"), "show", 0, IDI_SHOW },
+ { LPGEN("Question"), "question", 0, IDI_IRCQUESTION},
+ { LPGEN("WhoIs"), "whois", 0, IDI_WHOIS },
+ { LPGEN("Incoming DCC Chat"), "dcc", 0, IDI_DCC },
+ { LPGEN("Logo (48x48)"), "logo", 48, IDI_LOGO }
};
void AddIcons(void)
{
- char szFile[MAX_PATH];
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInst, szFile, MAX_PATH);
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.ptszSection = _T("Protocols/IRC");
- sid.pszDefaultFile = szFile;
- sid.flags = SIDF_TCHAR;
+ sid.ptszDefaultFile = szFile;
+ sid.flags = SIDF_PATH_TCHAR;
hIconLibItems = new HANDLE[ SIZEOF(iconList) ];
// add them one by one
@@ -235,7 +235,7 @@ void AddIcons(void)
char szTemp[255];
mir_snprintf(szTemp, sizeof(szTemp), "IRC_%s", iconList[i].szName );
sid.pszName = szTemp;
- sid.ptszDescription = iconList[i].szDescr;
+ sid.pszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
sid.cx = sid.cy = iconList[i].iSize;
hIconLibItems[i] = Skin_AddIcon(&sid );
diff --git a/protocols/IcqOscarJ/iconlib.cpp b/protocols/IcqOscarJ/iconlib.cpp
index 3c6408c60d..7c93bae17a 100644
--- a/protocols/IcqOscarJ/iconlib.cpp
+++ b/protocols/IcqOscarJ/iconlib.cpp
@@ -30,7 +30,6 @@
#include "icqoscar.h"
#include "m_icolib.h"
-
IcqIconHandle IconLibDefine(const char *desc, const char *section, const char *module, const char *ident, const TCHAR *def_file, int def_idx)
{
SKINICONDESC sid = {0};
diff --git a/protocols/JabberG/jabber_icolib.cpp b/protocols/JabberG/jabber_icolib.cpp
index 029a4be6c9..04609604f4 100644
--- a/protocols/JabberG/jabber_icolib.cpp
+++ b/protocols/JabberG/jabber_icolib.cpp
@@ -283,9 +283,7 @@ void CJabberProto::IconsInit( void )
mir_sntprintf( tmp, SIZEOF(tmp), _T(TCHAR_STR_PARAM), iconList[i].szDescr );
mir_sntprintf( szDescription, SIZEOF(szDescription), tmp, m_tszUserName );
}
- else {
- mir_sntprintf( szDescription, SIZEOF(szDescription), _T(TCHAR_STR_PARAM), iconList[i].szDescr );
- }
+ else mir_sntprintf( szDescription, SIZEOF(szDescription), _T(TCHAR_STR_PARAM), iconList[i].szDescr );
mir_snprintf( szSettingName, SIZEOF(szSettingName), "%s_%s", m_szModuleName, iconList[i].szName );
@@ -412,10 +410,10 @@ static HICON LoadTransportIcon(char *filename,int i,char *IconName,TCHAR *SectNa
sid.cbSize = sizeof(sid);
sid.hDefaultIcon = (has_proto_icon)?NULL:(HICON)CallService(MS_SKIN_LOADPROTOICON,(WPARAM)NULL,(LPARAM)(-internalidx));
sid.ptszSection = SectName;
- sid.pszName=IconName;
- sid.ptszDescription=Description;
- sid.pszDefaultFile=szMyPath;
- sid.iDefaultIndex=i;
+ sid.pszName = IconName;
+ sid.ptszDescription = Description;
+ sid.pszDefaultFile = szMyPath;
+ sid.iDefaultIndex = i;
sid.flags = SIDF_TCHAR;
Skin_AddIcon(&sid);
}
@@ -661,12 +659,13 @@ static TIconListItem sharedIconList[] =
static void sttProcessIcons( int iAmount )
{
- char szFile[MAX_PATH];
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInst, szFile, MAX_PATH);
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
- sid.pszDefaultFile = szFile;
+ sid.ptszDefaultFile = szFile;
+ sid.flags = SIDF_PATH_TCHAR;
char szRootSection[100];
mir_snprintf( szRootSection, SIZEOF(szRootSection), "%s/%s", LPGEN("Protocols"), LPGEN("Jabber"));
diff --git a/protocols/MSN/msn_opts.cpp b/protocols/MSN/msn_opts.cpp
index b611b2559a..b2fd4a9f8c 100644
--- a/protocols/MSN/msn_opts.cpp
+++ b/protocols/MSN/msn_opts.cpp
@@ -55,10 +55,10 @@ HANDLE hIconLibItem[SIZEOF(iconList)];
void MsnInitIcons(void)
{
TCHAR szFile[MAX_PATH];
- char szSectionName[100];
+ GetModuleFileName(hInst, szFile, SIZEOF(szFile));
+ char szSectionName[100];
mir_snprintf(szSectionName, sizeof(szSectionName), "%s/%s", LPGEN("Protocols"), LPGEN("MSN"));
- GetModuleFileName(hInst, szFile, SIZEOF(szFile));
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
@@ -66,8 +66,7 @@ void MsnInitIcons(void)
sid.pszSection = szSectionName;
sid.flags = SIDF_PATH_TCHAR;
- for (unsigned i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i = 0; i < SIZEOF(iconList); i++) {
char szSettingName[100];
mir_snprintf(szSettingName, sizeof(szSettingName), "MSN_%s", iconList[i].szName);
sid.pszName = szSettingName;
diff --git a/protocols/Yahoo/icolib.cpp b/protocols/Yahoo/icolib.cpp
index 868624380e..edb364eece 100644
--- a/protocols/Yahoo/icolib.cpp
+++ b/protocols/Yahoo/icolib.cpp
@@ -38,10 +38,10 @@ HANDLE hIconLibItem[SIZEOF(iconList)];
void CYahooProto::IconsInit( void )
{
TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInstance, szFile, SIZEOF(szFile));
+
char szSectionName[100];
-
mir_snprintf(szSectionName, sizeof(szSectionName), "%s/%s", LPGEN("Protocols"), LPGEN("YAHOO"));
- GetModuleFileName(hInstance, szFile, SIZEOF(szFile));
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);