homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp
changeset 97 66b5fe3c07fd
parent 90 3ac3aaebaee5
child 98 e6f74eb7f69f
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp	Mon Sep 27 11:52:00 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp	Wed Oct 06 16:06:24 2010 +0300
@@ -114,7 +114,7 @@
             message, HsMenuDialogFactory::Close);
 
     QScopedPointer<HsMenuEntryRemovedHandler> entryObserver(
-            new HsMenuEntryRemovedHandler(itemId, 
+            new HsMenuEntryRemovedHandler(itemId,
                     mApplicationLaunchFailMessage.data(), SLOT(close())));
 
     entryObserver.take()->setParent(mApplicationLaunchFailMessage.data());
@@ -159,6 +159,7 @@
 void HsBaseViewState::addModeEntered()
 {
     mViewOptions = mMenuView->view()->takeMenu();
+    mMenuView->disableOviStore(true);
     connect(mMenuView.data(),
             SIGNAL(activated(QModelIndex)),
             SLOT(addActivated(QModelIndex)));
@@ -181,6 +182,7 @@
 void HsBaseViewState::normalModeEntered()
 {
     setMenuOptions();
+    mMenuView->disableOviStore(false);
     connect(mMenuView.data(),
             SIGNAL(longPressed(HbAbstractViewItem *, QPointF)),
             SLOT(showContextMenu(HbAbstractViewItem *, QPointF)));
@@ -210,10 +212,9 @@
             machine()->postEvent(HsMenuEventFactory::createPreviewHSWidgetEvent(entry->id(),
                 entry->entryTypeName(), entry->attribute(Hs::widgetUriAttributeName),
                 entry->attribute(Hs::widgetLibraryAttributeName)));
-            HsMenuService::touch(entry->id());
-        }
-        else {
-            int errCode = HsMenuService::executeAction(entry->id());
+            HsMenuService::touch(*entry);
+        } else {
+            int errCode = HsMenuService::executeAction(*entry);
             if (errCode != 0) {
                 createApplicationLaunchFailMessage(errCode, entry->id());
             }
@@ -233,7 +234,7 @@
     int id = data.toInt();
     QString collectionType = mModel->data(
             index, CaItemModel::TypeRole).toString();
-    qDebug("HsBaseViewState::openCollection - MCS ID: %d", data.toInt());
+    qDebug("HsBaseViewState::openCollection - ID: %d", data.toInt());
 
     machine()->postEvent(
             HsMenuEventFactory::createOpenCollectionFromAppLibraryEvent(
@@ -253,7 +254,7 @@
     EntryFlags flags = item->modelIndex().data(
             CaItemModel::FlagsRole).value<EntryFlags> ();
 
-    if (!(flags & UninstallEntryFlag)) {
+    if ((!(flags & UninstallEntryFlag)) && (flags & VisibleEntryFlag)) {
         mContextMenu = new HbMenu;
         setContextMenuOptions(item,flags);
         mContextModelIndex = item->modelIndex();
@@ -316,7 +317,7 @@
 {
     if (mContextMenu) {
         mContextMenu->close();
-    }    
+    }
 }
 
 /*!
@@ -329,7 +330,7 @@
         static_cast<Hs::HsContextAction>(action->data().toInt());
 
     const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt();
-    
+
     if (itemId > 0) {
         switch (command) {
             case Hs::AddToHomeScreenContextAction: