CLI: fixed bug
authorjihye424.kim <jihye424.kim@samsung.com>
Fri, 17 Jul 2015 02:48:09 +0000 (11:48 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Fri, 17 Jul 2015 02:48:09 +0000 (11:48 +0900)
- problem('launch' command does not working) is fixed

Change-Id: I8d2bb350e93b9ab5aef93f263a9d5ad61799fde5
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/console/ConsoleCreateVM.java
src/org/tizen/emulator/manager/console/ConsoleProcessor.java

index 0c632d8..e4b0b95 100644 (file)
@@ -423,6 +423,18 @@ public class ConsoleCreateVM {
                                } else {
                                        prop.skinPath = null;
                                }
+                       } else { // resolutionCommon == null and skinComman == null
+                               ArrayList<Skin> list = null;
+                               list = prop.baseImage.getPlatform().findGeneralSkinList();
+                               if (list != null && !list.isEmpty()) {
+                                       prop.skin = list.get(0);
+                                       return;
+                               }
+                               list = prop.baseImage.getPlatform().getSkins();
+                               if (list != null && !list.isEmpty()) {
+                                       prop.skin = list.get(0);
+                                       return;
+                               }
                        }
                }
        }
index 231b5ab..c4b8708 100644 (file)
@@ -41,23 +41,27 @@ import org.tizen.emulator.manager.platform.ProfileList;
 import org.tizen.emulator.manager.resources.FilePathResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.About;
-import org.tizen.emulator.manager.vms.EmulatorVMList;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.helper.HelperClass;
 import org.tizen.emulator.manager.vms.helper.VMWorkerException;
 import org.tizen.emulator.manager.vms.option.LaunchConfig;
 
 public class ConsoleProcessor {
-       private EmulatorVMList vms = EmulatorVMList.getInstance();
-
-       public VMProperty getProperty(String name) {
-               ProfileList.settingVMPropertyList();
-               return vms.getProperty(name);
+       ArrayList<VMProperty> properties = null;
+       public ConsoleProcessor() {
+               properties = (ArrayList<VMProperty>) ProfileList.getTotalProfile().getEmulatorList();
+               if (properties == null) {
+                       properties = new ArrayList<VMProperty>();
+               }
        }
 
-       public VMProperty[] getProperties() {
-               vms.refreshProperties();
-               return vms.getProperties();
+       public VMProperty getProperty(String name) {
+               for (VMProperty prop: properties) {
+                       if (name.equals(prop.getName())) {
+                               return prop;
+                       }
+               }
+               return null;
        }
 
        public String getAboutInfo() {
@@ -132,8 +136,7 @@ public class ConsoleProcessor {
 
        public ArrayList<String> getInfoOfVMList(boolean isDetail) {
                ArrayList<String> message = new ArrayList<String>();
-               VMProperty[] properties = (VMProperty[])getProperties();
-               if (properties.length == 0) {
+               if (properties.isEmpty()) {
                        // error
                        message.add("VM list is empty.");
                } else {
@@ -157,7 +160,7 @@ public class ConsoleProcessor {
        }
 
        public int getCountOfVMList() {
-               return ((VMProperty[])getProperties()).length;
+               return properties.size();
        }
 
        public ArrayList<String> getInfoOfImageList(boolean isDetail) {