summaryrefslogtreecommitdiffstats
path: root/kcontrol/usbview
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
commitc663b6440964f6ac48027143ac9e63298991f9d0 (patch)
tree6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kcontrol/usbview
parenta061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff)
downloadtdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz
tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/usbview')
-rw-r--r--kcontrol/usbview/kcmusb.cpp68
-rw-r--r--kcontrol/usbview/kcmusb.h12
-rw-r--r--kcontrol/usbview/usbdb.cpp66
-rw-r--r--kcontrol/usbview/usbdb.h14
-rw-r--r--kcontrol/usbview/usbdevices.cpp108
-rw-r--r--kcontrol/usbview/usbdevices.h26
6 files changed, 147 insertions, 147 deletions
diff --git a/kcontrol/usbview/kcmusb.cpp b/kcontrol/usbview/kcmusb.cpp
index 24cb1f1bd..f3a5a85df 100644
--- a/kcontrol/usbview/kcmusb.cpp
+++ b/kcontrol/usbview/kcmusb.cpp
@@ -8,13 +8,13 @@
* *
***************************************************************************/
-#include <qgroupbox.h>
-#include <qheader.h>
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qsplitter.h>
-#include <qtextview.h>
-#include <qtimer.h>
+#include <tqgroupbox.h>
+#include <tqheader.h>
+#include <tqlayout.h>
+#include <tqlistview.h>
+#include <tqsplitter.h>
+#include <tqtextview.h>
+#include <tqtimer.h>
#include <kaboutdata.h>
#include <kdialog.h>
@@ -23,10 +23,10 @@
#include "usbdevices.h"
#include "kcmusb.moc"
-typedef KGenericFactory<USBViewer, QWidget > USBFactory;
+typedef KGenericFactory<USBViewer, TQWidget > USBFactory;
K_EXPORT_COMPONENT_FACTORY (kcm_usb, USBFactory("kcmusb") )
-USBViewer::USBViewer(QWidget *parent, const char *name, const QStringList &)
+USBViewer::USBViewer(TQWidget *parent, const char *name, const TQStringList &)
: KCModule(USBFactory::instance(), parent, name)
{
setButtons(Help);
@@ -34,38 +34,38 @@ USBViewer::USBViewer(QWidget *parent, const char *name, const QStringList &)
setQuickHelp( i18n("<h1>USB Devices</h1> This module allows you to see"
" the devices attached to your USB bus(es)."));
- QVBoxLayout *vbox = new QVBoxLayout(this, 0, KDialog::spacingHint());
- QGroupBox *gbox = new QGroupBox(i18n("USB Devices"), this);
+ TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, KDialog::spacingHint());
+ TQGroupBox *gbox = new TQGroupBox(i18n("USB Devices"), this);
gbox->setColumnLayout( 0, Qt::Horizontal );
vbox->addWidget(gbox);
- QVBoxLayout *vvbox = new QVBoxLayout(gbox->layout(), KDialog::spacingHint());
+ TQVBoxLayout *vvbox = new TQVBoxLayout(gbox->layout(), KDialog::spacingHint());
- QSplitter *splitter = new QSplitter(gbox);
+ TQSplitter *splitter = new TQSplitter(gbox);
vvbox->addWidget(splitter);
- _devices = new QListView(splitter);
+ _devices = new TQListView(splitter);
_devices->addColumn(i18n("Device"));
_devices->setRootIsDecorated(true);
_devices->header()->hide();
_devices->setMinimumWidth(200);
- _devices->setColumnWidthMode(0, QListView::Maximum);
+ _devices->setColumnWidthMode(0, TQListView::Maximum);
- QValueList<int> sizes;
+ TQValueList<int> sizes;
sizes.append(200);
splitter->setSizes(sizes);
- _details = new QTextView(splitter);
+ _details = new TQTextView(splitter);
- splitter->setResizeMode(_devices, QSplitter::KeepSize);
+ splitter->setResizeMode(_devices, TQSplitter::KeepSize);
- QTimer *refreshTimer = new QTimer(this);
+ TQTimer *refreshTimer = new TQTimer(this);
// 1 sec seems to be a good compromise between latency and polling load.
refreshTimer->start(1000);
- connect(refreshTimer, SIGNAL(timeout()), SLOT(refresh()));
- connect(_devices, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(selectionChanged(QListViewItem*)));
+ connect(refreshTimer, TQT_SIGNAL(timeout()), TQT_SLOT(refresh()));
+ connect(_devices, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(selectionChanged(TQListViewItem*)));
KAboutData *about =
new KAboutData(I18N_NOOP("kcmusb"), I18N_NOOP("KDE USB Viewer"),
@@ -97,12 +97,12 @@ static Q_UINT32 key_parent( USBDevice &dev )
return dev.bus()*256 + dev.parent();
}
-static void delete_recursive( QListViewItem *item, const QIntDict<QListViewItem> &new_items )
+static void delete_recursive( TQListViewItem *item, const TQIntDict<TQListViewItem> &new_items )
{
if (!item)
return;
- QListViewItemIterator it( item );
+ TQListViewItemIterator it( item );
while ( it.current() ) {
if (!new_items.find(it.current()->text(1).toUInt())) {
delete_recursive( it.current()->firstChild(), new_items);
@@ -114,7 +114,7 @@ static void delete_recursive( QListViewItem *item, const QIntDict<QListViewItem>
void USBViewer::refresh()
{
- QIntDict<QListViewItem> new_items;
+ TQIntDict<TQListViewItem> new_items;
if (!USBDevice::parse("/proc/bus/usb/devices"))
USBDevice::parseSys("/sys/bus/usb/devices");
@@ -126,33 +126,33 @@ void USBViewer::refresh()
{
found = false;
- QPtrListIterator<USBDevice> it(USBDevice::devices());
+ TQPtrListIterator<USBDevice> it(USBDevice::devices());
for ( ; it.current(); ++it)
if (it.current()->level() == level)
{
Q_UINT32 k = key(*it.current());
if (level == 0)
{
- QListViewItem *item = _items.find(k);
+ TQListViewItem *item = _items.find(k);
if (!item) {
- item = new QListViewItem(_devices,
+ item = new TQListViewItem(_devices,
it.current()->product(),
- QString::number(k));
+ TQString::number(k));
}
new_items.insert(k, item);
found = true;
}
else
{
- QListViewItem *parent = new_items.find(key_parent(*it.current()));
+ TQListViewItem *parent = new_items.find(key_parent(*it.current()));
if (parent)
{
- QListViewItem *item = _items.find(k);
+ TQListViewItem *item = _items.find(k);
if (!item) {
- item = new QListViewItem(parent,
+ item = new TQListViewItem(parent,
it.current()->product(),
- QString::number(k) );
+ TQString::number(k) );
}
new_items.insert(k, item);
parent->setOpen(true);
@@ -174,7 +174,7 @@ void USBViewer::refresh()
}
-void USBViewer::selectionChanged(QListViewItem *item)
+void USBViewer::selectionChanged(TQListViewItem *item)
{
if (item)
{
diff --git a/kcontrol/usbview/kcmusb.h b/kcontrol/usbview/kcmusb.h
index 275431078..472b289b4 100644
--- a/kcontrol/usbview/kcmusb.h
+++ b/kcontrol/usbview/kcmusb.h
@@ -12,7 +12,7 @@
#ifndef _KCMUSB_H
#define _KCMUSB_H
-#include <qintdict.h>
+#include <tqintdict.h>
#include <kcmodule.h>
@@ -27,20 +27,20 @@ class USBViewer : public KCModule
public:
- USBViewer(QWidget *parent = 0L, const char *name = 0L, const QStringList &list=QStringList() );
+ USBViewer(TQWidget *parent = 0L, const char *name = 0L, const TQStringList &list=TQStringList() );
void load();
protected slots:
- void selectionChanged(QListViewItem *item);
+ void selectionChanged(TQListViewItem *item);
void refresh();
private:
- QIntDict<QListViewItem> _items;
- QListView *_devices;
- QTextView *_details;
+ TQIntDict<TQListViewItem> _items;
+ TQListView *_devices;
+ TQTextView *_details;
};
diff --git a/kcontrol/usbview/usbdb.cpp b/kcontrol/usbview/usbdb.cpp
index 89cf973ba..c786ca40e 100644
--- a/kcontrol/usbview/usbdb.cpp
+++ b/kcontrol/usbview/usbdb.cpp
@@ -13,8 +13,8 @@
#include <iostream>
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqregexp.h>
#include <kstandarddirs.h>
@@ -26,11 +26,11 @@
USBDB::USBDB()
{
#ifndef USBIDS_FILE
- QString db = "/usr/share/hwdata/usb.ids"; /* on Fedora */
- if (!QFile::exists(db))
+ TQString db = "/usr/share/hwdata/usb.ids"; /* on Fedora */
+ if (!TQFile::exists(db))
db = locate("data", "kcmusb/usb.ids");
#else
- QString db = USBIDS_FILE;
+ TQString db = USBIDS_FILE;
#endif
if (db.isEmpty())
return;
@@ -38,19 +38,19 @@ USBDB::USBDB()
_classes.setAutoDelete(true);
_ids.setAutoDelete(true);
- QFile f(db);
+ TQFile f(db);
if (f.open(IO_ReadOnly))
{
- QTextStream ts(&f);
+ TQTextStream ts(&f);
- QString line, name;
+ TQString line, name;
int id=0, subid=0, protid=0;
- QRegExp vendor("[0-9a-fA-F]+ ");
- QRegExp product("\\s+[0-9a-fA-F]+ ");
- QRegExp cls("C [0-9a-fA-F][0-9a-fA-F]");
- QRegExp subclass("\\s+[0-9a-fA-F][0-9a-fA-F] ");
- QRegExp prot("\\s+[0-9a-fA-F][0-9a-fA-F] ");
+ TQRegExp vendor("[0-9a-fA-F]+ ");
+ TQRegExp product("\\s+[0-9a-fA-F]+ ");
+ TQRegExp cls("C [0-9a-fA-F][0-9a-fA-F]");
+ TQRegExp subclass("\\s+[0-9a-fA-F][0-9a-fA-F] ");
+ TQRegExp prot("\\s+[0-9a-fA-F][0-9a-fA-F] ");
while (!ts.eof())
{
line = ts.readLine();
@@ -65,34 +65,34 @@ USBDB::USBDB()
{
id = line.mid(2,2).toInt(0, 16);
name = line.mid(4).stripWhiteSpace();
- _classes.insert(QString("%1").arg(id), new QString(name));
+ _classes.insert(TQString("%1").arg(id), new TQString(name));
}
else if (prot.search(line) == 0 && prot.matchedLength() > 5)
{
line = line.stripWhiteSpace();
protid = line.left(2).toInt(0, 16);
name = line.mid(4).stripWhiteSpace();
- _classes.insert(QString("%1-%2-%3").arg(id).arg(subid).arg(protid), new QString(name));
+ _classes.insert(TQString("%1-%2-%3").arg(id).arg(subid).arg(protid), new TQString(name));
}
else if (subclass.search(line) == 0 && subclass.matchedLength() > 4)
{
line = line.stripWhiteSpace();
subid = line.left(2).toInt(0, 16);
name = line.mid(4).stripWhiteSpace();
- _classes.insert(QString("%1-%2").arg(id).arg(subid), new QString(name));
+ _classes.insert(TQString("%1-%2").arg(id).arg(subid), new TQString(name));
}
else if (vendor.search(line) == 0 && vendor.matchedLength() == 5)
{
id = line.left(4).toInt(0,16);
name = line.mid(6);
- _ids.insert(QString("%1").arg(id), new QString(name));
+ _ids.insert(TQString("%1").arg(id), new TQString(name));
}
else if (product.search(line) == 0 && product.matchedLength() > 5 )
{
line = line.stripWhiteSpace();
subid = line.left(4).toInt(0,16);
name = line.mid(6);
- _ids.insert(QString("%1-%2").arg(id).arg(subid), new QString(name));
+ _ids.insert(TQString("%1-%2").arg(id).arg(subid), new TQString(name));
}
}
@@ -102,49 +102,49 @@ USBDB::USBDB()
}
-QString USBDB::vendor(int id)
+TQString USBDB::vendor(int id)
{
- QString *s = _ids[QString("%1").arg(id)];
+ TQString *s = _ids[TQString("%1").arg(id)];
if ((id!= 0) && s)
{
return *s;
}
- return QString::null;
+ return TQString::null;
}
-QString USBDB::device(int vendor, int id)
+TQString USBDB::device(int vendor, int id)
{
- QString *s = _ids[QString("%1-%2").arg(vendor).arg(id)];
+ TQString *s = _ids[TQString("%1-%2").arg(vendor).arg(id)];
if ((id != 0) && (vendor != 0) && s)
return *s;
- return QString::null;
+ return TQString::null;
}
-QString USBDB::cls(int cls)
+TQString USBDB::cls(int cls)
{
- QString *s = _classes[QString("%1").arg(cls)];
+ TQString *s = _classes[TQString("%1").arg(cls)];
if (s)
return *s;
- return QString::null;
+ return TQString::null;
}
-QString USBDB::subclass(int cls, int sub)
+TQString USBDB::subclass(int cls, int sub)
{
- QString *s = _classes[QString("%1-%2").arg(cls).arg(sub)];
+ TQString *s = _classes[TQString("%1-%2").arg(cls).arg(sub)];
if (s)
return *s;
- return QString::null;
+ return TQString::null;
}
-QString USBDB::protocol(int cls, int sub, int prot)
+TQString USBDB::protocol(int cls, int sub, int prot)
{
- QString *s = _classes[QString("%1-%2-%2").arg(cls).arg(sub).arg(prot)];
+ TQString *s = _classes[TQString("%1-%2-%2").arg(cls).arg(sub).arg(prot)];
if (s)
return *s;
- return QString::null;
+ return TQString::null;
}
diff --git a/kcontrol/usbview/usbdb.h b/kcontrol/usbview/usbdb.h
index 2b4226937..0b8c9f550 100644
--- a/kcontrol/usbview/usbdb.h
+++ b/kcontrol/usbview/usbdb.h
@@ -13,7 +13,7 @@
#define __USB_DB_H__
-#include <qdict.h>
+#include <tqdict.h>
class USBDB
@@ -22,16 +22,16 @@ public:
USBDB();
- QString vendor(int id);
- QString device(int vendor, int id);
+ TQString vendor(int id);
+ TQString device(int vendor, int id);
- QString cls(int cls);
- QString subclass(int cls, int sub);
- QString protocol(int cls, int sub, int prot);
+ TQString cls(int cls);
+ TQString subclass(int cls, int sub);
+ TQString protocol(int cls, int sub, int prot);
private:
- QDict<QString> _classes, _ids;
+ TQDict<TQString> _classes, _ids;
};
diff --git a/kcontrol/usbview/usbdevices.cpp b/kcontrol/usbview/usbdevices.cpp
index 3d557a7ed..466fd9a98 100644
--- a/kcontrol/usbview/usbdevices.cpp
+++ b/kcontrol/usbview/usbdevices.cpp
@@ -15,9 +15,9 @@
#include <unistd.h>
#include <stdio.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqregexp.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -32,7 +32,7 @@
#include <sys/param.h>
#endif
-QPtrList<USBDevice> USBDevice::_devices;
+TQPtrList<USBDevice> USBDevice::_devices;
USBDB *USBDevice::_db;
@@ -50,26 +50,26 @@ USBDevice::USBDevice()
_db = new USBDB;
}
-static QString catFile(QString fname)
+static TQString catFile(TQString fname)
{
char buffer[256];
- QString result;
- int fd = ::open(QFile::encodeName(fname), O_RDONLY);
+ TQString result;
+ int fd = ::open(TQFile::encodeName(fname), O_RDONLY);
if (fd<0)
- return QString::null;
+ return TQString::null;
if (fd >= 0)
{
ssize_t count;
while ((count = ::read(fd, buffer, 256)) > 0)
- result.append(QString(buffer).left(count));
+ result.append(TQString(buffer).left(count));
::close(fd);
}
return result.stripWhiteSpace();
}
-void USBDevice::parseSysDir(int bus, int parent, int level, QString dname)
+void USBDevice::parseSysDir(int bus, int parent, int level, TQString dname)
{
_level = level;
_parent = parent;
@@ -80,7 +80,7 @@ void USBDevice::parseSysDir(int bus, int parent, int level, QString dname)
_device = catFile(dname + "/devnum").toUInt();
if (_device == 1)
- _product += QString(" (%1)").arg(_bus);
+ _product += TQString(" (%1)").arg(_bus);
_vendorID = catFile(dname + "/idVendor").toUInt(0, 16);
_prodID = catFile(dname + "/idProduct").toUInt(0, 16);
@@ -97,12 +97,12 @@ void USBDevice::parseSysDir(int bus, int parent, int level, QString dname)
_verMajor = int(version);
_verMinor = int(10*(version - floor(version)));
- QDir dir(dname);
- dir.setNameFilter(QString("%1-*").arg(bus));
- dir.setFilter(QDir::Dirs);
- QStringList list = dir.entryList();
+ TQDir dir(dname);
+ dir.setNameFilter(TQString("%1-*").arg(bus));
+ dir.setFilter(TQDir::Dirs);
+ TQStringList list = dir.entryList();
- for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) {
+ for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it) {
if ((*it).contains(':'))
continue;
@@ -111,7 +111,7 @@ void USBDevice::parseSysDir(int bus, int parent, int level, QString dname)
}
}
-void USBDevice::parseLine(QString line)
+void USBDevice::parseLine(TQString line)
{
if (line.startsWith("T:"))
sscanf(line.local8Bit().data(),
@@ -123,7 +123,7 @@ void USBDevice::parseLine(QString line)
_product = line.mid(12);
/* add bus number to root devices */
if (_device==1)
- _product += QString(" (%1)").arg(_bus);
+ _product += TQString(" (%1)").arg(_bus);
}
else if (line.startsWith("S: SerialNumber"))
_serial = line.mid(17);
@@ -151,27 +151,27 @@ void USBDevice::parseLine(QString line)
USBDevice *USBDevice::find(int bus, int device)
{
- QPtrListIterator<USBDevice> it(_devices);
+ TQPtrListIterator<USBDevice> it(_devices);
for ( ; it.current(); ++it)
if (it.current()->bus() == bus && it.current()->device() == device)
return it.current();
return 0;
}
-QString USBDevice::product()
+TQString USBDevice::product()
{
if (!_product.isEmpty())
return _product;
- QString pname = _db->device(_vendorID, _prodID);
+ TQString pname = _db->device(_vendorID, _prodID);
if (!pname.isEmpty())
return pname;
return i18n("Unknown");
}
-QString USBDevice::dump()
+TQString USBDevice::dump()
{
- QString r;
+ TQString r;
r = "<qml><h2><center>" + product() + "</center></h2><br/><hl/>";
@@ -182,41 +182,41 @@ QString USBDevice::dump()
r += "<br/><table>";
- QString c = QString("<td>%1</td>").arg(_class);
- QString cname = _db->cls(_class);
+ TQString c = TQString("<td>%1</td>").arg(_class);
+ TQString cname = _db->cls(_class);
if (!cname.isEmpty())
c += "<td>(" + i18n(cname.latin1()) +")</td>";
r += i18n("<tr><td><i>Class</i></td>%1</tr>").arg(c);
- QString sc = QString("<td>%1</td>").arg(_sub);
- QString scname = _db->subclass(_class, _sub);
+ TQString sc = TQString("<td>%1</td>").arg(_sub);
+ TQString scname = _db->subclass(_class, _sub);
if (!scname.isEmpty())
sc += "<td>(" + i18n(scname.latin1()) +")</td>";
r += i18n("<tr><td><i>Subclass</i></td>%1</tr>").arg(sc);
- QString pr = QString("<td>%1</td>").arg(_prot);
- QString prname = _db->protocol(_class, _sub, _prot);
+ TQString pr = TQString("<td>%1</td>").arg(_prot);
+ TQString prname = _db->protocol(_class, _sub, _prot);
if (!prname.isEmpty())
pr += "<td>(" + prname +")</td>";
r += i18n("<tr><td><i>Protocol</i></td>%1</tr>").arg(pr);
#ifndef Q_OS_FREEBSD
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));
+ .arg(TQString::number(_verMinor,16).prepend('0').right(2));
#endif
r += "<tr><td></td></tr>";
- QString v = QString::number(_vendorID,16);
- QString name = _db->vendor(_vendorID);
+ TQString v = TQString::number(_vendorID,16);
+ TQString name = _db->vendor(_vendorID);
if (!name.isEmpty())
v += "<td>(" + name +")</td>";
r += i18n("<tr><td><i>Vendor ID</i></td><td>0x%1</td></tr>").arg(v);
- QString p = QString::number(_prodID,16);
- QString pname = _db->device(_vendorID, _prodID);
+ TQString p = TQString::number(_prodID,16);
+ TQString pname = _db->device(_vendorID, _prodID);
if (!pname.isEmpty())
p += "<td>(" + pname +")</td>";
r += i18n("<tr><td><i>Product ID</i></td><td>0x%1</td></tr>").arg(p);
r += i18n("<tr><td><i>Revision</i></td><td>%1.%2</td></tr>")
.arg(_revMajor,0,16)
- .arg(QString::number(_revMinor,16).prepend('0').right(2));
+ .arg(TQString::number(_revMinor,16).prepend('0').right(2));
r += "<tr><td></td></tr>";
r += i18n("<tr><td><i>Speed</i></td><td>%1 Mbit/s</td></tr>").arg(_speed);
@@ -228,7 +228,7 @@ QString USBDevice::dump()
r += i18n("<tr><td><i>Power Consumption</i></td><td>self powered</td></tr>");
r += i18n("<tr><td><i>Attached Devicenodes</i></td><td>%1</td></tr>").arg(*_devnodes.at(0));
if ( _devnodes.count() > 1 )
- for ( QStringList::Iterator it = _devnodes.at(1); it != _devnodes.end(); ++it )
+ for ( TQStringList::Iterator it = _devnodes.at(1); it != _devnodes.end(); ++it )
r += "<tr><td></td><td>" + *it + "</td></tr>";
#else
r += i18n("<tr><td><i>Max. Packet Size</i></td><td>%1</td></tr>").arg(_maxPacketSize);
@@ -250,18 +250,18 @@ QString USBDevice::dump()
#ifndef Q_OS_FREEBSD
-bool USBDevice::parse(QString fname)
+bool USBDevice::parse(TQString fname)
{
_devices.clear();
- QString result;
+ TQString result;
// read in the complete file
//
- // Note: we can't use a QTextStream, as the files in /proc
+ // Note: we can't use a TQTextStream, as the files in /proc
// are pseudo files with zero length
char buffer[256];
- int fd = ::open(QFile::encodeName(fname), O_RDONLY);
+ int fd = ::open(TQFile::encodeName(fname), O_RDONLY);
if (fd<0)
return false;
@@ -269,7 +269,7 @@ bool USBDevice::parse(QString fname)
{
ssize_t count;
while ((count = ::read(fd, buffer, 256)) > 0)
- result.append(QString(buffer).left(count));
+ result.append(TQString(buffer).left(count));
::close(fd);
}
@@ -277,10 +277,10 @@ bool USBDevice::parse(QString fname)
// read in the device infos
USBDevice *device = 0;
int start=0, end;
- result.replace(QRegExp("^\n"),"");
+ result.replace(TQRegExp("^\n"),"");
while ((end = result.find('\n', start)) > 0)
{
- QString line = result.mid(start, end-start);
+ TQString line = result.mid(start, end-start);
if (line.startsWith("T:"))
device = new USBDevice();
@@ -293,17 +293,17 @@ bool USBDevice::parse(QString fname)
return true;
}
-bool USBDevice::parseSys(QString dname)
+bool USBDevice::parseSys(TQString dname)
{
- QDir d(dname);
+ TQDir d(dname);
d.setNameFilter("usb*");
- QStringList list = d.entryList();
+ TQStringList list = d.entryList();
- for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) {
+ for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it) {
USBDevice* device = new USBDevice();
int bus = 0;
- QRegExp bus_reg("[a-z]*([0-9]+)");
+ TQRegExp bus_reg("[a-z]*([0-9]+)");
if (bus_reg.search(*it) != -1)
bus = bus_reg.cap(1).toInt();
@@ -332,10 +332,10 @@ void USBDevice::collectData( int fd, int level, usb_device_info &di, int parent)
_bus = di.udi_bus;
_device = di.udi_addr;
- _product = QString::fromLatin1(di.udi_product);
+ _product = TQString::fromLatin1(di.udi_product);
if ( _device == 1 )
- _product += " " + QString::number( _bus );
- _manufacturer = QString::fromLatin1(di.udi_vendor);
+ _product += " " + TQString::number( _bus );
+ _manufacturer = TQString::fromLatin1(di.udi_vendor);
_prodID = di.udi_productNo;
_vendorID = di.udi_vendorNo;
_class = di.udi_class;
@@ -387,13 +387,13 @@ void USBDevice::collectData( int fd, int level, usb_device_info &di, int parent)
-bool USBDevice::parse(QString fname)
+bool USBDevice::parse(TQString fname)
{
static bool showErrorMessage = true;
bool error = false;
_devices.clear();
- QFile controller("/dev/usb0");
+ TQFile controller("/dev/usb0");
int i = 1;
while ( controller.exists() )
{
@@ -418,7 +418,7 @@ bool USBDevice::parse(QString fname)
} else {
error = true;
}
- controller.setName( QString::fromLocal8Bit("/dev/usb%1").arg(i++) );
+ controller.setName( TQString::fromLocal8Bit("/dev/usb%1").arg(i++) );
}
if ( showErrorMessage && error ) {
diff --git a/kcontrol/usbview/usbdevices.h b/kcontrol/usbview/usbdevices.h
index 853df02b3..23717ee65 100644
--- a/kcontrol/usbview/usbdevices.h
+++ b/kcontrol/usbview/usbdevices.h
@@ -13,8 +13,8 @@
#define __USB_DEVICES_H__
-#include <qstring.h>
-#include <qptrlist.h>
+#include <tqstring.h>
+#include <tqptrlist.h>
#ifdef Q_OS_FREEBSD
#include <dev/usb/usb.h>
@@ -29,45 +29,45 @@ public:
USBDevice();
- void parseLine(QString line);
- void parseSysDir(int bus, int parent, int level, QString line);
+ void parseLine(TQString line);
+ void parseSysDir(int bus, int parent, int level, TQString line);
int level() { return _level; };
int device() { return _device; };
int parent() { return _parent; };
int bus() { return _bus; };
- QString product();
+ TQString product();
- QString dump();
+ TQString dump();
- static QPtrList<USBDevice> &devices() { return _devices; };
+ static TQPtrList<USBDevice> &devices() { return _devices; };
static USBDevice *find(int bus, int device);
- static bool parse(QString fname);
- static bool parseSys(QString fname);
+ static bool parse(TQString fname);
+ static bool parseSys(TQString fname);
private:
- static QPtrList<USBDevice> _devices;
+ static TQPtrList<USBDevice> _devices;
static USBDB *_db;
int _bus, _level, _parent, _port, _count, _device, _channels, _power;
float _speed;
- QString _manufacturer, _product, _serial;
+ TQString _manufacturer, _product, _serial;
int _bwTotal, _bwUsed, _bwPercent, _bwIntr, _bwIso;
bool _hasBW;
unsigned int _verMajor, _verMinor, _class, _sub, _prot, _maxPacketSize, _configs;
- QString _className;
+ TQString _className;
unsigned int _vendorID, _prodID, _revMajor, _revMinor;
#ifdef Q_OS_FREEBSD
void collectData( int fd, int level, usb_device_info &di, int parent );
- QStringList _devnodes;
+ TQStringList _devnodes;
#endif
};