summaryrefslogtreecommitdiffstats
path: root/ksim/monitors/net
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-23 01:42:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-23 01:42:07 +0000
commita2277b6bc715464e83882b90c2a058139b8a6b54 (patch)
treeab09b14014f59b4d8e2ddd12226aa0b22e4dfc5d /ksim/monitors/net
parentd3f79e04b34bd1f70a458b81b28fc8799498c8dc (diff)
downloadtdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.tar.gz
tdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.zip
TQt4 port kdeutils
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1238125 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksim/monitors/net')
-rw-r--r--ksim/monitors/net/ksimnet.cpp28
-rw-r--r--ksim/monitors/net/ksimnet.h3
-rw-r--r--ksim/monitors/net/netconfig.cpp24
-rw-r--r--ksim/monitors/net/netconfig.h5
-rw-r--r--ksim/monitors/net/netdialog.cpp16
-rw-r--r--ksim/monitors/net/netdialog.h5
6 files changed, 42 insertions, 39 deletions
diff --git a/ksim/monitors/net/ksimnet.cpp b/ksim/monitors/net/ksimnet.cpp
index 1bbfeb2..0c16f2d 100644
--- a/ksim/monitors/net/ksimnet.cpp
+++ b/ksim/monitors/net/ksimnet.cpp
@@ -99,8 +99,8 @@ void NetPlugin::showAbout()
KAboutApplication(&aboutData).exec();
}
-NetView::NetView(KSim::PluginObject *parent, const char *name)
- : KSim::PluginView(parent, name)
+NetView::NetView(KSim::PluginObject *tqparent, const char *name)
+ : KSim::PluginView(tqparent, name)
{
#ifdef __linux__
m_procStream = 0L;
@@ -356,7 +356,7 @@ void NetView::updateGraph()
if ( ( *it ).label() )
{
timeDisplay = ( *it ).format();
- newPid = pid.arg( ( *it ).name() );
+ newPid = pid.tqarg( ( *it ).name() );
if ( TQFile::exists( newPid ) && stat( TQFile::encodeName( newPid ).data(), &st ) == 0 )
{
@@ -371,8 +371,8 @@ void NetView::updateGraph()
}
// Keep backwards compat for now
- if ( timeDisplay.contains( '%' ) > 0 )
- timeDisplay.replace( '%', "" );
+ if ( timeDisplay.tqcontains( '%' ) > 0 )
+ timeDisplay.tqreplace( '%', "" );
( *it ).label()->setText( netTime.toString( timeDisplay ) );
}
@@ -394,16 +394,16 @@ void NetView::updateGraph()
TQString receiveString = KGlobal::locale()->formatNumber( ( float ) receiveDiff / 1024.0, 1 );
TQString sendString = KGlobal::locale()->formatNumber( ( float ) sendDiff / 1024.0, 1 );
- ( *it ).chart()->setText( i18n( "in: %1k" ).arg( receiveString ),
- i18n( "out: %1k" ).arg( sendString ) );
+ ( *it ).chart()->setText( i18n( "in: %1k" ).tqarg( receiveString ),
+ i18n( "out: %1k" ).tqarg( sendString ) );
}
else
{
( *it ).setData( NetData() );
( *it ).chart()->setValue( 0, 0 );
- ( *it ).chart()->setText( i18n( "in: %1k" ).arg( KGlobal::locale()->formatNumber( 0.0, 1 ) ),
- i18n( "out: %1k" ).arg( KGlobal::locale()->formatNumber( 0.0, 1 ) ) );
+ ( *it ).chart()->setText( i18n( "in: %1k" ).tqarg( KGlobal::locale()->formatNumber( 0.0, 1 ) ),
+ i18n( "out: %1k" ).tqarg( KGlobal::locale()->formatNumber( 0.0, 1 ) ) );
if ( ( *it ).label() )
( *it ).label()->setText( i18n( "offline" ) );
@@ -468,7 +468,7 @@ void NetView::netStatistics(const TQString &device, NetData &data)
while (!m_procStream->atEnd()) {
parser = m_procStream->readLine();
// remove all the entries apart from the line containing 'device'
- if (parser.find(device) != -1)
+ if (parser.tqfind(device) != -1)
output = parser;
}
@@ -480,7 +480,7 @@ void NetView::netStatistics(const TQString &device, NetData &data)
// make sure our output doesn't contain "eth0:11210107" so we dont
// end up with netList[1] actually being netList[2]
- output.replace(TQRegExp(":"), " ");
+ output.tqreplace(TQRegExp(":"), " ");
TQStringList netList = TQStringList::split(' ', output);
data.in = netList[1].toULong();
@@ -559,7 +559,7 @@ bool NetView::isOnline(const TQString &device)
if (!file.open(IO_ReadOnly))
return -1;
- return (TQTextStream(&file).read().find(device) != -1 ? true : false);
+ return (TQTextStream(&file).read().tqfind(device) != -1 ? true : false);
#endif
#ifdef __FreeBSD__
@@ -632,7 +632,7 @@ bool NetView::eventFilter( TQObject * o, TQEvent * e )
Network::List::Iterator it;
for ( it = m_networkList.begin(); it != m_networkList.end(); ++it )
{
- if ( o == ( *it ).chart() || o == ( *it ).label() || o == ( *it ).led() )
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(( *it ).chart()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(( *it ).label()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(( *it ).led()) )
{
break;
}
@@ -642,7 +642,7 @@ bool NetView::eventFilter( TQObject * o, TQEvent * e )
if ( e->type() == TQEvent::MouseButtonPress )
{
- if ( static_cast<TQMouseEvent *>( e )->button() == TQMouseEvent::RightButton )
+ if ( TQT_TQMOUSEEVENT( e )->button() == Qt::RightButton )
{
showMenu(i);
}
diff --git a/ksim/monitors/net/ksimnet.h b/ksim/monitors/net/ksimnet.h
index e8a0fbc..3bd8cb1 100644
--- a/ksim/monitors/net/ksimnet.h
+++ b/ksim/monitors/net/ksimnet.h
@@ -43,8 +43,9 @@ class NetPlugin : public KSim::PluginObject
class NetView : public KSim::PluginView
{
Q_OBJECT
+ TQ_OBJECT
public:
- NetView(KSim::PluginObject *parent, const char *name);
+ NetView(KSim::PluginObject *tqparent, const char *name);
~NetView();
virtual void reparseConfig();
diff --git a/ksim/monitors/net/netconfig.cpp b/ksim/monitors/net/netconfig.cpp
index cd86824..9a19047 100644
--- a/ksim/monitors/net/netconfig.cpp
+++ b/ksim/monitors/net/netconfig.cpp
@@ -34,8 +34,8 @@
#include "netconfig.moc"
#include "netdialog.h"
-NetConfig::NetConfig(KSim::PluginObject *parent, const char *name)
- : KSim::PluginPage(parent, name)
+NetConfig::NetConfig(KSim::PluginObject *tqparent, const char *name)
+ : KSim::PluginPage(tqparent, name)
{
m_yes = i18n("yes");
m_no = i18n("no");
@@ -56,29 +56,29 @@ NetConfig::NetConfig(KSim::PluginObject *parent, const char *name)
TQT_SLOT(modifyItem(TQListViewItem *)));
mainLayout->addWidget(usingBox);
- layout = new TQHBoxLayout;
- layout->setSpacing(6);
+ tqlayout = new TQHBoxLayout;
+ tqlayout->setSpacing(6);
TQSpacerItem *spacer = new TQSpacerItem(20, 20,
TQSizePolicy::Expanding, TQSizePolicy::Minimum);
- layout->addItem(spacer);
+ tqlayout->addItem(spacer);
insertButton = new TQPushButton(this);
insertButton->setText(i18n("Add..."));
connect(insertButton, TQT_SIGNAL(clicked()), TQT_SLOT(showNetDialog()));
- layout->addWidget(insertButton);
+ tqlayout->addWidget(insertButton);
modifyButton = new TQPushButton(this);
modifyButton->setText(i18n("Modify..."));
connect(modifyButton, TQT_SIGNAL(clicked()), TQT_SLOT(modifyCurrent()));
- layout->addWidget(modifyButton);
+ tqlayout->addWidget(modifyButton);
removeButton = new TQPushButton(this);
removeButton->setText(i18n("Remove"));
connect(removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeCurrent()));
- layout->addWidget(removeButton);
+ tqlayout->addWidget(removeButton);
- mainLayout->addLayout(layout);
+ mainLayout->addLayout(tqlayout);
}
NetConfig::~NetConfig()
@@ -144,8 +144,8 @@ void NetConfig::menu(KListView *, TQListViewItem *item, const TQPoint &)
if (item) {
aboutMenu->insertItem(i18n("&Add Net Device"), 3);
- aboutMenu->insertItem(i18n("&Modify '%1'").arg(item->text(0)), 2);
- aboutMenu->insertItem(i18n("&Remove '%1'").arg(item->text(0)), 1);
+ aboutMenu->insertItem(i18n("&Modify '%1'").tqarg(item->text(0)), 2);
+ aboutMenu->insertItem(i18n("&Remove '%1'").tqarg(item->text(0)), 1);
}
else {
aboutMenu->insertItem(i18n("&Add Net Device"), 3);
@@ -217,7 +217,7 @@ void NetConfig::removeItem(TQListViewItem *item)
return;
int result = KMessageBox::warningContinueCancel(0, i18n("Are you sure you "
- "want to remove the net interface '%1'?").arg(item->text(0)), TQString::null, KStdGuiItem::del());
+ "want to remove the net interface '%1'?").tqarg(item->text(0)), TQString(), KStdGuiItem::del());
if (result == KMessageBox::Cancel)
return;
diff --git a/ksim/monitors/net/netconfig.h b/ksim/monitors/net/netconfig.h
index d83c20f..2d07176 100644
--- a/ksim/monitors/net/netconfig.h
+++ b/ksim/monitors/net/netconfig.h
@@ -33,8 +33,9 @@ class TQListViewItem;
class NetConfig : public KSim::PluginPage
{
Q_OBJECT
+ TQ_OBJECT
public:
- NetConfig(KSim::PluginObject *parent, const char *name);
+ NetConfig(KSim::PluginObject *tqparent, const char *name);
virtual ~NetConfig();
virtual void saveConfig();
@@ -53,7 +54,7 @@ class NetConfig : public KSim::PluginPage
// Couldnt think of a better name for this :)
const TQString &boolToString(bool) const;
- TQHBoxLayout *layout;
+ TQHBoxLayout *tqlayout;
TQPushButton *insertButton;
TQPushButton *removeButton;
TQPushButton *modifyButton;
diff --git a/ksim/monitors/net/netdialog.cpp b/ksim/monitors/net/netdialog.cpp
index 60a5d20..3513bf4 100644
--- a/ksim/monitors/net/netdialog.cpp
+++ b/ksim/monitors/net/netdialog.cpp
@@ -49,8 +49,8 @@
#include <string.h>
-NetDialog::NetDialog(TQWidget *parent, const char *name)
- : TQTabDialog(parent, name, true)
+NetDialog::NetDialog(TQWidget *tqparent, const char *name)
+ : TQTabDialog(tqparent, name, true)
{
m_clicked = false;
setCaption(kapp->makeStdCaption(i18n("Network Interface")));
@@ -65,7 +65,7 @@ NetDialog::NetDialog(TQWidget *parent, const char *name)
m_generalLayout->addMultiCellWidget(m_deviceLabel, 0, 0, 0, 0);
m_deviceCombo = new KComboBox(true, m_generalTab);
- m_deviceCombo->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred,
+ m_deviceCombo->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred,
TQSizePolicy::Fixed));
m_deviceCombo->setFocus();
m_deviceCombo->setDuplicatesEnabled(false);
@@ -86,10 +86,10 @@ NetDialog::NetDialog(TQWidget *parent, const char *name)
m_timerBox = new TQGroupBox(m_generalTab);
m_timerBox->setTitle(i18n("Timer"));
m_timerBox->setColumnLayout(0, Qt::Vertical);
- m_timerBox->layout()->setSpacing(0);
- m_timerBox->layout()->setMargin(0);
- m_timerBoxLayout = new TQVBoxLayout(m_timerBox->layout());
- m_timerBoxLayout->setAlignment(Qt::AlignTop);
+ m_timerBox->tqlayout()->setSpacing(0);
+ m_timerBox->tqlayout()->setMargin(0);
+ m_timerBoxLayout = new TQVBoxLayout(m_timerBox->tqlayout());
+ m_timerBoxLayout->tqsetAlignment(TQt::AlignTop);
m_timerBoxLayout->setSpacing(6);
m_timerBoxLayout->setMargin(11);
@@ -256,7 +256,7 @@ TQStringList NetDialog::createList() const
for (it = output.begin(); it != output.end(); ++it) {
list = TQStringList::split(' ', (*it));
(*it) = list[0].stripWhiteSpace();
- (*it).truncate((*it).find(':'));
+ (*it).truncate((*it).tqfind(':'));
}
return output;
diff --git a/ksim/monitors/net/netdialog.h b/ksim/monitors/net/netdialog.h
index 3f57b69..094e40a 100644
--- a/ksim/monitors/net/netdialog.h
+++ b/ksim/monitors/net/netdialog.h
@@ -32,11 +32,12 @@ class KComboBox;
class KLineEdit;
class KURLRequester;
-class NetDialog : public QTabDialog
+class NetDialog : public TQTabDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- NetDialog(TQWidget *parent, const char *name = 0);
+ NetDialog(TQWidget *tqparent, const char *name = 0);
~NetDialog();
const TQString deviceName() const;