Frank Kobzik has uploaded a new change for review.

Change subject: frontend: Remove unwanted query call
......................................................................

frontend: Remove unwanted query call

This patch removes calling query for soundcard in
InstanceTypeManager. The query makes no sense and its presence is
probably a copy-paste error.

Change-Id: I8d03d789b66f6b95f475df3210b2db0f8094a1b5
Signed-off-by: Frantisek Kobzik <fkob...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/instancetypes/InstanceTypeManager.java
1 file changed, 11 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/63/37563/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/instancetypes/InstanceTypeManager.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/instancetypes/InstanceTypeManager.java
index f2c6808..18a562e 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/instancetypes/InstanceTypeManager.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/instancetypes/InstanceTypeManager.java
@@ -471,31 +471,22 @@
         maybeSetSingleQxlPci(vmBase);
 
         // graphics
-        AsyncDataProvider.getInstance().isSoundcardEnabled(new 
AsyncQuery(model, new INewAsyncCallback() {
+        Frontend.getInstance().runQuery(VdcQueryType.GetGraphicsDevices, new 
IdQueryParameters(vmBase.getId()), new AsyncQuery(this, new INewAsyncCallback() 
{
             @Override
             public void onSuccess(Object model, Object returnValue) {
                 deactivate();
-                getModel().getIsSoundcardEnabled().setEntity((Boolean) 
returnValue);
+                Set<GraphicsType> graphicsTypes = new HashSet<GraphicsType>();
+                List<GraphicsDevice> graphicsDevices = ((VdcQueryReturnValue) 
returnValue).getReturnValue();
+                for (GraphicsDevice graphicsDevice : graphicsDevices) {
+                    graphicsTypes.add(graphicsDevice.getGraphicsType());
+                }
+                UnitVmModel.GraphicsTypes selected = 
UnitVmModel.GraphicsTypes.fromGraphicsTypes(graphicsTypes);
+                if (selected != null && 
getModel().getGraphicsType().getItems().contains(selected)) {
+                    maybeSetSelectedItem(getModel().getGraphicsType(), 
selected);
+                }
                 activate();
-
-                
Frontend.getInstance().runQuery(VdcQueryType.GetGraphicsDevices, new 
IdQueryParameters(vmBase.getId()), new AsyncQuery(this, new INewAsyncCallback() 
{
-                    @Override
-                    public void onSuccess(Object model, Object returnValue) {
-                        deactivate();
-                        Set<GraphicsType> graphicsTypes = new 
HashSet<GraphicsType>();
-                        List<GraphicsDevice> graphicsDevices = 
((VdcQueryReturnValue) returnValue).getReturnValue();
-                        for (GraphicsDevice graphicsDevice : graphicsDevices) {
-                            
graphicsTypes.add(graphicsDevice.getGraphicsType());
-                        }
-                        UnitVmModel.GraphicsTypes selected = 
UnitVmModel.GraphicsTypes.fromGraphicsTypes(graphicsTypes);
-                        if (selected != null && 
getModel().getGraphicsType().getItems().contains(selected)) {
-                            maybeSetSelectedItem(getModel().getGraphicsType(), 
selected);
-                        }
-                        activate();
-                    }
-                }));
             }
-        }), vmBase.getId());
+        }));
     }
 
     protected void maybeSetSingleQxlPci(VmBase vmBase) {


-- 
To view, visit http://gerrit.ovirt.org/37563
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d03d789b66f6b95f475df3210b2db0f8094a1b5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkob...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to