homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp
changeset 60 30f14686fb04
parent 55 03646e8da489
child 61 2b1b11a301d2
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -250,29 +250,31 @@
 {
     HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::listItemLongPressed");
 
-    // create context menu
-    mContextMenu = new HbMenu();
-
-    HbAction *uninstallAction = mContextMenu->addAction(
-                                    hbTrId("txt_common_menu_delete"));
-    HbAction *appDetailsAction(NULL);
-    uninstallAction->setData(UninstallContextAction);
-    
-    QSharedPointer<const CaEntry> entry = mInstalledAppsModel->entry(item->modelIndex());
     EntryFlags flags = item->modelIndex().data(
                            CaItemModel::FlagsRole).value<EntryFlags> ();
+    if (!(flags & UninstallEntryFlag)) {
+        // create context menu
+        mContextMenu = new HbMenu();
+
+        HbAction *uninstallAction = mContextMenu->addAction(
+                                    hbTrId("txt_common_menu_delete"));
+        HbAction *appDetailsAction(NULL);
+        uninstallAction->setData(UninstallContextAction);
     
-    if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && 
-            (flags & RemovableEntryFlag) ) {
-        appDetailsAction = mContextMenu->addAction(hbTrId(
-                                                "txt_common_menu_details"));
-        appDetailsAction->setData(AppDetailsContextAction);
-    }      
+        QSharedPointer<const CaEntry> entry = mInstalledAppsModel->entry(item->modelIndex());
+    
+        if (!(entry->attribute(componentIdAttributeName()).isEmpty()) &&
+                (flags & RemovableEntryFlag) ) {
+            appDetailsAction = mContextMenu->addAction(hbTrId(
+                                                    "txt_common_menu_details"));
+            appDetailsAction->setData(AppDetailsContextAction);
+        }
 
-    mContextModelIndex = item->modelIndex();
-    mContextMenu->setPreferredPos(coords);
-    mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
-    mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
+        mContextModelIndex = item->modelIndex();
+        mContextMenu->setPreferredPos(coords);
+        mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
+        mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
+    }
     
     
     HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::listItemLongPressed");