[ros-diffs] [mbosma] 25812: Lester Kortenhoeven (lester(at)kortenhoeven(dot)de): * CP_ACP changed into CP_UTF8 * removed unnecessary code in xml.c * fix memory leak * add more programs

mbosma at svn.reactos.org mbosma at svn.reactos.org
Fri Feb 16 12:07:28 CET 2007


Author: mbosma
Date: Fri Feb 16 14:07:28 2007
New Revision: 25812

URL: http://svn.reactos.org/svn/reactos?rev=25812&view=rev
Log:
Lester Kortenhoeven  (lester(at)kortenhoeven(dot)de):
* CP_ACP changed into CP_UTF8
* removed unnecessary code in xml.c
* fix memory leak
* add more programs

Modified:
    trunk/reactos/base/applications/downloader/downloader.xml
    trunk/reactos/base/applications/downloader/main.c
    trunk/reactos/base/applications/downloader/xml.c

Modified: trunk/reactos/base/applications/downloader/downloader.xml
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/downloader/downloader.xml?rev=25812&r1=25811&r2=25812&view=diff
==============================================================================
--- trunk/reactos/base/applications/downloader/downloader.xml (original)
+++ trunk/reactos/base/applications/downloader/downloader.xml Fri Feb 16 14:07:28 2007
@@ -98,6 +98,18 @@
 			<description>Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.</description>
 			<location>http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-0.3.4.exe</location>
 		</application>
+		<application name="MinGW">
+			<regname>MinGW 5.1.3</regname>
+			<version>5.1.3</version>
+			<description>A Port of the GNU toolchain with GCC, GDB, GNU make, etc.</description>
+			<location>http://puzzle.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe</location>
+		</application>
+		<application name="FreeBASIC">
+			<regname>FreeBASIC 0.16b</regname>
+			<version>0.16b</version>
+			<description>Open Source Basic Compiler. The Basic syntax is compatible to QBASIC.</description>
+			<location>http://switch.dl.sourceforge.net/sourceforge/fbc/FreeBASIC-v0.16b-win32.exe</location>
+		</application>
 	</category>
 	<category name="Games &amp; Fun" icon="6">
 		<application name="ScummVM">
@@ -109,6 +121,12 @@
 		<application name="Tile World">
 			<description>Nice Clone of Chip's Challenge originally made for the Atari Lynx. Includes free CCLP2 Graphics Pack, so you dont need the copyrighted Original.</description>
 			<location>http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.0-win32-CCLP2.exe</location>
+		</application>
+		<application name="OpenTTD">
+			<regname>OpenTTD 0.5.0</regname>
+			<version>0.5.0-RC5</version>
+			<description>Open-source-clone of the "Transport Tycoon Deluxe" game-engine. You need a copy of Transport Tycoon.</description>
+			<location>http://ovh.dl.sourceforge.net/sourceforge/openttd/openttd-0.5.0-RC5-win32.exe</location>
 		</application>
 		<application name="LBreakout2">LBreakout2 2.4.1
 			<regname>LBreakout2 2.4.1</regname>
@@ -137,7 +155,7 @@
 			<location>http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z442.exe</location>
 		</application>
 		<application name="uTorrent">
-			<regname>&#181;Torrent</regname>	<!-- XML-Parser-Error:	Mu != &#181; -->
+			<regname>&#181;Torrent</regname>
 			<version>1.6</version>
 			<description>Small and fast Torrent Client.</description>
 			<location>http://download.utorrent.com/1.6/uTorrent-1.6-install.exe</location>
@@ -151,8 +169,14 @@
 	</category>
 	<category name="Others" icon="8">
 		<application name="Simple Direct Media Layer (SDL) Runtime">
+			<version>1.2.11</version>
 			<description>Needed for many Open Source Games to run. You need 7-Zip or a similar Utility to extract it.</description>
 			<location>http://ovh.dl.sourceforge.net/sourceforge/libsdl/SDL-1.2.11-win32.zip</location>
 		</application>
+		<application name="DOSBox">
+			<version>0.65</version>
+			<description>DOSBox is a DOS emulator.</description>
+			<location>http://puzzle.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.65-win32-installer.exe</location>
+		</application>
 	</category>
 </tree>

