Emulator Remove: remove duplicate emulators when execute 'delete' function
authorjihye424.kim <jihye424.kim@samsung.com>
Fri, 26 Jun 2015 02:15:57 +0000 (11:15 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Fri, 26 Jun 2015 02:30:55 +0000 (11:30 +0900)
Change-Id: Id0536d0ae3cc6dfe23b128f7bb8a02f1b8a58ba3
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/platform/Profile.java
src/org/tizen/emulator/manager/ui/VMsMainView.java
src/org/tizen/emulator/manager/vms/EmulatorVMList.java

index 2b8e917..a22a4f7 100644 (file)
@@ -183,6 +183,13 @@ public class Profile {
        }
 
        public void removeEmulator(VMProperty vm) {
+               if (this == ProfileList.getTotalProfile()) {
+                       vm.getPropertyValue().baseImage.getPlatform()
+                               .getProfileClass().getEmulatorList().remove(vm);
+               } else {
+                       ProfileList.getTotalProfile().getEmulatorList().remove(vm);
+               }
+               EmulatorVMList.getInstance().removeProperty(vm);
                vmList.remove(vm);
        }
 
index 74d815f..10cf5dd 100644 (file)
@@ -470,7 +470,7 @@ public class VMsMainView {
                try {
                        if (handling.deleteVirtualMachine(currentProperty, needCheck)) {
                                int index = currentProfile.getEmulatorList().indexOf(currentProperty) - 1;
-                               currentProfile.getEmulatorList().remove(currentProperty);
+                               currentProfile.removeEmulator(currentProperty);
                                currentProperty = (index < 0 ? null : currentProfile.getEmulatorList().get(index));
                                MainDialog.redraw();
                                return true;
index 7c98041..1170f95 100644 (file)
@@ -183,6 +183,12 @@ public class EmulatorVMList {
                }
        }
 
+       public void removeProperty(VMProperty prop) {
+               if (prop != null) {
+                       propertiesList.remove(prop);
+               }
+       }
+
        public boolean storeXML(VMProperty property) {
                return storeXML(property, null);
        }