mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
$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++) );
|
|
}
|