Modified: trunk/reactos/base/applications/downloader/main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/downloader/main.c?rev=25812&r1=25811&r2=25812&view=diff
==============================================================================
--- trunk/reactos/base/applications/downloader/main.c (original)
+++ trunk/reactos/base/applications/downloader/main.c Fri Feb 16 14:07:28 2007
@@ -19,6 +19,7 @@
 HBITMAP hLogo, hUnderline;
 WCHAR* DescriptionHeadline = L"";
 WCHAR* DescriptionText = L"";
+WCHAR ApplicationText[700];
 
 struct Category Root;
 struct Application* SelectedApplication;
@@ -27,6 +28,7 @@
 BOOL ProcessXML (const char* filename, struct Category* Root);
 VOID FreeTree (struct Category* Node);
 WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
+
 
 BOOL getUninstaller(WCHAR* RegName, WCHAR* Uninstaller) {
 
@@ -131,9 +133,6 @@
 		if(StrCmpW(CurrentApplication->RegName,L"")) {
 			if(getUninstaller(CurrentApplication->RegName, Uninstaller))
 				Insert.item.iImage = 9;
-		} else {
-			if(getUninstaller(CurrentApplication->Name, Uninstaller))
-				Insert.item.iImage = 9;
 		} 
 		SendMessage(hwnd, TVM_INSERTITEM, 0, (LPARAM)&Insert);
 		CurrentApplication = CurrentApplication->Next;
@@ -333,9 +332,6 @@
 						if(StrCmpW(SelectedApplication->RegName, L"")) {
 							if(getUninstaller(SelectedApplication->RegName, Uninstaller))
 								startUninstaller(Uninstaller);
-						} else {
-							if(getUninstaller(SelectedApplication->Name, Uninstaller))
-								startUninstaller(Uninstaller);
 						}
 					}
 				}
