summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-09 00:44:31 (UTC)
committer alwin <alwin>2004-11-09 00:44:31 (UTC)
commit5bfef5f15db1698505405605f6ed50b9d7855a22 (patch) (side-by-side diff)
tree5199765dbc2a4c4eac0c7aa12dd1e30f6610c9eb
parent4638c11f127d420818e2356359ae6f2223fb4407 (diff)
downloadopie-5bfef5f15db1698505405605f6ed50b9d7855a22.zip
opie-5bfef5f15db1698505405605f6ed50b9d7855a22.tar.gz
opie-5bfef5f15db1698505405605f6ed50b9d7855a22.tar.bz2
again some improvements to image icons
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp23
-rw-r--r--core/launcher/launcherview.h2
2 files changed, 17 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
@@ -431,3 +431,10 @@ void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,in
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;
@@ -438,8 +445,8 @@ 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)));
}
@@ -458,5 +465,5 @@ void LauncherIconView::requestEyePix(const LauncherItem*item)
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);
@@ -467,3 +474,2 @@ void LauncherIconView::stopEyeTimer()
{
- odebug << "Launcherview: delete opie-eye handle" << oendl;
if (m_EyeCallBack) {
@@ -472,2 +478,3 @@ void LauncherIconView::stopEyeTimer()
}
+ 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
@@ -28,2 +28,3 @@
#include <qtimer.h>
+#include <qmap.h>
@@ -241,2 +242,3 @@ private:
QTimer m_eyeTimer;
+ QMap<QString,LauncherItem*> m_itemCache;
};