summaryrefslogtreecommitdiffstats
path: root/ksim/monitors
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit6335dc55802871b5a43492f217b6edbb420204c4 (patch)
tree50c6c8672a52687568edea475614dfe3d98e62e5 /ksim/monitors
parent9b8c9f1f9e974ff0176108cfbd8852cd99ea68c8 (diff)
downloadtdeutils-6335dc55802871b5a43492f217b6edbb420204c4.tar.gz
tdeutils-6335dc55802871b5a43492f217b6edbb420204c4.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksim/monitors')
-rw-r--r--ksim/monitors/cpu/ksimcpu.cpp14
-rw-r--r--ksim/monitors/disk/ksimdisk.cpp8
-rw-r--r--ksim/monitors/filesystem/filesystemwidget.cpp2
-rw-r--r--ksim/monitors/filesystem/fsystemconfig.cpp8
-rw-r--r--ksim/monitors/lm_sensors/sensorbase.cpp10
-rw-r--r--ksim/monitors/lm_sensors/sensorsconfig.cpp2
-rw-r--r--ksim/monitors/net/ksimnet.cpp10
-rw-r--r--ksim/monitors/net/netdialog.cpp2
-rw-r--r--ksim/monitors/snmp/browsedialog.cpp2
-rw-r--r--ksim/monitors/snmp/configpage.cpp8
-rw-r--r--ksim/monitors/snmp/hostdialog.cpp8
-rw-r--r--ksim/monitors/snmp/labelmonitor.cpp4
-rw-r--r--ksim/monitors/snmp/monitorconfig.cpp2
-rw-r--r--ksim/monitors/snmp/monitordialog.cpp6
-rw-r--r--ksim/monitors/snmp/session.cpp2
15 files changed, 44 insertions, 44 deletions
diff --git a/ksim/monitors/cpu/ksimcpu.cpp b/ksim/monitors/cpu/ksimcpu.cpp
index 37c09f7..9cb570a 100644
--- a/ksim/monitors/cpu/ksimcpu.cpp
+++ b/ksim/monitors/cpu/ksimcpu.cpp
@@ -181,15 +181,15 @@ void CpuView::updateView()
// kdDebug(2003) << "idle = " << cpuData.idle << endl;
if (!m_firstTime) {
- if (text.tqfind("%T") != -1)
+ if (text.find("%T") != -1)
cpuDiff = cpuData.sys + cpuData.user + cpuData.nice;
- else if (text.tqfind("%t") != -1)
+ else if (text.find("%t") != -1)
cpuDiff = cpuData.sys + cpuData.user;
- else if (text.tqfind("%s") != -1)
+ else if (text.find("%s") != -1)
cpuDiff = cpuData.sys;
- else if (text.tqfind("%u") != -1)
+ else if (text.find("%u") != -1)
cpuDiff = cpuData.user;
- else if (text.tqfind("%n") != -1)
+ else if (text.find("%n") != -1)
cpuDiff = cpuData.nice;
cpuDiff *= 100;
@@ -225,7 +225,7 @@ void CpuView::updateCpu(CpuData &cpu, int cpuNumber)
while (!m_procStream->atEnd()) {
parser = m_procStream->readLine();
// remove all the entries apart from the line containing 'cpuString'
- if (!cpuFound && parser.tqfind(TQRegExp(cpuString)) != -1) {
+ if (!cpuFound && parser.find(TQRegExp(cpuString)) != -1) {
output = parser;
cpuFound = true;
}
@@ -438,7 +438,7 @@ void CpuConfig::readConfig()
TQStringList::ConstIterator it;
for (it = enabledCpus.begin(); it != enabledCpus.end(); ++it) {
if (TQCheckListItem *item =
- static_cast<TQCheckListItem *>(m_listView->tqfindItem((*it), 0))) {
+ static_cast<TQCheckListItem *>(m_listView->findItem((*it), 0))) {
item->setOn(true);
item->setText(1, config()->readEntry(CPU_NAME(cpuNum), "%T"));
}
diff --git a/ksim/monitors/disk/ksimdisk.cpp b/ksim/monitors/disk/ksimdisk.cpp
index cdcae83..2365e19 100644
--- a/ksim/monitors/disk/ksimdisk.cpp
+++ b/ksim/monitors/disk/ksimdisk.cpp
@@ -248,7 +248,7 @@ void DiskView::updateData(DiskList &disks)
// (3,0):(108911,48080,1713380,60831,1102644)
TQRegExp regexp("\\([0-9]+,[0-9]+\\):\\([0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+\\)");
TQString content = m_procStream->read();
- if (content.tqfind("disk_io") == -1)
+ if (content.find("disk_io") == -1)
{
m_bLinux24 = false;
@@ -267,8 +267,8 @@ void DiskView::updateData(DiskList &disks)
{
idx += regexp.matchedLength();
TQString diskStr = regexp.cap(0);
- diskStr.tqreplace(':', ',');
- diskStr.tqreplace(TQRegExp("\\)?\\(?"), TQString());
+ diskStr.replace(':', ',');
+ diskStr.replace(TQRegExp("\\)?\\(?"), TQString());
TQStringList list = TQStringList::split(',', diskStr);
if (list.count() < 7)
@@ -527,7 +527,7 @@ void DiskConfig::readConfig()
TQStringList::ConstIterator it;
for (it = list.begin(); it != list.end(); ++it) {
TQString text = ((*it) == "complete" ? i18n("All Disks") : (*it));
- if (!m_listview->tqfindItem(text, 0))
+ if (!m_listview->findItem(text, 0))
new TQListViewItem(m_listview, text);
}
}
diff --git a/ksim/monitors/filesystem/filesystemwidget.cpp b/ksim/monitors/filesystem/filesystemwidget.cpp
index fb3b3ed..4149aee 100644
--- a/ksim/monitors/filesystem/filesystemwidget.cpp
+++ b/ksim/monitors/filesystem/filesystemwidget.cpp
@@ -189,7 +189,7 @@ void FilesystemWidget::processExited(KProcess *)
TQStringList::Iterator it;
for (it = errorList.begin(); it != errorList.end(); ++it) {
message += TQString::tqfromLatin1("<li>%1</li>")
- .tqarg((*it).tqreplace(TQRegExp("[u]?mount: "), TQString()));
+ .tqarg((*it).replace(TQRegExp("[u]?mount: "), TQString()));
}
message += TQString::tqfromLatin1("</ul></qt>");
diff --git a/ksim/monitors/filesystem/fsystemconfig.cpp b/ksim/monitors/filesystem/fsystemconfig.cpp
index a91eae0..937d2cc 100644
--- a/ksim/monitors/filesystem/fsystemconfig.cpp
+++ b/ksim/monitors/filesystem/fsystemconfig.cpp
@@ -107,7 +107,7 @@ void FsystemConfig::readConfig()
TQStringList list = config()->readListEntry("mountEntries");
for (TQListViewItemIterator it(m_availableMounts); it.current(); ++it) {
TQString string = it.current()->text(0) + ":" + splitString(it.current()->text(0));
- static_cast<TQCheckListItem *>(it.current())->setOn(list.tqcontains(string) > 0);
+ static_cast<TQCheckListItem *>(it.current())->setOn(list.contains(string) > 0);
}
}
@@ -155,7 +155,7 @@ void FsystemConfig::getStats()
if ( !FilesystemStats::readStats( ( *it ).dir, total, free ) )
continue;
- if ( !m_availableMounts->tqfindItem( ( *it ).dir, 0 ) )
+ if ( !m_availableMounts->findItem( ( *it ).dir, 0 ) )
{
(void) new FSysViewItem( m_availableMounts, ( *it ).dir,
( *it ).fsname, ( *it ).type );
@@ -169,7 +169,7 @@ void FsystemConfig::getStats()
TQStringList list = config()->readListEntry("mountEntries");
for (TQListViewItemIterator it(m_availableMounts); it.current(); ++it) {
TQString string = it.current()->text(0) + ":" + splitString(it.current()->text(0));
- static_cast<TQCheckListItem *>(it.current())->setOn(list.tqcontains(string) > 0);
+ static_cast<TQCheckListItem *>(it.current())->setOn(list.contains(string) > 0);
}
}
@@ -178,7 +178,7 @@ TQString FsystemConfig::splitString(const TQString &string) const
if (string == "/" || !m_splitNames->isChecked())
return string;
- int location = string.tqfindRev("/");
+ int location = string.findRev("/");
TQString newString(string);
return newString.remove(0, location + 1);
}
diff --git a/ksim/monitors/lm_sensors/sensorbase.cpp b/ksim/monitors/lm_sensors/sensorbase.cpp
index de94a1b..cabbf5a 100644
--- a/ksim/monitors/lm_sensors/sensorbase.cpp
+++ b/ksim/monitors/lm_sensors/sensorbase.cpp
@@ -212,16 +212,16 @@ bool SensorBase::init()
TQString SensorBase::sensorType(const TQString &name)
{
- if (name.tqfindRev("fan", -1, false) != -1)
+ if (name.findRev("fan", -1, false) != -1)
return i18n("Rounds per minute", " RPM");
- if (name.tqfindRev("temp", -1, false) != -1)
+ if (name.findRev("temp", -1, false) != -1)
if (SensorBase::fahrenheit())
return TQString::tqfromLatin1("°F");
else
return TQString::tqfromLatin1("°C");
- if (name.tqfindRev(TQRegExp("[^\\+]?[^\\-]?V$")) != -1)
+ if (name.findRev(TQRegExp("[^\\+]?[^\\-]?V$")) != -1)
return i18n("Volt", "V");
return TQString();
@@ -239,7 +239,7 @@ TQString SensorBase::chipsetString(const ChipName *c)
float SensorBase::formatValue(const TQString &label, float value)
{
- if (label.tqfindRev("temp", -1, false) != -1)
+ if (label.findRev("temp", -1, false) != -1)
return toFahrenheit(value);
return value;
@@ -247,7 +247,7 @@ float SensorBase::formatValue(const TQString &label, float value)
TQString SensorBase::formatString(const TQString &label, float value)
{
- if (label.tqfindRev("fan", -1, false) != -1)
+ if (label.findRev("fan", -1, false) != -1)
return TQString::number(value);
return TQString::number(value,'f',2);
diff --git a/ksim/monitors/lm_sensors/sensorsconfig.cpp b/ksim/monitors/lm_sensors/sensorsconfig.cpp
index e5f3b6a..8b1ff46 100644
--- a/ksim/monitors/lm_sensors/sensorsconfig.cpp
+++ b/ksim/monitors/lm_sensors/sensorsconfig.cpp
@@ -233,7 +233,7 @@ void SensorsConfig::showEvent(TQShowEvent *)
const SensorList &list = SensorBase::self()->sensorsList();
SensorList::ConstIterator it;
for (it = list.begin(); it != list.end(); ++it) {
- TQListViewItem *item = m_sensorView->tqfindItem((*it).sensorName(), 1);
+ TQListViewItem *item = m_sensorView->findItem((*it).sensorName(), 1);
if (item)
item->setText(3, (*it).sensorValue() + (*it).sensorUnit());
}
diff --git a/ksim/monitors/net/ksimnet.cpp b/ksim/monitors/net/ksimnet.cpp
index 0c16f2d..daaeb90 100644
--- a/ksim/monitors/net/ksimnet.cpp
+++ b/ksim/monitors/net/ksimnet.cpp
@@ -371,8 +371,8 @@ void NetView::updateGraph()
}
// Keep backwards compat for now
- if ( timeDisplay.tqcontains( '%' ) > 0 )
- timeDisplay.tqreplace( '%', "" );
+ if ( timeDisplay.contains( '%' ) > 0 )
+ timeDisplay.replace( '%', "" );
( *it ).label()->setText( netTime.toString( timeDisplay ) );
}
@@ -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.tqfind(device) != -1)
+ if (parser.find(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.tqreplace(TQRegExp(":"), " ");
+ output.replace(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().tqfind(device) != -1 ? true : false);
+ return (TQTextStream(&file).read().find(device) != -1 ? true : false);
#endif
#ifdef __FreeBSD__
diff --git a/ksim/monitors/net/netdialog.cpp b/ksim/monitors/net/netdialog.cpp
index 3513bf4..d79f06f 100644
--- a/ksim/monitors/net/netdialog.cpp
+++ b/ksim/monitors/net/netdialog.cpp
@@ -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).tqfind(':'));
+ (*it).truncate((*it).find(':'));
}
return output;
diff --git a/ksim/monitors/snmp/browsedialog.cpp b/ksim/monitors/snmp/browsedialog.cpp
index 3b571ef..75f2dac 100644
--- a/ksim/monitors/snmp/browsedialog.cpp
+++ b/ksim/monitors/snmp/browsedialog.cpp
@@ -134,7 +134,7 @@ void BrowseDialog::applyFilter( TQListViewItem *item )
return;
}
- if ( item->text( 0 ).tqfind( filterText, 0 /*index*/, false /*case sensitive*/ ) == -1 ) {
+ if ( item->text( 0 ).find( filterText, 0 /*index*/, false /*case sensitive*/ ) == -1 ) {
item->setVisible( false );
return;
}
diff --git a/ksim/monitors/snmp/configpage.cpp b/ksim/monitors/snmp/configpage.cpp
index ede7a52..f5c1d24 100644
--- a/ksim/monitors/snmp/configpage.cpp
+++ b/ksim/monitors/snmp/configpage.cpp
@@ -123,7 +123,7 @@ void ConfigPage::modifyHost()
if ( !currentItem )
return;
- HostConfigMap::Iterator hostIt = m_hosts.tqfind( currentItem->text( 0 ) );
+ HostConfigMap::Iterator hostIt = m_hosts.find( currentItem->text( 0 ) );
if ( hostIt == m_hosts.end() )
return;
@@ -147,7 +147,7 @@ void ConfigPage::removeHost()
if ( !currentItem )
return;
- HostConfigMap::Iterator hostIt = m_hosts.tqfind( currentItem->text( 0 ) );
+ HostConfigMap::Iterator hostIt = m_hosts.find( currentItem->text( 0 ) );
if ( hostIt == m_hosts.end() )
return;
@@ -191,7 +191,7 @@ void ConfigPage::modifyMonitor()
if ( !currentItem )
return;
- MonitorConfigMap::Iterator monitorIt = m_monitors.tqfind( currentItem->text( 0 ) );
+ MonitorConfigMap::Iterator monitorIt = m_monitors.find( currentItem->text( 0 ) );
if ( monitorIt == m_monitors.end() )
return;
@@ -215,7 +215,7 @@ void ConfigPage::removeMonitor()
if ( !currentItem )
return;
- MonitorConfigMap::Iterator monitorIt = m_monitors.tqfind( currentItem->text( 0 ) );
+ MonitorConfigMap::Iterator monitorIt = m_monitors.find( currentItem->text( 0 ) );
if ( monitorIt == m_monitors.end() )
return;
diff --git a/ksim/monitors/snmp/hostdialog.cpp b/ksim/monitors/snmp/hostdialog.cpp
index e8eceab..2ea7314 100644
--- a/ksim/monitors/snmp/hostdialog.cpp
+++ b/ksim/monitors/snmp/hostdialog.cpp
@@ -163,7 +163,7 @@ void HostDialog::loadSettingsFromHostConfig( const HostConfig &src )
hostName->setText( src.name );
port->setValue( src.port );
- snmpVersion->setCurrentItem( allSnmpVersions().tqfindIndex( snmpVersionToString( src.version ) ) );
+ snmpVersion->setCurrentItem( allSnmpVersions().findIndex( snmpVersionToString( src.version ) ) );
if ( src.version != SnmpVersion3 ) {
communityString->setText( src.community );
@@ -172,18 +172,18 @@ void HostDialog::loadSettingsFromHostConfig( const HostConfig &src )
securityName->setText( src.securityName );
- securityLevel->setCurrentItem( allSecurityLevels().tqfindIndex( securityLevelToString( src.securityLevel ) ) );
+ securityLevel->setCurrentItem( allSecurityLevels().findIndex( securityLevelToString( src.securityLevel ) ) );
if ( src.securityLevel == NoAuthPriv )
return;
- authenticationType->setCurrentItem( allAuthenticationProtocols().tqfindIndex( authenticationProtocolToString( src.authentication.protocol ) ) );
+ authenticationType->setCurrentItem( allAuthenticationProtocols().findIndex( authenticationProtocolToString( src.authentication.protocol ) ) );
authenticationPassphrase->setText( src.authentication.key );
if ( src.securityLevel == AuthNoPriv )
return;
- privacyType->setCurrentItem( allPrivacyProtocols().tqfindIndex( privacyProtocolToString( src.privacy.protocol ) ) );
+ privacyType->setCurrentItem( allPrivacyProtocols().findIndex( privacyProtocolToString( src.privacy.protocol ) ) );
privacyPassphrase->setText( src.privacy.key );
}
diff --git a/ksim/monitors/snmp/labelmonitor.cpp b/ksim/monitors/snmp/labelmonitor.cpp
index e8ae261..5e7ea34 100644
--- a/ksim/monitors/snmp/labelmonitor.cpp
+++ b/ksim/monitors/snmp/labelmonitor.cpp
@@ -32,8 +32,8 @@ void LabelMonitor::setData( const Value &data )
if ( m_config.useCustomFormatString ) {
TQString text = m_config.customFormatString;
- text.tqreplace( "%n", m_config.name );
- text.tqreplace( "%s", dataString );
+ text.replace( "%n", m_config.name );
+ text.replace( "%s", dataString );
setText( text );
} else
setText( m_config.name + ": " + dataString );
diff --git a/ksim/monitors/snmp/monitorconfig.cpp b/ksim/monitors/snmp/monitorconfig.cpp
index 6a77813..b8cd756 100644
--- a/ksim/monitors/snmp/monitorconfig.cpp
+++ b/ksim/monitors/snmp/monitorconfig.cpp
@@ -39,7 +39,7 @@ bool MonitorConfig::load( KConfigBase &config, const HostConfigMap &hosts )
if ( hostName.isEmpty() )
return false;
- HostConfigMap::ConstIterator hostIt = hosts.tqfind( hostName );
+ HostConfigMap::ConstIterator hostIt = hosts.find( hostName );
if ( hostIt == hosts.end() )
return false;
diff --git a/ksim/monitors/snmp/monitordialog.cpp b/ksim/monitors/snmp/monitordialog.cpp
index 297a818..574f244 100644
--- a/ksim/monitors/snmp/monitordialog.cpp
+++ b/ksim/monitors/snmp/monitordialog.cpp
@@ -144,14 +144,14 @@ void MonitorDialog::init( const MonitorConfig &monitor )
assert( allHosts.findIndex( monitor.host.name ) != -1 );
- host->setCurrentItem( allHosts.tqfindIndex( monitor.host.name ) );
+ host->setCurrentItem( allHosts.findIndex( monitor.host.name ) );
oid->setText( monitor.oid );
updateIntervalMinutes->setValue( monitor.refreshInterval.minutes );
updateIntervalSeconds->setValue( monitor.refreshInterval.seconds );
- displayType->setCurrentItem( allDisplayTypes().tqfindIndex( monitorDisplayTypeToString( monitor.display ) ) );
+ displayType->setCurrentItem( allDisplayTypes().findIndex( monitorDisplayTypeToString( monitor.display ) ) );
customFormatStringCheckBox->setChecked( monitor.useCustomFormatString );
customFormatString->setEnabled( monitor.useCustomFormatString );
@@ -166,7 +166,7 @@ void MonitorDialog::init( const MonitorConfig &monitor )
HostConfig MonitorDialog::currentHost() const
{
- HostConfigMap::ConstIterator hostIt = m_hosts.tqfind( host->currentText() );
+ HostConfigMap::ConstIterator hostIt = m_hosts.find( host->currentText() );
if ( hostIt == m_hosts.end() )
return HostConfig();
diff --git a/ksim/monitors/snmp/session.cpp b/ksim/monitors/snmp/session.cpp
index 07dc77e..2f16adc 100644
--- a/ksim/monitors/snmp/session.cpp
+++ b/ksim/monitors/snmp/session.cpp
@@ -235,7 +235,7 @@ bool Session::snmpGet( const Identifier &identifier, Value &value, ErrorInfo *er
if ( !snmpGet( ids, vars, error ) )
return false;
- ValueMap::ConstIterator it = vars.tqfind( identifier );
+ ValueMap::ConstIterator it = vars.find( identifier );
if ( it == vars.end() ) {
if ( error )
*error = ErrorInfo( ErrorInfo::ErrMissingVariables );