summaryrefslogtreecommitdiffstats
path: root/kicker-applets/ktimemon
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
commit395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch)
tree9829cadb79d2cc7c29a940627fadb28b11e54150 /kicker-applets/ktimemon
parent399f47c376fdf4d19192732a701ea9578d11619d (diff)
downloadtdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz
tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/ktimemon')
-rw-r--r--kicker-applets/ktimemon/confdlg.cc2
-rw-r--r--kicker-applets/ktimemon/confdlg.h1
-rw-r--r--kicker-applets/ktimemon/sample.cc36
-rw-r--r--kicker-applets/ktimemon/timemon.cc36
-rw-r--r--kicker-applets/ktimemon/timemon.h3
5 files changed, 40 insertions, 38 deletions
diff --git a/kicker-applets/ktimemon/confdlg.cc b/kicker-applets/ktimemon/confdlg.cc
index df3fffe..c694f5c 100644
--- a/kicker-applets/ktimemon/confdlg.cc
+++ b/kicker-applets/ktimemon/confdlg.cc
@@ -170,7 +170,7 @@ KConfDialog::KConfDialog(KTimeMon *t)
bl->addWidget(b);
bl->addStretch();
- TQVBoxLayout *vbox = new TQVBoxLayout( b->layout() );
+ TQVBoxLayout *vbox = new TQVBoxLayout( b->tqlayout() );
gl = new TQGridLayout(b, MAX_MOUSE_ACTIONS + 1, 3, 0, 6 );
diff --git a/kicker-applets/ktimemon/confdlg.h b/kicker-applets/ktimemon/confdlg.h
index a21c73c..d7451f3 100644
--- a/kicker-applets/ktimemon/confdlg.h
+++ b/kicker-applets/ktimemon/confdlg.h
@@ -48,6 +48,7 @@ class KConfDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
KConfDialog(KTimeMon *timemon);
diff --git a/kicker-applets/ktimemon/sample.cc b/kicker-applets/ktimemon/sample.cc
index 99ea20b..54d1edf 100644
--- a/kicker-applets/ktimemon/sample.cc
+++ b/kicker-applets/ktimemon/sample.cc
@@ -102,7 +102,7 @@ KSample::KSample(KTimeMon *t, bool a, unsigned p, unsigned s, unsigned c) :
KMessageBox::error(timemon,
i18n("Unable to open the file '%1'. The diagnostics are:\n%2.\n"
"This file is required to determine current memory usage.\n"
- "Maybe your proc filesystem is non-Linux standard?").arg(MEMINFO_NAME).arg(strerror(errno)));
+ "Maybe your proc filesystem is non-Linux standard?").tqarg(MEMINFO_NAME).tqarg(strerror(errno)));
exit(1);
}
@@ -112,7 +112,7 @@ KSample::KSample(KTimeMon *t, bool a, unsigned p, unsigned s, unsigned c) :
KMessageBox::error(timemon,
i18n("Unable to open the file '%1'. The diagnostics are:\n%2.\n"
"This file is required to determine current system info. "
- "Maybe your proc filesystem is non-Linux standard?").arg(MEMINFO_NAME).arg(strerror(errno)));
+ "Maybe your proc filesystem is non-Linux standard?").tqarg(MEMINFO_NAME).tqarg(strerror(errno)));
exit(1);
}
@@ -125,7 +125,7 @@ KSample::KSample(KTimeMon *t, bool a, unsigned p, unsigned s, unsigned c) :
"The diagnostics are:\n%1.\n"
"Are you really running Solaris? "
"Please contact the maintainer at [email protected] "
- "who will try to figure out what went wrong.").arg(strerror(errno)));
+ "who will try to figure out what went wrong.").tqarg(strerror(errno)));
exit(1);
}
#endif
@@ -210,7 +210,7 @@ void KSample::readSample()
if ((l = read(memFD, buffer, sizeof(buffer) - 1)) < 0)
{
fatal(i18n("Unable to read the memory usage file '%1'.\n"
- "The diagnostics are: %2").arg(MEMINFO_NAME).arg(strerror(errno)));
+ "The diagnostics are: %2").tqarg(MEMINFO_NAME).tqarg(strerror(errno)));
}
buffer[l] = '\0';
l = 0;
@@ -223,7 +223,7 @@ void KSample::readSample()
"different file format than expected.\n"
"Maybe your version of the proc filesystem is "
"incompatible with supported versions. "
- "Please contact the developer at http://bugs.kde.org/ who will try to sort this out.").arg(MEMINFO_NAME));
+ "Please contact the developer at http://bugs.kde.org/ who will try to sort this out.").tqarg(MEMINFO_NAME));
l++;
}
@@ -237,7 +237,7 @@ void KSample::readSample()
lseek(statFD, 0, 0);
if ((l = read(statFD, buffer, sizeof(buffer)-1)) < 0)
fatal(i18n("Unable to read the system usage file '%1'.\n"
- "The diagnostics are: %2").arg(STAT_NAME).arg(strerror(errno)));
+ "The diagnostics are: %2").tqarg(STAT_NAME).tqarg(strerror(errno)));
buffer[l] = '\0';
@@ -271,7 +271,7 @@ void KSample::readSample()
struct tbl_sysinfo sysinfo;
if (table(TBL_SYSINFO, 0, &sysinfo, 1, sizeof(sysinfo)) != 1)
- fatal(msg.arg("TBL_SYSINFO"));
+ fatal(msg.tqarg("TBL_SYSINFO"));
sample.user = sysinfo.si_user;
sample.nice = sysinfo.si_nice;
@@ -281,7 +281,7 @@ void KSample::readSample()
struct tbl_vmstats vmstats;
if (table(TBL_VMSTATS, 0, &vmstats, 1, sizeof(vmstats)) != 1)
- fatal(msg.arg("TBL_VMSTATS"));
+ fatal(msg.tqarg("TBL_VMSTATS"));
sample.mtotal = vmstats.free_count + vmstats.active_count +
vmstats.inactive_count + vmstats.wire_count;
@@ -291,7 +291,7 @@ void KSample::readSample()
struct tbl_swapinfo swapinfo;
if (table(TBL_SWAPINFO, -1, &swapinfo, 1, sizeof(swapinfo)) != 1)
- fatal(msg.arg("TBL_SWAPINFO"));
+ fatal(msg.tqarg("TBL_SWAPINFO"));
sample.stotal = swapinfo.size;
sample.sfree = swapinfo.free;
@@ -324,7 +324,7 @@ void KSample::readSample()
kstat_read(kc, ksp, &cstat) == -1) // and read into buffer
fatal(i18n("Unable to read the CPU statistics entry "
"from the 'kstat' library. The diagnostics are '%1'.\n"
- "Please contact the maintainer via http://bugs.kde.org/ who will try to sort this out.").arg(strerror(errno)));
+ "Please contact the maintainer via http://bugs.kde.org/ who will try to sort this out.").tqarg(strerror(errno)));
// fields are: idle user kernel iowait (no nice info?)
sample.user += cstat.cpu_sysinfo.cpu[1] / sample.cpus;
@@ -338,7 +338,7 @@ void KSample::readSample()
fatal(i18n("The number of CPUs appears to have changed at "
"very short notice, or the 'kstat' library returns "
"inconsistent results (%1 vs. %2 CPUs).\n"
- "Please contact the maintainer via http://bugs.kde.org/ who will try to sort this out.").arg(sample.cpus).arg(cpus));
+ "Please contact the maintainer via http://bugs.kde.org/ who will try to sort this out.").tqarg(sample.cpus).tqarg(cpus));
// availrmem = pages of core for user-proc ( == physmem - kernelmem)
// freemem = no of free pages
@@ -350,7 +350,7 @@ void KSample::readSample()
fatal(i18n("Unable to read the memory statistics entry "
"from the 'kstat' library. The diagnostics are '%1'\n"
"You might want to contact the maintainer at "
- "http://bugs.kde.org/ who will try to sort this out.").arg(strerror(errno)));
+ "http://bugs.kde.org/ who will try to sort this out.").tqarg(strerror(errno)));
int i;
unsigned long physmem = 0, freemem = 0, availrmem = 0;
@@ -367,7 +367,7 @@ void KSample::readSample()
fatal(i18n("There seems to be a problem with KTimeMon's handling "
"of the 'kstat' library: 0 bytes of physical memory determined!\n"
"Free memory is %1, available memory is %2.\n"
- "Please contact the maintainer at [email protected] who will try to sort this out.").arg(freemem).arg(availrmem));
+ "Please contact the maintainer at [email protected] who will try to sort this out.").tqarg(freemem).tqarg(availrmem));
sample.mtotal = physmem;
sample.free = freemem;
@@ -378,7 +378,7 @@ void KSample::readSample()
if ((swapentries = swapctl(SC_GETNSWP, 0)) == -1)
fatal(i18n("Unable to determine the number of "
"swap spaces. The diagnostics are '%1'.\n"
- "Please contact the maintainer at http://bugs.kde.org/ who will try to sort this out.").arg(strerror(errno)));
+ "Please contact the maintainer at http://bugs.kde.org/ who will try to sort this out.").tqarg(strerror(errno)));
if (swapentries != 0) {
// 2* to get some space for padding??
@@ -389,8 +389,8 @@ void KSample::readSample()
"trying to determine the swap usage.\n"
"Attempted to allocate %1 bytes of memory (2 * %2 + %3 * %4).\n"
"Please contact the maintainer at http://bugs.kde.org/ who will try to sort this out.")
- .arg(2 * sizeof(int) + swapentries * sizeof(struct swapent))
- .arg(sizeof(int)).arg(swapentries).arg(sizeof(struct swapent)));
+ .tqarg(2 * sizeof(int) + swapentries * sizeof(struct swapent))
+ .tqarg(sizeof(int)).tqarg(swapentries).tqarg(sizeof(struct swapent)));
char path[1024];
stbl->swt_n = swapentries;
@@ -399,7 +399,7 @@ void KSample::readSample()
if ((swapentries = swapctl(SC_LIST, stbl)) == -1)
fatal(i18n("Unable to determine the swap usage.\n"
"The diagnostics are '%1'.\n"
- "Please contact the maintainer at http://bugs.kde.org/ who will try to sort this out.").arg(strerror(errno)));
+ "Please contact the maintainer at http://bugs.kde.org/ who will try to sort this out.").tqarg(strerror(errno)));
if (!warned && swapentries != stbl->swt_n) {
@@ -407,7 +407,7 @@ void KSample::readSample()
nonfatal(i18n("Information was requested for "
"%1 swap spaces, but only %2 swap entries were returned.\n"
"KTimeMon will attempt to continue.\n"
- "Please contact the maintainer at http://bugs.kde.org/ who will try to sort this out.").arg(stbl->swt_n).arg(swapentries));
+ "Please contact the maintainer at http://bugs.kde.org/ who will try to sort this out.").tqarg(stbl->swt_n).tqarg(swapentries));
}
for (i = 0; i < swapentries; i++) {
diff --git a/kicker-applets/ktimemon/timemon.cc b/kicker-applets/ktimemon/timemon.cc
index 75164f4..4b791ff 100644
--- a/kicker-applets/ktimemon/timemon.cc
+++ b/kicker-applets/ktimemon/timemon.cc
@@ -35,11 +35,11 @@
extern "C"
{
- KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
+ KDE_EXPORT KPanelApplet* init(TQWidget *tqparent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("ktimemon");
KTimeMon *mon = new KTimeMon(configFile, KPanelApplet::Normal,
- KPanelApplet::Preferences, parent, "ktimemon");
+ KPanelApplet::Preferences, tqparent, "ktimemon");
return mon;
}
}
@@ -111,7 +111,7 @@ void KTimeMon::paintEvent(TQPaintEvent *)
b = r / 3; // bar width
r -= b;
- if (bgColour != colorGroup().background())
+ if (bgColour != tqcolorGroup().background())
{
paintRect(x, 0, b, h, bgColour, &painter);
}
@@ -125,7 +125,7 @@ void KTimeMon::paintEvent(TQPaintEvent *)
b = r / 2;
r -= b;
- if (bgColour != colorGroup().background())
+ if (bgColour != tqcolorGroup().background())
{
paintRect(x, 0, b, h, bgColour, &painter);
}
@@ -138,7 +138,7 @@ void KTimeMon::paintEvent(TQPaintEvent *)
x += b;
b = r;
- if (bgColour != colorGroup().background())
+ if (bgColour != tqcolorGroup().background())
{
paintRect(x, 0, b, h, bgColour, &painter);
}
@@ -164,18 +164,18 @@ void KTimeMon::paintRect(int x, int y, int w, int h, TQColor c, TQPainter *p)
void KTimeMon::maybeTip(const TQPoint& p)
{
if (sample == 0) return; // no associated sample...
- if(!rect().contains(p)) return;
+ if(!TQT_TQRECT_OBJECT(rect()).tqcontains(p)) return;
KSample::Sample s = sample->getSample(100); // scale to 100(%)
int idle = 100 - s.kernel - s.user - s.nice;
if ( idle < 0 )
idle = 0;
TQString str = i18n("cpu: %1% idle\nmem: %2 MB %3% free\nswap: %4 MB %5% free")
- .arg(idle)
- .arg(KGlobal::locale()->formatNumber(s.used/100.*s.mtotal, 0))
- .arg(100-s.used)
- .arg(KGlobal::locale()->formatNumber(s.stotal, 0))
- .arg(100-s.sused);
+ .tqarg(idle)
+ .tqarg(KGlobal::locale()->formatNumber(s.used/100.*s.mtotal, 0))
+ .tqarg(100-s.used)
+ .tqarg(KGlobal::locale()->formatNumber(s.stotal, 0))
+ .tqarg(100-s.sused);
tip(rect(), str);
}
@@ -185,14 +185,14 @@ void KTimeMon::maybeTip(const TQPoint& p)
// Initialise the member variables, read the configuration data base,
// set up the widget, and start the timer.
KTimeMon::KTimeMon(const TQString& configFile, Type type, int actions,
- TQWidget *parent, const char *name)
- : KPanelApplet(configFile, type, actions, parent, name, WRepaintNoErase), TQToolTip(this),
+ TQWidget *tqparent, const char *name)
+ : KPanelApplet(configFile, type, actions, tqparent, name, WRepaintNoErase), TQToolTip(this),
configDialog(0), bgProcess(0),
kernelColour("red1"), userColour("blue"),
niceColour("yellow"), iowaitColour("darkgreen"),
usedColour("blue1"), buffersColour("yellow"),
cachedColour("darkgreen"), mkernelColour("red1"),
- swapColour("cyan3"), bgColour(colorGroup().background())
+ swapColour("cyan3"), bgColour(tqcolorGroup().background())
{
mouseAction[0] = NOTHING;
mouseAction[1] = NOTHING;
@@ -337,7 +337,7 @@ void KTimeMon::writeConfiguration()
conf->sync();
}
-// Make the KSample object update its internal sample and repaint the
+// Make the KSample object update its internal sample and tqrepaint the
// object.
void KTimeMon::timeout()
{
@@ -385,9 +385,9 @@ void KTimeMon::mousePressEvent(TQMouseEvent *event)
if (event == 0) return;
int index = -1;
- if (event->button() == LeftButton) index = 0;
- else if (event->button() == MidButton) index = 1;
- else if (event->button() == RightButton) index = 2;
+ if (event->button() == Qt::LeftButton) index = 0;
+ else if (event->button() == Qt::MidButton) index = 1;
+ else if (event->button() == Qt::RightButton) index = 2;
if (index == -1) return;
diff --git a/kicker-applets/ktimemon/timemon.h b/kicker-applets/ktimemon/timemon.h
index 1f81db1..12fc6ba 100644
--- a/kicker-applets/ktimemon/timemon.h
+++ b/kicker-applets/ktimemon/timemon.h
@@ -46,11 +46,12 @@ class KPopupMenu;
class KTimeMon : public KPanelApplet, TQToolTip {
Q_OBJECT
+ TQ_OBJECT
public:
enum MouseAction { NOTHING, SWITCH, MENU, COMMAND };
KTimeMon(const TQString& configFile, Type t = Normal, int actions = 0,
- TQWidget *parent = 0, const char *name = 0);
+ TQWidget *tqparent = 0, const char *name = 0);
virtual ~KTimeMon();
void writeConfiguration(); // write back the configuration data