summaryrefslogtreecommitdiff
path: root/x11/kdebase3/patches/patch-gd
blob: 6270d800e730ad24e31b0159b0802b7a7f558c27 (plain)
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
$NetBSD: patch-gd,v 1.4 2006/08/02 13:45:51 markd Exp $

--- kcontrol/usbview/usbdevices.cpp.orig	2006-07-22 20:15:22.000000000 +1200
+++ kcontrol/usbview/usbdevices.cpp
@@ -27,7 +27,7 @@
 
 #include <math.h>
 
-#ifdef Q_OS_FREEBSD
+#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
 #include <sys/ioctl.h>
 #include <sys/param.h>
 #endif
@@ -197,7 +197,7 @@ QString USBDevice::dump()
   if (!prname.isEmpty())
     pr += "<td>(" + prname +")</td>";
   r += i18n("<tr><td><i>Protocol</i></td>%1</tr>").arg(pr);
-#ifndef Q_OS_FREEBSD
+#if !(defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD))
   r += i18n("<tr><td><i>USB Version</i></td><td>%1.%2</td></tr>")
     .arg(_verMajor,0,16)
     .arg(QString::number(_verMinor,16).prepend('0').right(2));
@@ -221,7 +221,7 @@ QString USBDevice::dump()
 
   r += i18n("<tr><td><i>Speed</i></td><td>%1 Mbit/s</td></tr>").arg(_speed);
   r += i18n("<tr><td><i>Channels</i></td><td>%1</td></tr>").arg(_channels);
-#ifdef Q_OS_FREEBSD
+#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
 	if ( _power )
 		r += i18n("<tr><td><i>Power Consumption</i></td><td>%1 mA</td></tr>").arg(_power);
 	else
@@ -249,7 +249,7 @@ QString USBDevice::dump()
 }
 
 
-#ifndef Q_OS_FREEBSD
+#if !(defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD))
 bool USBDevice::parse(QString fname)
 {
   _devices.clear();
@@ -345,7 +345,7 @@ void USBDevice::collectData( int fd, int
 	_channels     = di.udi_nports;
 	
 	// determine the speed
-#if __FreeBSD_version > 490102
+#if defined(__DragonFly__) || (defined(Q_OS_FREEBSD) && __FreeBSD_version > 490102) || defined(Q_OS_NETBSD)
 	switch (di.udi_speed) {
 		case USB_SPEED_LOW:  _speed = 1.5;   break;
 		case USB_SPEED_FULL: _speed = 12.0;  break;
@@ -415,8 +415,10 @@ bool USBDevice::parse(QString fname)
 				}
 			}
 			controller.close();
+#ifndef Q_OS_NETBSD
 		} else {
 			error = true;
+#endif
 		}
 		controller.setName( QString::fromLocal8Bit("/dev/usb%1").arg(i++) );
 	}