-rw-r--r-- | core/launcher/launcherview.cpp | 23 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 2 |
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 | |||
@@ -430,5 +430,12 @@ void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,in | |||
430 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); | 430 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); |
431 | if (s!=width) return; | 431 | if (s!=width) return; |
432 | LauncherItem*item = findDocItem(aFile); | 432 | LauncherItem*item = 0; |
433 | QMap<QString,LauncherItem*>::Iterator it; | ||
434 | if ( ( it = m_itemCache.find(aFile))!=m_itemCache.end()) { | ||
435 | item = it.data(); | ||
436 | m_itemCache.remove(it); | ||
437 | } else { | ||
438 | item = findDocItem(aFile); | ||
439 | } | ||
433 | if (!item||!item->isEyeImage()) return; | 440 | if (!item||!item->isEyeImage()) return; |
434 | item->setEyePixmap(aPixmap); | 441 | item->setEyePixmap(aPixmap); |
@@ -437,10 +444,10 @@ void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,in | |||
437 | void LauncherIconView::checkCallback() | 444 | void LauncherIconView::checkCallback() |
438 | { | 445 | { |
439 | if (m_EyeCallBack) { | 446 | if (!m_EyeCallBack) { |
440 | return; | 447 | m_EyeCallBack = new LauncherThumbReceiver(); |
448 | connect(m_EyeCallBack,SIGNAL(sig_Thumbnail(const QPixmap&,const QString&,int)), | ||
449 | this,SLOT(setEyePixmap(const QPixmap&,const QString&,int))); | ||
450 | m_eyeTimer.changeInterval(600000); | ||
441 | } | 451 | } |
442 | m_EyeCallBack = new LauncherThumbReceiver(); | ||
443 | connect(m_EyeCallBack,SIGNAL(sig_Thumbnail(const QPixmap&,const QString&,int)), | ||
444 | this,SLOT(setEyePixmap(const QPixmap&,const QString&,int))); | ||
445 | } | 452 | } |
446 | 453 | ||
@@ -457,7 +464,7 @@ void LauncherIconView::requestEyePix(const LauncherItem*item) | |||
457 | if (!item) return; | 464 | if (!item) return; |
458 | if (item->isEyeImage()) { | 465 | if (item->isEyeImage()) { |
459 | m_eyeTimer.changeInterval(600000); | ||
460 | checkCallback(); | 466 | checkCallback(); |
461 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); | 467 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); |
468 | m_itemCache[item->appLnk()->file()]=(LauncherItem*)item; | ||
462 | m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s); | 469 | m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s); |
463 | } | 470 | } |
@@ -466,9 +473,9 @@ void LauncherIconView::requestEyePix(const LauncherItem*item) | |||
466 | void LauncherIconView::stopEyeTimer() | 473 | void LauncherIconView::stopEyeTimer() |
467 | { | 474 | { |
468 | odebug << "Launcherview: delete opie-eye handle" << oendl; | ||
469 | if (m_EyeCallBack) { | 475 | if (m_EyeCallBack) { |
470 | delete m_EyeCallBack; | 476 | delete m_EyeCallBack; |
471 | m_EyeCallBack=0; | 477 | m_EyeCallBack=0; |
472 | } | 478 | } |
479 | m_itemCache.clear(); | ||
473 | m_eyeTimer.stop(); | 480 | m_eyeTimer.stop(); |
474 | } | 481 | } |
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 | |||
@@ -27,4 +27,5 @@ | |||
27 | #include <qiconview.h> | 27 | #include <qiconview.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qmap.h> | ||
29 | 30 | ||
30 | class CategorySelect; | 31 | class CategorySelect; |
@@ -240,4 +241,5 @@ private: | |||
240 | BusyIndicatorType busyType; | 241 | BusyIndicatorType busyType; |
241 | QTimer m_eyeTimer; | 242 | QTimer m_eyeTimer; |
243 | QMap<QString,LauncherItem*> m_itemCache; | ||
242 | }; | 244 | }; |
243 | 245 | ||