Package: sysinfo / 0.7-8

04-fix_usb_pci_limit.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_fix_usb_pci_limit.dpatch by Koen Beek <koen.beek@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Remove the limit of the number of the usb and pci controllers that can be shown by sysinfo

@DPATCH@
Index: sysinfo-0.7/Sysinfo/HardwareInfo.cs
===================================================================
--- sysinfo-0.7.orig/Sysinfo/HardwareInfo.cs	2008-12-29 16:49:35.000000000 +0000
+++ sysinfo-0.7/Sysinfo/HardwareInfo.cs	2008-12-29 16:49:38.000000000 +0000
@@ -4,14 +4,15 @@
 using System;
 using System.IO;
 using System.Diagnostics;
+using System.Collections;
 
 namespace Sysinfo {
 	
 	public class HardwareInfo {
 		
 		public String [] host_bridge = {null, null};
-		public String [] pci_bridge = {null, null, null, null, null};
-		public String [] usb_controller = {null, null, null, null, null};
+		public ArrayList pci_bridge = new ArrayList();
+		public ArrayList usb_controller = new ArrayList();
 		public String [] isa_bridge = {null, null};
 		public String [] ide_interface = {null, null};
 		
@@ -85,16 +86,16 @@
 					}
 					
 					//pci bridge
-					if ( temp.Remove(0, temp.IndexOf(" ")  + 1).StartsWith("PCI bridge") ) {
+					if (temp.Remove(0, temp.IndexOf(" ")  + 1).StartsWith("PCI bridge")) {
 						
-						pci_bridge [pci_bridgeI] = temp.Remove(0, temp.IndexOf(" ")  + 13);
+						pci_bridge.Add(temp.Remove(0, temp.IndexOf(" ")  + 13));
 						pci_bridgeI++;
 					}
 					
 					//usb controller
-					if ( temp.Remove(0, temp.IndexOf(" ")  + 1).StartsWith("USB Controller") ) {
+					if (temp.Remove(0, temp.IndexOf(" ")  + 1).StartsWith("USB Controller")) {
 						
-						usb_controller [usb_controllerI] = temp.Remove(0, temp.IndexOf(" ")  + 17);
+						usb_controller.Add(temp.Remove(0, temp.IndexOf(" ")  + 17));
 						usb_controllerI++;
 					}
 					
Index: sysinfo-0.7/Sysinfo/Main.cs
===================================================================
--- sysinfo-0.7.orig/Sysinfo/Main.cs	2008-12-29 16:49:36.000000000 +0000
+++ sysinfo-0.7/Sysinfo/Main.cs	2008-12-29 16:49:38.000000000 +0000
@@ -1,4 +1,3 @@
-// project created on 10/18/2005 at 2:06 PM - continued 01/27/2006
 //
 // Main.cs: Main source file of Sysinfo.
 //
@@ -766,25 +765,21 @@
 			    			motherboard_treestore.AppendValues (motherboard_iter, "Subsystem: " + hardware_info.host_bridge[1]);
 			    	}
 			    	//pci brige info - populate treestore
-			    	if ( hardware_info.pci_bridge[0] != null ) {
+			    	if ( hardware_info.pci_bridge.Count > 0 ) {
 			    		
 			    		motherboard_iter = motherboard_treestore.AppendValues ("PCI bridge(s)");
 			    		
-			    		for ( int i = 0; i < 5; i++) {
-			    			
-			    			if ( hardware_info.pci_bridge[i] != null )
-			    				motherboard_treestore.AppendValues (motherboard_iter, hardware_info.pci_bridge[i]);
+			    		foreach (object pci_brdg in hardware_info.pci_bridge) {
+			    				motherboard_treestore.AppendValues (motherboard_iter, pci_brdg);
 						}
 			    	}
 			    	//usb controller info - populate treestore
-			    	if ( hardware_info.usb_controller[0] != null ) {
+			    	if ( hardware_info.usb_controller.Count > 0 ) {
 			    		
 			    		motherboard_iter = motherboard_treestore.AppendValues ("USB controller(s)");
 			    		
-			    		for ( int i = 0; i < 5; i++) {
-			    			
-			    			if ( hardware_info.usb_controller[i] != null )
-			    				motherboard_treestore.AppendValues (motherboard_iter, hardware_info.usb_controller[i]);
+			    		foreach(object usb_ctrlr in hardware_info.usb_controller) {
+			    				motherboard_treestore.AppendValues (motherboard_iter, usb_ctrlr);
 						}
 			    	}
 			    	//isa brige info - populate treestore
Index: sysinfo-0.7/Sysinfo/SaveToFile.cs
===================================================================
--- sysinfo-0.7.orig/Sysinfo/SaveToFile.cs	2008-12-29 16:49:36.000000000 +0000
+++ sysinfo-0.7/Sysinfo/SaveToFile.cs	2008-12-29 16:49:38.000000000 +0000
@@ -138,20 +138,17 @@
 			    	if ( hardware_info.host_bridge[1] != null )
 			    		textwrite.WriteLine("\t\tSubsystem: " + hardware_info.host_bridge[1]);
 		    	}
-		    	if ( hardware_info.pci_bridge[0] != null ) {
+		    	if ( hardware_info.pci_bridge.Count > 0 ) {
 		    		
 		    		textwrite.WriteLine("\tPCI bridge(s)");
-			    	for ( int i = 0; i < 5; i++) {		
-			    		if ( hardware_info.pci_bridge[i] != null )
-			    			textwrite.WriteLine("\t\t" + hardware_info.pci_bridge[i]);
+		    		foreach (object pci_brdg in hardware_info.pci_bridge) {
+			    			textwrite.WriteLine("\t\t" + pci_brdg);
 					}
 		    	}
-		    	if ( hardware_info.usb_controller[0] != null ) {
-		    		
+		    	if ( hardware_info.usb_controller.Count > 0 ) {
 		    		textwrite.WriteLine("\tUSB controller(s)");
-			    	for ( int i = 0; i < 5; i++) {		
-			    		if ( hardware_info.usb_controller[i] != null )
-			    			textwrite.WriteLine("\t\t" + hardware_info.usb_controller[i]);
+		    		foreach (object usb_ctrlr in hardware_info.usb_controller) {
+			    			textwrite.WriteLine("\t\t" + usb_ctrlr);
 					}
 		    	}
 		    	if ( hardware_info.isa_bridge[0] != null ) {