$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 -#ifdef Q_OS_FREEBSD +#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) #include #include #endif @@ -197,7 +197,7 @@ QString USBDevice::dump() if (!prname.isEmpty()) pr += "(" + prname +")"; r += i18n("Protocol%1").arg(pr); -#ifndef Q_OS_FREEBSD +#if !(defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)) r += i18n("USB Version%1.%2") .arg(_verMajor,0,16) .arg(QString::number(_verMinor,16).prepend('0').right(2)); @@ -221,7 +221,7 @@ QString USBDevice::dump() r += i18n("Speed%1 Mbit/s").arg(_speed); r += i18n("Channels%1").arg(_channels); -#ifdef Q_OS_FREEBSD +#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) if ( _power ) r += i18n("Power Consumption%1 mA").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++) ); }