diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
commit | 395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch) | |
tree | 9829cadb79d2cc7c29a940627fadb28b11e54150 /kicker-applets/ktimemon/timemon.cc | |
parent | 399f47c376fdf4d19192732a701ea9578d11619d (diff) | |
download | tdeaddons-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/timemon.cc')
-rw-r--r-- | kicker-applets/ktimemon/timemon.cc | 36 |
1 files changed, 18 insertions, 18 deletions
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; |