diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-04-06 00:55:48 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-04-06 00:55:48 +0000 |
commit | 03e3e4ebe0fee7bbe8014014b77a21d22cc090a8 (patch) | |
tree | 59eb86b2a5252bd336398594b21ff8a6c4252c00 /updater/services.cpp | |
parent | 92f7a736e44f3d5199e48459daa78b89a0c9f46d (diff) |
Fixed translation issue
Removed unneeded/duplicated code (thus shaved few more kb from the dll)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@496 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'updater/services.cpp')
-rw-r--r-- | updater/services.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/updater/services.cpp b/updater/services.cpp index 4b232b1..b5c8a88 100644 --- a/updater/services.cpp +++ b/updater/services.cpp @@ -63,11 +63,11 @@ bool DownloadUpdates(UpdateList &todo, FilenameMap *map, bool dlls_only) { }
if(download) {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Downloading plugin: %s"), TranslateTS(temp_str = GetTString(todo[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Downloading plugin: %s"), (temp_str = GetTString(todo[index].update.szComponentName)));
+ mir_free(temp_str);
} else {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), TranslateTS(temp_str = GetTString(todo[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), (temp_str = GetTString(todo[index].update.szComponentName)));
+ mir_free(temp_str);
}
if(!use_popup) {
@@ -227,11 +227,11 @@ void CheckForUpdatesWorker(void *param) { for(index = 0; index < count; index++) {
if(update_list2[index].update_options.enabled) {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Checking plugin: %s"), TranslateTS(temp_str = GetTString(update_list2[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Checking plugin: %s"), (temp_str = GetTString(update_list2[index].update.szComponentName)));
+ mir_free(temp_str);
} else {
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), TranslateTS(temp_str = GetTString(update_list2[index].update.szComponentName)));
- free(temp_str);
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Skipping plugin: %s"), (temp_str = GetTString(update_list2[index].update.szComponentName)));
+ mir_free(temp_str);
}
if(!use_popup) {
@@ -414,13 +414,13 @@ void SaveUpdateOptions(char *szComponentName, UpdateOptions *update_options) { INT_PTR SetUpdateOptions(WPARAM wParam, LPARAM lParam) {
char *szComponentName = (char *)wParam;
UpdateOptions *uo = (UpdateOptions *)lParam;
- TCHAR *temp1 = 0, *temp2 = 0;
+ TCHAR *temp1 = 0;
bool found = false;
EnterCriticalSection(&list_cs);
for (int i=0; i<update_list.getCount(); ++i) {
if(strcmp(update_list[i].update.szComponentName, szComponentName) == 0
- || _tcscmp(TranslateTS(temp1 = GetTString(update_list[i].update.szComponentName)), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
+ || _tcscmp(temp1 = GetTString(update_list[i].update.szComponentName), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
{
found = true;
update_list[i].update_options = *uo;
@@ -432,8 +432,7 @@ INT_PTR SetUpdateOptions(WPARAM wParam, LPARAM lParam) { }
}
LeaveCriticalSection(&list_cs);
- if(temp1) free(temp1);
- if(temp2) free(temp2);
+ mir_free(temp1);
return found ? 0 : 1;
}
@@ -441,13 +440,13 @@ INT_PTR SetUpdateOptions(WPARAM wParam, LPARAM lParam) { INT_PTR GetUpdateOptions(WPARAM wParam, LPARAM lParam) {
char *szComponentName = (char *)wParam;
UpdateOptions *uo = (UpdateOptions *)lParam;
- TCHAR *temp1 = 0, *temp2 = 0;
+ TCHAR *temp1 = 0;
bool found = false;
EnterCriticalSection(&list_cs);
for (int i=0; i<update_list.getCount(); ++i) {
if(strcmp(update_list[i].update.szComponentName, szComponentName) == 0
- || _tcscmp(TranslateTS(temp1 = GetTString(update_list[i].update.szComponentName)), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
+ || _tcscmp((temp1 = GetTString(update_list[i].update.szComponentName)), (TCHAR *)szComponentName) == 0) // when set via options, szComponentName is translated and potentially already converted to unicode
{
found = true;
*uo = update_list[i].update_options;
@@ -455,8 +454,7 @@ INT_PTR GetUpdateOptions(WPARAM wParam, LPARAM lParam) { }
}
LeaveCriticalSection(&list_cs);
- if(temp1) free(temp1);
- if(temp2) free(temp2);
+ mir_free(temp1);
return found ? 0 : 1;
}
@@ -750,7 +748,7 @@ int ServicesModulesLoaded(WPARAM wParam, LPARAM lParam) { menu.flags = CMIM_ALL;
menu.hIcon = LoadIconEx(I_CHKUPD);
- menu.pszName = Translate("Check for updates");
+ menu.pszName = "Check for updates";
menu.pszService= MS_UPDATE_CHECKFORUPDATES;
menu.position = 500010000;
#ifdef MS_CLIST_ADDGROUPMENUITEM
|