summaryrefslogtreecommitdiff
path: root/core/launcher
authoralwin <alwin>2005-03-12 02:13:52 (UTC)
committer alwin <alwin>2005-03-12 02:13:52 (UTC)
commitcd1b9f7c11c73ef0df0ce66c53466c979a3a4d42 (patch) (unidiff)
treed4ed9b082abe2aa645fbd58b86d65f5ce9c48348 /core/launcher
parent84af289057291a49a52a60b390bc5320c02b5a55 (diff)
downloadopie-cd1b9f7c11c73ef0df0ce66c53466c979a3a4d42.zip
opie-cd1b9f7c11c73ef0df0ce66c53466c979a3a4d42.tar.gz
opie-cd1b9f7c11c73ef0df0ce66c53466c979a3a4d42.tar.bz2
And I'm wondering why opie sometimes is that slow. Hopefully reduced
the calls to opie-eye for images in documenttab when changing layout and so on.
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp34
-rw-r--r--core/launcher/launcherview.h4
2 files changed, 31 insertions, 7 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index a4c7561..d960908 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -111,6 +111,8 @@ private:
111 iconstate_t m_EyeImageSet; 111 iconstate_t m_EyeImageSet;
112}; 112};
113 113
114static bool s_IgnoreNextPix = false;
115
114LauncherItem::LauncherItem( QIconView *parent, AppLnk *applnk, bool bigIcon ) 116LauncherItem::LauncherItem( QIconView *parent, AppLnk *applnk, bool bigIcon )
115 : QIconViewItem( parent, applnk->name(), 117 : QIconViewItem( parent, applnk->name(),
116 bigIcon ? applnk->bigPixmap() :applnk->pixmap() ), 118 bigIcon ? applnk->bigPixmap() :applnk->pixmap() ),
@@ -141,7 +143,7 @@ LauncherItem::~LauncherItem()
141 143
142QPixmap*LauncherItem::pixmap()const 144QPixmap*LauncherItem::pixmap()const
143{ 145{
144 if (m_EyeImage && m_EyeImageSet == BASE_ICON) { 146 if (m_EyeImage && m_EyeImageSet == BASE_ICON && s_IgnoreNextPix==false) {
145 LauncherIconView* liv = (LauncherIconView*)iconView(); 147 LauncherIconView* liv = (LauncherIconView*)iconView();
146 liv->requestEyePix(this); 148 liv->requestEyePix(this);
147 } 149 }
@@ -294,7 +296,7 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
294 connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); 296 connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer()));
295 Config config( "Launcher" ); 297 Config config( "Launcher" );
296 config.setGroup( "GUI" ); 298 config.setGroup( "GUI" );
297 setStaticBackgroundPicture( config.readBoolEntry( "StaticBackground", true ) ); 299 setStaticBackgroundPicture( config.readBoolEntry( "StaticBackground", true ) );
298} 300}
299 301
300LauncherIconView::~LauncherIconView() 302LauncherIconView::~LauncherIconView()
@@ -310,6 +312,20 @@ LauncherIconView::~LauncherIconView()
310#endif 312#endif
311} 313}
312 314
315void LauncherIconView::unsetPalette()
316{
317 s_IgnoreNextPix = true;
318 QIconView::unsetPalette();
319 s_IgnoreNextPix = false;
320}
321
322void LauncherIconView::setPalette(const QPalette & palette)
323{
324 s_IgnoreNextPix = true;
325 QIconView::setPalette(palette);
326 s_IgnoreNextPix = false;
327}
328
313void LauncherIconView::setStaticBackgroundPicture( bool enable ) 329void LauncherIconView::setStaticBackgroundPicture( bool enable )
314{ 330{
315 staticBackground = enable; 331 staticBackground = enable;
@@ -322,8 +338,8 @@ void LauncherIconView::setStaticBackgroundPicture( bool enable )
322 { 338 {
323 setStaticBackground( false ); 339 setStaticBackground( false );
324 verticalScrollBar()->setTracking( true ); 340 verticalScrollBar()->setTracking( true );
325 } 341 }
326} 342}
327 343
328int LauncherIconView::compare(const AppLnk* a, const AppLnk* b) 344int LauncherIconView::compare(const AppLnk* a, const AppLnk* b)
329{ 345{
@@ -486,8 +502,8 @@ void LauncherIconView::checkCallback()
486 m_EyeCallBack = new LauncherThumbReceiver(); 502 m_EyeCallBack = new LauncherThumbReceiver();
487 connect(m_EyeCallBack,SIGNAL(sig_Thumbnail(const QPixmap&,const QString&,int)), 503 connect(m_EyeCallBack,SIGNAL(sig_Thumbnail(const QPixmap&,const QString&,int)),
488 this,SLOT(setEyePixmap(const QPixmap&,const QString&,int))); 504 this,SLOT(setEyePixmap(const QPixmap&,const QString&,int)));
505 m_eyeTimer.changeInterval(600000);
489 } 506 }
490 m_eyeTimer.changeInterval(600000);
491} 507}
492 508
493void LauncherIconView::addCheckItem(AppLnk* app) 509void LauncherIconView::addCheckItem(AppLnk* app)
@@ -1208,8 +1224,10 @@ QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) {
1208} 1224}
1209 1225
1210LauncherThumbReceiver::LauncherThumbReceiver() 1226LauncherThumbReceiver::LauncherThumbReceiver()
1211 :QObject() 1227 :QObject(),requestTimer(this)
1212{ 1228{
1229
1230 connect(&requestTimer,SIGNAL(timeout()),SLOT(sendRequest()));
1213 QCopChannel * chan = new QCopChannel( "QPE/opie-eye",this ); 1231 QCopChannel * chan = new QCopChannel( "QPE/opie-eye",this );
1214 connect(chan, SIGNAL(received(const QCString&,const QByteArray&)), 1232 connect(chan, SIGNAL(received(const QCString&,const QByteArray&)),
1215 this, SLOT(recieve(const QCString&,const QByteArray&)) ); 1233 this, SLOT(recieve(const QCString&,const QByteArray&)) );
@@ -1247,7 +1265,9 @@ void LauncherThumbReceiver::requestThumb(const QString&file,int width,int height
1247 rItem.width = width; 1265 rItem.width = width;
1248 rItem.height = height; 1266 rItem.height = height;
1249 m_inThumbNail.append(rItem); 1267 m_inThumbNail.append(rItem);
1250 QTimer::singleShot(2, this, SLOT(sendRequest())); 1268 if (!requestTimer.isActive()) {
1269 requestTimer.start(100,true);
1270 }
1251} 1271}
1252 1272
1253void LauncherThumbReceiver::sendRequest() 1273void LauncherThumbReceiver::sendRequest()
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index 6a2d197..792c6d1 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -153,6 +153,7 @@ signals:
153 void sig_Thumbnail(const QPixmap&,const QString&,int); 153 void sig_Thumbnail(const QPixmap&,const QString&,int);
154 154
155protected: 155protected:
156 QTimer requestTimer;
156 PixmapInfos m_inThumbNail; 157 PixmapInfos m_inThumbNail;
157}; 158};
158 159
@@ -214,6 +215,9 @@ public:
214 215
215 static QMap<QString,QPixmap>* sm_EyeCache; 216 static QMap<QString,QPixmap>* sm_EyeCache;
216 217
218 virtual void setPalette(const QPalette & palette);
219 virtual void unsetPalette();
220
217protected: 221protected:
218 virtual void timerEvent( QTimerEvent *te ); 222 virtual void timerEvent( QTimerEvent *te );
219 void styleChange( QStyle &old ); 223 void styleChange( QStyle &old );