diff options
Diffstat (limited to 'knetload/knetload.cpp')
-rw-r--r-- | knetload/knetload.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/knetload/knetload.cpp b/knetload/knetload.cpp index 84f2627..aa700cd 100644 --- a/knetload/knetload.cpp +++ b/knetload/knetload.cpp @@ -23,13 +23,13 @@ #include <klocale.h> #include <kmessagebox.h> #include <kpopupmenu.h> -#include <qdir.h> +#include <tqdir.h> #define DEFAULT_SCALE 128000 #define MAX_NET_DEV_LINE 512 -KNetLoad::KNetLoad(QWidget *parent, const char *name) : - StatPopup(false, parent, name) { +KNetLoad::KNetLoad(TQWidget *tqparent, const char *name) : + StatPopup(false, tqparent, name) { // Create the raw network data reader. proc = new KNetProc(); @@ -41,11 +41,11 @@ KNetLoad::KNetLoad(QWidget *parent, const char *name) : stockDevice.push_back("ppp0"); stockDeviceIconOff.push_back("devppp0"); stockDeviceIconOn.push_back("devppp0on"); stockDevice.push_back("ippp0"); stockDeviceIconOff.push_back("devippp0"); stockDeviceIconOn.push_back("devippp0on"); #else - if ( QDir::root().exists("/sys/class/net") ) + if ( TQDir::root().exists("/sys/class/net") ) { // Exists /sys, 2.6 series kernel - QDir sys("/sys/class/net"); - QStringList l = sys.entryList(); - for(QStringList::iterator it = l.begin(); it != l.end(); it++) + TQDir sys("/sys/class/net"); + TQStringList l = sys.entryList(); + for(TQStringList::iterator it = l.begin(); it != l.end(); it++) { if ( (*it)[0] == '.' ) continue; @@ -54,13 +54,13 @@ KNetLoad::KNetLoad(QWidget *parent, const char *name) : if ( *it == "lo" ) { stockDeviceIconOn.push_back("devloon"); stockDeviceIconOff.push_back("devlo"); - } else if ( (*it).find("eth") == 0 ) { + } else if ( (*it).tqfind("eth") == 0 ) { stockDeviceIconOn.push_back("deveth0on"); stockDeviceIconOff.push_back("deveth0"); - } else if ( (*it).find("ppp") == 0 ) { + } else if ( (*it).tqfind("ppp") == 0 ) { stockDeviceIconOn.push_back("devppp0on"); stockDeviceIconOff.push_back("devppp0"); - } else if ( (*it).find("ippp") == 0 ) { + } else if ( (*it).tqfind("ippp") == 0 ) { stockDeviceIconOn.push_back("devippp0on"); stockDeviceIconOff.push_back("devippp0"); } else { @@ -139,7 +139,7 @@ KNetLoad::~KNetLoad() { delete proc; } -void KNetLoad::setDevice(const QString& newDevice) { +void KNetLoad::setDevice(const TQString& newDevice) { proc->setDevice(newDevice); clearHistory(); updateDeviceMenus(); @@ -161,7 +161,7 @@ void KNetLoad::setDevice(int deviceIndex) { // It's a custom device. Open a dialog. DeviceDialog dlg(proc->getDevice(), firstDock()); if (dlg.exec()) { - QString newDevice = dlg.getDevice().stripWhiteSpace(); + TQString newDevice = dlg.getDevice().stripWhiteSpace(); if (newDevice.isEmpty()) KMessageBox::error(firstDock(), i18n("The device name cannot be empty.")); @@ -224,12 +224,12 @@ void KNetLoad::setScaleOut(int scale) { config->sync(); } -QString KNetLoad::dockName(int which) const { +TQString KNetLoad::dockName(int which) const { return (which == 0 ? i18n("In") : i18n("Out")); } -QColor KNetLoad::defaultDockColor(int which) const { - return (which == 0 ? QColor(0, 0, 255) : QColor(255, 0, 255)); +TQColor KNetLoad::defaultDockColor(int which) const { + return (which == 0 ? TQColor(0, 0, 255) : TQColor(255, 0, 255)); } void KNetLoad::setupCustomActions() { @@ -254,7 +254,7 @@ void KNetLoad::insertCustomItems(KPopupMenu* menu) { stockDevice[i], i); deviceMenu->insertItem(SmallIcon("devother"), i18n("Other...")); updateDeviceMenu(deviceMenu); - connect(deviceMenu, SIGNAL(activated(int)), this, SLOT(setDevice(int))); + connect(deviceMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setDevice(int))); menu->insertItem(SmallIcon("devselect"), i18n("&Device"), deviceMenu); // Scale menus. The menu item IDs are the scales themselves (in bits @@ -274,7 +274,7 @@ void KNetLoad::insertCustomItems(KPopupMenu* menu) { scaleInMenu->insertItem(i18n("10MBit/s"), 10000000); scaleInMenu->insertItem(i18n("Other...")); updateScaleInMenu(scaleInMenu); - connect(scaleInMenu, SIGNAL(activated(int)), this, SLOT(setScaleIn(int))); + connect(scaleInMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setScaleIn(int))); menu->insertItem(SmallIcon("scalein"), i18n("&Scale (In)"), scaleInMenu); KPopupMenu* scaleOutMenu = new KPopupMenu(menu); @@ -294,7 +294,7 @@ void KNetLoad::insertCustomItems(KPopupMenu* menu) { scaleOutMenu->insertSeparator(); scaleOutMenu->insertItem(i18n("Same as for in"), 0); updateScaleOutMenu(scaleOutMenu); - connect(scaleOutMenu, SIGNAL(activated(int)), this, SLOT(setScaleOut(int))); + connect(scaleOutMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setScaleOut(int))); menu->insertItem(SmallIcon("scaleout"), i18n("&Scale (Out)"), scaleOutMenu); // The final separator. @@ -328,12 +328,12 @@ void KNetLoad::takeReadingInternal() { fullReading = i18n( "Current In: %1 KBit/s, Total In: %2 MB.\n" "Current Out: %3 KBit/s, Total Out: %4 MB.") - .arg(KGlobal::locale()->formatNumber((int)((bitRateIn + 50) / 100) / 10.0)).arg(KGlobal::locale()->formatNumber(proc->totalMbIn())) - .arg(KGlobal::locale()->formatNumber((int)((bitRateOut + 50) / 100) / 10.0)).arg(KGlobal::locale()->formatNumber(proc->totalMbOut())); + .tqarg(KGlobal::locale()->formatNumber((int)((bitRateIn + 50) / 100) / 10.0)).tqarg(KGlobal::locale()->formatNumber(proc->totalMbIn())) + .tqarg(KGlobal::locale()->formatNumber((int)((bitRateOut + 50) / 100) / 10.0)).tqarg(KGlobal::locale()->formatNumber(proc->totalMbOut())); } void KNetLoad::updateDeviceMenu(KPopupMenu* menu) { - const QString& dev = proc->getDevice(); + const TQString& dev = proc->getDevice(); // Update the checked/unchecked states of menu items. bool found = false; @@ -369,7 +369,7 @@ void KNetLoad::updateDeviceMenu(KPopupMenu* menu) { menu->setItemChecked(otherId, false); } else { menu->changeItem(otherId, SmallIcon("devotheron"), - QString(i18n("Other (%1)...")).arg(dev)); + TQString(i18n("Other (%1)...")).tqarg(dev)); menu->setItemChecked(otherId, true); } } @@ -403,7 +403,7 @@ void KNetLoad::updateScaleInMenu(KPopupMenu* menu) { if (found) menu->changeItem(otherId, i18n("Other...")); else { - QString text = i18n("Other (%1KBit/s)...").arg(int(((float) scaleIn) / 1000)); + TQString text = i18n("Other (%1KBit/s)...").tqarg(int(((float) scaleIn) / 1000)); menu->changeItem(otherId, text); } @@ -441,7 +441,7 @@ void KNetLoad::updateScaleOutMenu(KPopupMenu* menu) { if (found) menu->changeItem(otherId, i18n("Other...")); else { - QString text = i18n("Other (%1KBit/s)...").arg(int(((float) scaleOut) / 1000)); + TQString text = i18n("Other (%1KBit/s)...").tqarg(int(((float) scaleOut) / 1000)); menu->changeItem(otherId, text); } |