From 5bfef5f15db1698505405605f6ed50b9d7855a22 Mon Sep 17 00:00:00 2001 From: alwin Date: Tue, 09 Nov 2004 00:44:31 +0000 Subject: again some improvements to image icons --- (limited to 'core/launcher') 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 @@ -429,19 +429,26 @@ 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::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); } 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))); } void LauncherIconView::addCheckItem(AppLnk* app) @@ -456,20 +463,20 @@ 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); } } 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(); } diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h index ebb1362..94c367c 100644 --- a/core/launcher/launcherview.h +++ b/core/launcher/launcherview.h @@ -26,6 +26,7 @@ #include #include #include +#include class CategorySelect; class LauncherIconView; @@ -239,6 +240,7 @@ private: #endif BusyIndicatorType busyType; QTimer m_eyeTimer; + QMap m_itemCache; }; #endif // LAUNCHERVIEW_H -- cgit v0.9.0.2