summaryrefslogtreecommitdiff
path: root/core/launcher/launcherview.cpp
authorsandman <sandman>2002-09-30 10:12:36 (UTC)
committer sandman <sandman>2002-09-30 10:12:36 (UTC)
commitece83520d6bf5c481275a3d4a8e792749119fa08 (patch) (side-by-side diff)
treeeb1c8bfdc013a3aca46c4feaa2ff50e38e5d632b /core/launcher/launcherview.cpp
parenta999acbcd1b8bc1715f2ad2dda6acedf423b89ea (diff)
downloadopie-ece83520d6bf5c481275a3d4a8e792749119fa08.zip
opie-ece83520d6bf5c481275a3d4a8e792749119fa08.tar.gz
opie-ece83520d6bf5c481275a3d4a8e792749119fa08.tar.bz2
Optimizations for the new busy indicator:
- QPixmaps are buffered now - real fix for the startTimer 100% cpu-load bug (was a typo)
Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index dbcb0d7..5daaeff 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -85,3 +85,3 @@ public:
- QPixmap* busyPixmap() const { return (QPixmap*)&bpm; }
+ QPixmap* busyPixmap() const { return (QPixmap*)&bpm[::abs(busystate)]; }
QIconViewItem* busyItem() const { return bsy; }
@@ -105,7 +105,7 @@ public:
if ( bsy ) {
+ busystate = 5;
+ for ( int i = 0; i <= 5; i++ )
+ bpm [i] = QPixmap ( );
+ timerEvent ( 0 );
busytimer = startTimer ( 150 );
- busystate = 50;
- // not sure what this startTimer is for, maybe i am just to tired. But
- // currently that causes 100% cpuload on app launch
- //startTimer ( 0 );
}
@@ -120,2 +120,3 @@ public:
if ( bsy ) {
+ if ( bpm [::abs(busystate)]. isNull ( )) {
QPixmap *src = bsy-> QIconViewItem::pixmap();
@@ -132,3 +133,3 @@ public:
int rc, gc, bc;
- int bs = ::abs ( busystate ) + 25;
+ int bs = ::abs ( busystate * 10 ) + 25;
colorGroup().highlight().rgb( &rc, &gc, &bc );
@@ -146,9 +147,9 @@ public:
- bpm.convertFromImage( img );
-
+ bpm [::abs(busystate)].convertFromImage( img );
+ }
bsy-> repaint ( );
- busystate += 10;
- if ( busystate > 50 )
- busystate = -40;
+ busystate++;
+ if ( busystate > 5 )
+ busystate = -4;
}
@@ -313,3 +314,3 @@ private:
QPixmap bgPixmap;
- QPixmap bpm;
+ QPixmap bpm [6];
QColor bgColor;