summaryrefslogtreecommitdiffstats
path: root/kcontrol/usbview
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/usbview')
-rw-r--r--kcontrol/usbview/kcmusb.cpp8
-rw-r--r--kcontrol/usbview/kcmusb.h2
-rw-r--r--kcontrol/usbview/usbdevices.cpp19
-rw-r--r--kcontrol/usbview/usbdevices.h5
4 files changed, 20 insertions, 14 deletions
diff --git a/kcontrol/usbview/kcmusb.cpp b/kcontrol/usbview/kcmusb.cpp
index b58647a9e..de61a61b2 100644
--- a/kcontrol/usbview/kcmusb.cpp
+++ b/kcontrol/usbview/kcmusb.cpp
@@ -36,7 +36,7 @@ USBViewer::USBViewer(TQWidget *parent, const char *name, const TQStringList &)
TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, KDialog::spacingHint());
TQGroupBox *gbox = new TQGroupBox(i18n("USB Devices"), this);
- gbox->setColumnLayout( 0, Qt::Horizontal );
+ gbox->setColumnLayout( 0, TQt::Horizontal );
vbox->addWidget(gbox);
TQVBoxLayout *vvbox = new TQVBoxLayout(gbox->layout(), KDialog::spacingHint());
@@ -63,9 +63,9 @@ USBViewer::USBViewer(TQWidget *parent, const char *name, const TQStringList &)
// 1 sec seems to be a good compromise between latency and polling load.
refreshTimer->start(1000);
- connect(refreshTimer, TQT_SIGNAL(timeout()), TQT_SLOT(refresh()));
- connect(_devices, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
- this, TQT_SLOT(selectionChanged(TQListViewItem*)));
+ connect(refreshTimer, TQ_SIGNAL(timeout()), TQ_SLOT(refresh()));
+ connect(_devices, TQ_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQ_SLOT(selectionChanged(TQListViewItem*)));
TDEAboutData *about =
new TDEAboutData(I18N_NOOP("kcmusb"), I18N_NOOP("TDE USB Viewer"),
diff --git a/kcontrol/usbview/kcmusb.h b/kcontrol/usbview/kcmusb.h
index eb33a475c..421129c30 100644
--- a/kcontrol/usbview/kcmusb.h
+++ b/kcontrol/usbview/kcmusb.h
@@ -23,7 +23,7 @@ class TQTextView;
class USBViewer : public TDECModule
{
- Q_OBJECT
+ TQ_OBJECT
public:
diff --git a/kcontrol/usbview/usbdevices.cpp b/kcontrol/usbview/usbdevices.cpp
index 42e1b89d2..896a47a47 100644
--- a/kcontrol/usbview/usbdevices.cpp
+++ b/kcontrol/usbview/usbdevices.cpp
@@ -30,6 +30,7 @@
#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
#include <sys/ioctl.h>
#include <sys/param.h>
+#include <errno.h>
#endif
TQPtrList<USBDevice> USBDevice::_devices;
@@ -329,7 +330,7 @@ bool USBDevice::parseSys(TQString dname)
void USBDevice::collectData(struct libusb20_backend *pbe,
struct libusb20_device *pdev)
#else
-void USBDevice::collectData( int fd, int leve, usb_device_info &di, int parent)
+void USBDevice::collectData( int fd, int level, usb_device_info &di, int parent)
#endif
{
#ifdef Q_OS_FREEBSD
@@ -412,7 +413,7 @@ void USBDevice::collectData( int fd, int leve, usb_device_info &di, int parent)
continue;
// Only add the device if we don't detect it, yet
- if (!find( di2.udi_us, di2.udi_addr ) )
+ if (!find( di2.udi_bus, di2.udi_addr ) )
{
USBDevice *device = new USBDevice();
device->collectData( fd, level + 1, di2, di.udi_addr );
@@ -447,7 +448,7 @@ bool USBDevice::parse(TQString fname)
libusb20_be_free(pbe);
#else
- TQFile controller("?dev/usb0");
+ TQFile controller("/dev/usb0");
int i = 1;
while ( controller.exists() )
{
@@ -459,7 +460,7 @@ bool USBDevice::parse(TQString fname)
struct usb_device_info di;
di.udi_addr = addr;
- if ( ioctl(controller.handle(), USB_DEVICEINFO, &d1) != -1)
+ if ( ioctl(controller.handle(), USB_DEVICEINFO, &di) != -1)
{
if (!find( di.udi_bus, di.udi_addr) )
{
@@ -469,16 +470,16 @@ bool USBDevice::parse(TQString fname)
}
}
controller.close();
-#ifndef Q_OS_NETBSD
} else {
- error = true;
-#endif
+ if ( errno != ENXIO) {
+ error = true;
+ }
}
- controller.setName( TQString::formLocal8Bit("/dev/usb%1".arg(i++) );
+ controller.setName( TQString::fromLocal8Bit("/dev/usb%1").arg(i++) );
}
if ( showErrorMessage && error ) {
- showErroeMessage = false;
+ showErrorMessage = false;
KMessageBox::error( 0, i18n("Could not open one or more USB controller. Make sure you have read access to all USB controllers that should be listed here."));
}
#endif
diff --git a/kcontrol/usbview/usbdevices.h b/kcontrol/usbview/usbdevices.h
index f655ef9a3..bc8eab4f6 100644
--- a/kcontrol/usbview/usbdevices.h
+++ b/kcontrol/usbview/usbdevices.h
@@ -70,7 +70,12 @@ private:
unsigned int _vendorID, _prodID, _revMajor, _revMinor;
#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
+#if defined(Q_OS_FREEBSD)
void collectData(struct libusb20_backend *, struct libusb20_device *);
+#endif
+#if defined(Q_OS_NETBSD)
+ void collectData( int fd, int level, usb_device_info &di, int parent);
+#endif
TQStringList _devnodes;
#endif
};