summaryrefslogtreecommitdiffstats
path: root/ksim/ksimsysinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksim/ksimsysinfo.cpp')
-rw-r--r--ksim/ksimsysinfo.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/ksim/ksimsysinfo.cpp b/ksim/ksimsysinfo.cpp
index 724adb6..7140e3a 100644
--- a/ksim/ksimsysinfo.cpp
+++ b/ksim/ksimsysinfo.cpp
@@ -17,12 +17,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qtooltip.h>
-#include <qlayout.h>
-#include <qtimer.h>
-#include <qregexp.h>
-#include <qtextstream.h>
-#include <qdatetime.h>
+#include <tqtooltip.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
+#include <tqdatetime.h>
#include <kdebug.h>
#include <klocale.h>
@@ -41,11 +41,11 @@
#include <string.h>
KSim::Sysinfo::Sysinfo(KSim::Config *config,
- QWidget *parent, const char *name, WFlags fl)
- : DCOPObject("sysinfo"), QWidget(parent, name, fl)
+ TQWidget *parent, const char *name, WFlags fl)
+ : DCOPObject("sysinfo"), TQWidget(parent, name, fl)
{
m_config = config;
- m_layout = new QVBoxLayout(this);
+ m_layout = new TQVBoxLayout(this);
m_timeLabel = 0L;
m_dateLabel = 0L;
@@ -54,11 +54,11 @@ KSim::Sysinfo::Sysinfo(KSim::Config *config,
m_swapLabel = 0L;
//m_procsLabel = 0L;
- m_timer = new QTimer(this);
- connect(m_timer, SIGNAL(timeout()), SLOT(clockUptimeUpdate()));
+ m_timer = new TQTimer(this);
+ connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(clockUptimeUpdate()));
- m_sysTimer = new QTimer(this);
- connect(m_sysTimer, SIGNAL(timeout()), SLOT(sysUpdate()));
+ m_sysTimer = new TQTimer(this);
+ connect(m_sysTimer, TQT_SIGNAL(timeout()), TQT_SLOT(sysUpdate()));
createView();
}
@@ -71,13 +71,13 @@ KSim::Sysinfo::~Sysinfo()
void KSim::Sysinfo::clockUptimeUpdate()
{
- QString time;
+ TQString time;
static bool updateDate = true;
if (m_timeLabel) {
- QTime now = QTime::currentTime();
+ TQTime now = TQTime::currentTime();
time = KGlobal::locale()->formatTime(now, true);
- if ( now == QTime(0, 0) )
+ if ( now == TQTime(0, 0) )
updateDate = true;
m_timeLabel->setText(time);
@@ -86,7 +86,7 @@ void KSim::Sysinfo::clockUptimeUpdate()
// only update the date when necessary
if (m_dateLabel) {
if (updateDate) {
- m_dateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate()));
+ m_dateLabel->setText(KGlobal::locale()->formatDate(TQDate::currentDate()));
updateDate = false;
}
}
@@ -95,7 +95,7 @@ void KSim::Sysinfo::clockUptimeUpdate()
}
if (m_uptimeLabel) {
- QString uptime = m_config->uptimeFormat();
+ TQString uptime = m_config->uptimeFormat();
++m_totalUptime;
long uptimeDays, uptimeHours, uptimeMins, uptimeSecs;
@@ -104,13 +104,13 @@ void KSim::Sysinfo::clockUptimeUpdate()
uptimeMins = (m_totalUptime - uptimeHours * 3600) / 60;
uptimeSecs = m_totalUptime % 60;
- QString days;
- QString hours;
- QString minutes;
- QString seconds;
+ TQString days;
+ TQString hours;
+ TQString minutes;
+ TQString seconds;
// found days so we have to modify hours
- if (uptime.find(QRegExp("%d" ), 0) >= 0)
+ if (uptime.find(TQRegExp("%d" ), 0) >= 0)
uptimeHours -= (uptimeDays * 24);
days.sprintf("%02li", uptimeDays);
@@ -118,10 +118,10 @@ void KSim::Sysinfo::clockUptimeUpdate()
minutes.sprintf("%02li", uptimeMins);
seconds.sprintf("%02li", uptimeSecs);
- uptime.replace(QRegExp("%d"), days);
- uptime.replace(QRegExp("%h"), hours);
- uptime.replace(QRegExp("%m"), minutes);
- uptime.replace(QRegExp("%s"), seconds);
+ uptime.replace(TQRegExp("%d"), days);
+ uptime.replace(TQRegExp("%h"), hours);
+ uptime.replace(TQRegExp("%m"), minutes);
+ uptime.replace(TQRegExp("%s"), seconds);
m_uptimeLabel->setText(uptime);
}
}
@@ -132,7 +132,7 @@ void KSim::Sysinfo::sysUpdate()
m_totalUptime = system.uptime();
if (m_memLabel) {
- QString memory = m_config->memoryFormat();
+ TQString memory = m_config->memoryFormat();
unsigned long total = system.totalRam();
unsigned long free = system.freeRam();
unsigned long shared = system.sharedRam();
@@ -142,16 +142,16 @@ void KSim::Sysinfo::sysUpdate()
unsigned long allFree = free + buffer + cache;
bool all = memory.find( "%F" ) != -1;
- memory.replace(QRegExp("%s"), QString::number(System::bytesToMegs(shared)));
- memory.replace(QRegExp("%b"), QString::number(System::bytesToMegs(buffer)));
- memory.replace(QRegExp("%c"), QString::number(System::bytesToMegs(cache)));
- memory.replace(QRegExp("%u"), QString::number(System::bytesToMegs(used)));
- memory.replace(QRegExp("%t"), QString::number(System::bytesToMegs(total)));
- memory.replace(QRegExp("%f"), QString::number(System::bytesToMegs(free)));
- memory.replace(QRegExp("%F"), QString::number(System::bytesToMegs(allFree)));
+ memory.replace(TQRegExp("%s"), TQString::number(System::bytesToMegs(shared)));
+ memory.replace(TQRegExp("%b"), TQString::number(System::bytesToMegs(buffer)));
+ memory.replace(TQRegExp("%c"), TQString::number(System::bytesToMegs(cache)));
+ memory.replace(TQRegExp("%u"), TQString::number(System::bytesToMegs(used)));
+ memory.replace(TQRegExp("%t"), TQString::number(System::bytesToMegs(total)));
+ memory.replace(TQRegExp("%f"), TQString::number(System::bytesToMegs(free)));
+ memory.replace(TQRegExp("%F"), TQString::number(System::bytesToMegs(allFree)));
kdDebug(2003) << memory << endl;
m_memLabel->setText("Memory");
- QToolTip::add(m_memLabel, memory );
+ TQToolTip::add(m_memLabel, memory );
if ( !all )
m_memLabel->setValue( System::bytesToMegs( total ) - System::bytesToMegs( free ) );
@@ -160,15 +160,15 @@ void KSim::Sysinfo::sysUpdate()
}
if (m_swapLabel) {
- QString swap = m_config->swapFormat();
+ TQString swap = m_config->swapFormat();
unsigned long total = system.totalSwap();
unsigned long free = system.freeSwap();
unsigned long swapUsed = system.usedSwap();
- swap.replace(QRegExp("%u"), QString::number(System::bytesToMegs(swapUsed)));
- swap.replace(QRegExp("%t"), QString::number(System::bytesToMegs(total)));
- swap.replace(QRegExp("%f"), QString::number(System::bytesToMegs(free)));
+ swap.replace(TQRegExp("%u"), TQString::number(System::bytesToMegs(swapUsed)));
+ swap.replace(TQRegExp("%t"), TQString::number(System::bytesToMegs(total)));
+ swap.replace(TQRegExp("%f"), TQString::number(System::bytesToMegs(free)));
m_swapLabel->setText("Swap");
- QToolTip::add(m_swapLabel, swap);
+ TQToolTip::add(m_swapLabel, swap);
m_swapLabel->setValue(System::bytesToMegs(total) - System::bytesToMegs(free));
}
@@ -194,7 +194,7 @@ void KSim::Sysinfo::createView()
m_timeLabel = new KSim::Label(this);
m_layout->insertWidget(timeLocation - offset, m_timeLabel);
}
- QToolTip::add(m_timeLabel, i18n("Current system time"));
+ TQToolTip::add(m_timeLabel, i18n("Current system time"));
m_timeLabel->show();
}
else {
@@ -208,7 +208,7 @@ void KSim::Sysinfo::createView()
m_dateLabel = new KSim::Label(this);
m_layout->insertWidget(dateLocation - offset, m_dateLabel);
}
- QToolTip::add(m_dateLabel, i18n("Current system date"));
+ TQToolTip::add(m_dateLabel, i18n("Current system date"));
m_dateLabel->show();
}
else {
@@ -224,7 +224,7 @@ void KSim::Sysinfo::createView()
m_uptimeLabel = new KSim::Label(KSim::Types::Uptime, this);
m_layout->insertWidget(uptimeLocation - offset, m_uptimeLabel);
}
- QToolTip::add(m_uptimeLabel, i18n("System uptime"));
+ TQToolTip::add(m_uptimeLabel, i18n("System uptime"));
m_uptimeLabel->show();
}
else {
@@ -300,7 +300,7 @@ void KSim::Sysinfo::startTimers()
}
}
-QString KSim::Sysinfo::uptime() const
+TQString KSim::Sysinfo::uptime() const
{
if (m_uptimeLabel)
return m_uptimeLabel->text();
@@ -308,7 +308,7 @@ QString KSim::Sysinfo::uptime() const
return i18n("Uptime display disabled");
}
-QString KSim::Sysinfo::memInfo() const
+TQString KSim::Sysinfo::memInfo() const
{
if (m_memLabel)
return m_memLabel->text();
@@ -316,7 +316,7 @@ QString KSim::Sysinfo::memInfo() const
return i18n("Memory display disabled");
}
-QString KSim::Sysinfo::swapInfo() const
+TQString KSim::Sysinfo::swapInfo() const
{
if (m_swapLabel)
return m_swapLabel->text();