Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/launcherview.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 42704ba..72313e3 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp @@ -430,5 +430,12 @@ void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,in int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); if (s!=width) return; - LauncherItem*item = findDocItem(aFile); + LauncherItem*item = 0; + QMap<QString,LauncherItem*>::Iterator it; + if ( ( it = m_itemCache.find(aFile))!=m_itemCache.end()) { + item = it.data(); + m_itemCache.remove(it); + } else { + item = findDocItem(aFile); + } if (!item||!item->isEyeImage()) return; item->setEyePixmap(aPixmap); @@ -437,10 +444,10 @@ void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,in void LauncherIconView::checkCallback() { - if (m_EyeCallBack) { - return; + if (!m_EyeCallBack) { + m_EyeCallBack = new LauncherThumbReceiver(); + connect(m_EyeCallBack,SIGNAL(sig_Thumbnail(const QPixmap&,const QString&,int)), + this,SLOT(setEyePixmap(const QPixmap&,const QString&,int))); + m_eyeTimer.changeInterval(600000); } - m_EyeCallBack = new LauncherThumbReceiver(); - connect(m_EyeCallBack,SIGNAL(sig_Thumbnail(const QPixmap&,const QString&,int)), - this,SLOT(setEyePixmap(const QPixmap&,const QString&,int))); } @@ -457,7 +464,7 @@ void LauncherIconView::requestEyePix(const LauncherItem*item) if (!item) return; if (item->isEyeImage()) { - m_eyeTimer.changeInterval(600000); checkCallback(); int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); + m_itemCache[item->appLnk()->file()]=(LauncherItem*)item; m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s); } @@ -466,9 +473,9 @@ void LauncherIconView::requestEyePix(const LauncherItem*item) void LauncherIconView::stopEyeTimer() { - odebug << "Launcherview: delete opie-eye handle" << oendl; if (m_EyeCallBack) { delete m_EyeCallBack; m_EyeCallBack=0; } + m_itemCache.clear(); m_eyeTimer.stop(); } |