@@ -367,33 +363,29 @@
 					SelectedApplication = (struct Application*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
 					if(SelectedApplication)
 					{
-						DescriptionText = calloc(700,sizeof(WCHAR));
+						ApplicationText[0]=L'\0';
 						if(StrCmpW(SelectedApplication->Version, L"")) {
-							StrCatW(DescriptionText, Strings[IDS_VERSION]);
-							StrCatW(DescriptionText, SelectedApplication->Version);
-							StrCatW(DescriptionText, L"\n");
+							StrCatW(ApplicationText, Strings[IDS_VERSION]);
+							StrCatW(ApplicationText, SelectedApplication->Version);
+							StrCatW(ApplicationText, L"\n");
 						}
 						if(StrCmpW(SelectedApplication->Licence, L"")) {
-							StrCatW(DescriptionText, Strings[IDS_LICENCE]);
-							StrCatW(DescriptionText, SelectedApplication->Licence);
-							StrCatW(DescriptionText, L"\n");
+							StrCatW(ApplicationText, Strings[IDS_LICENCE]);
+							StrCatW(ApplicationText, SelectedApplication->Licence);
+							StrCatW(ApplicationText, L"\n");
 						}
 						if(StrCmpW(SelectedApplication->Maintainer, L"")) {
-							StrCatW(DescriptionText, Strings[IDS_MAINTAINER]);
-							StrCatW(DescriptionText, SelectedApplication->Maintainer);
-							StrCatW(DescriptionText, L"\n");
+							StrCatW(ApplicationText, Strings[IDS_MAINTAINER]);
+							StrCatW(ApplicationText, SelectedApplication->Maintainer);
+							StrCatW(ApplicationText, L"\n");
 						}
 						if(StrCmpW(SelectedApplication->Licence, L"") || StrCmpW(SelectedApplication->Version, L"") || StrCmpW(SelectedApplication->Maintainer, L""))
-							StrCatW(DescriptionText, L"\n");
-						StrCatW(DescriptionText, SelectedApplication->Description);
-						ShowMessage(SelectedApplication->Name, DescriptionText);
+							StrCatW(ApplicationText, L"\n");
+						StrCatW(ApplicationText, SelectedApplication->Description);
+						ShowMessage(SelectedApplication->Name, ApplicationText);
 						WCHAR Uninstaller[200];
 						if(StrCmpW(SelectedApplication->RegName, L"")) {
 							if(getUninstaller(SelectedApplication->RegName, Uninstaller)) {
-								bShowUninstaller = TRUE;
-							}
-						} else {
-							if(getUninstaller(SelectedApplication->Name, Uninstaller)) {
 								bShowUninstaller = TRUE;
 							}
 						}

Modified: trunk/reactos/base/applications/downloader/xml.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/downloader/xml.c?rev=25812&r1=25811&r2=25812&view=diff
==============================================================================
--- trunk/reactos/base/applications/downloader/xml.c (original)
+++ trunk/reactos/base/applications/downloader/xml.c Fri Feb 16 14:07:28 2007
@@ -9,6 +9,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <windows.h>
+#include <shlwapi.h>
 #include "structures.h"
 #include "resources.h"
 
@@ -54,7 +55,7 @@
 		{
 			if(!strcmp(arg[i], "name"))
 			{
-				MultiByteToWideChar(CP_ACP, 0, arg[i+1], -1, Current->Name, 0x100);
+				MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, Current->Name, 0x100);
 			}
 			if(!strcmp(arg[i], "icon"))
 			{
@@ -81,20 +82,11 @@
 			CurrentApplication = Current->Apps;
 		}
 
-		int currentlengt = lstrlenW(CurrentApplication->Maintainer);
-		MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->Maintainer[currentlengt], 0x100-currentlengt);
-		currentlengt = lstrlenW(CurrentApplication->RegName);
-		MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->RegName[currentlengt], 0x100-currentlengt);
-		currentlengt = lstrlenW(CurrentApplication->Version);
-		MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->Version[currentlengt], 0x100-currentlengt);
-		currentlengt = lstrlenW(CurrentApplication->Licence);
-		MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->Licence[currentlengt], 0x100-currentlengt);
-
 		for (i=0; arg[i]; i+=2) 
 		{
 			if(!strcmp(arg[i], "name"))
 			{
-				MultiByteToWideChar(CP_ACP, 0, arg[i+1], -1, CurrentApplication->Name, 0x100);
+				MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentApplication->Name, 0x100);
 			}
 		}
 	}
@@ -115,32 +107,32 @@
 	if(!strcmp(CurrentTag, "maintainer"))
 	{
 		int currentlengt = lstrlenW(CurrentApplication->Maintainer);
-		MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Maintainer[currentlengt], 0x100-currentlengt);
+		MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->Maintainer[currentlengt], 0x100-currentlengt);
 	}
 	else if(!strcmp(CurrentTag, "regname"))
 	{
 		int currentlengt = lstrlenW(CurrentApplication->RegName);
-		MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->RegName[currentlengt], 0x100-currentlengt);
+		MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->RegName[currentlengt], 0x100-currentlengt);
 	}
 	else if(!strcmp(CurrentTag, "description"))
 	{
 		int currentlengt = lstrlenW(CurrentApplication->Description);
-		MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Description[currentlengt], 0x400-currentlengt);
+		MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->Description[currentlengt], 0x400-currentlengt);
 	}
 	else if(!strcmp(CurrentTag, "location"))
 	{
 		int currentlengt = lstrlenW(CurrentApplication->Location);
-		MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Location[currentlengt], 0x100-currentlengt);
+		MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->Location[currentlengt], 0x100-currentlengt);
 	}
 	else if(!strcmp(CurrentTag, "version"))
 	{
 		int currentlengt = lstrlenW(CurrentApplication->Version);
-		MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Version[currentlengt], 0x400-currentlengt);
+		MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->Version[currentlengt], 0x400-currentlengt);
 	}
 	else if(!strcmp(CurrentTag, "licence"))
 	{
 		int currentlengt = lstrlenW(CurrentApplication->Licence);
-		MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Licence[currentlengt], 0x100-currentlengt);
+		MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->Licence[currentlengt], 0x100-currentlengt);
 	}
 }
 




More information about the Ros-diffs mailing list