homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsaddmodeproxymodel.cpp
changeset 97 66b5fe3c07fd
parent 81 7dd137878ff8
equal deleted inserted replaced
95:32e56106abf2 97:66b5fe3c07fd
   131         query.setAttribute(Hs::widgetParam+key,
   131         query.setAttribute(Hs::widgetParam+key,
   132             preferences.value(key).toString());
   132             preferences.value(key).toString());
   133     }
   133     }
   134     QList< QSharedPointer<CaEntry> > entries =
   134     QList< QSharedPointer<CaEntry> > entries =
   135         CaService::instance()->getEntries(query);
   135         CaService::instance()->getEntries(query);
   136     if( entries.count() > 0 )
   136     if (entries.count() > 0) {
   137     {
       
   138         result = entries[0]->id();
   137         result = entries[0]->id();
   139     }
   138     }
   140     return result;
   139     return result;
   141 }
   140 }
   142 
   141 
   145  If widget is removed we checkhow many instance of this widget is left on HS.
   144  If widget is removed we checkhow many instance of this widget is left on HS.
   146  \param uri of a widget.
   145  \param uri of a widget.
   147  \param preferences widget preferences.
   146  \param preferences widget preferences.
   148  */
   147  */
   149 void HsAddModeProxyModel::updateCacheOnAddWidget(const QString &uri,
   148 void HsAddModeProxyModel::updateCacheOnAddWidget(const QString &uri,
   150     const QVariantHash &preferences){
   149     const QVariantHash &preferences)
       
   150 {
   151 	if (uri == Hs::HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) {
   151 	if (uri == Hs::HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) {
   152         int entryId = findCwrtWidgetEntryId(preferences);
   152         int entryId = findCwrtWidgetEntryId(preferences);
   153         if (!mCwrtWidgetCache.value(entryId) ) {
   153         if (!mCwrtWidgetCache.value(entryId) ) {
   154             mCwrtWidgetCache.insert(entryId,true);
   154             mCwrtWidgetCache.insert(entryId,true);
   155             invalidateFilter();
   155             invalidateFilter();
   200         mCwrtWidgetCache.remove(entry.id());
   200         mCwrtWidgetCache.remove(entry.id());
   201     } else {
   201     } else {
   202         mCwrtWidgetCache.insert(entry.id(),
   202         mCwrtWidgetCache.insert(entry.id(),
   203             HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(&entry));
   203             HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(&entry));
   204     }
   204     }
   205 }
   205     invalidateFilter();
   206 
   206 }
       
   207