[Title] Reinitialize SBI after adding and removing rootstrap
authordonghyuk.yang <donghyuk.yang@samsung.com>
Tue, 18 Dec 2012 07:29:34 +0000 (16:29 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Tue, 18 Dec 2012 07:29:34 +0000 (16:29 +0900)
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rootstrap/RootstrapManager.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java

index 25411a2..e74e82d 100644 (file)
@@ -88,8 +88,12 @@ public class RootstrapManager {
        
        public static PlatformRootstrap addRootstrap(PlatformRootstrap rootstrap ) {
                rootstraps.add(rootstrap);
-               SBIModel.addRootstrap(rootstrap, false);
-
+               //SBIModel.addRootstrap(rootstrap, false);
+               try {
+                       SBIModel.reinitialize();
+               } catch (SBIException e) {
+                       // nothing to do
+               }
                RootstrapManager.notifyChangedRootstrap();
 
                return rootstrap;
@@ -101,6 +105,7 @@ public class RootstrapManager {
                                rootstrap.getArch(), rootstrap.getPath().toOSString(), rootstrap.getRepositoryURLs() );
                try {
                        SBIModel.reinitialize();
+                       reinitialize();
                } catch (SBIException e) {
                        // nothing to do
                }
@@ -117,7 +122,12 @@ public class RootstrapManager {
                        try {
                                removeBaseFileSystem( rootstrap.getId() , rootstrap.getArch());
                        } catch (InterruptedException e) {
-                               // do nothing
+                               // nothing to do
+                       }
+                       try {
+                               SBIModel.reinitialize();
+                       } catch (SBIException e) {
+                               // nothing to do
                        }
                        RootstrapManager.notifyChangedRootstrap();
                        return true;
index efedae6..ef08347 100644 (file)
@@ -581,14 +581,7 @@ public class RootstrapView extends ViewPart {
                String rootId = rootstrap.getId();
                IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
        IConfiguration config = info.getDefaultConfiguration();
-       String targetId = PlatformConfigurationManager.getBuildTargetName(config);
-       if (targetId == null) {
-               try {
-                               targetId = PlatformConfigurationManager.getDefaultBuildTargetName(config);
-                       } catch (SBIException e) {
-                               e.printStackTrace();
-                       }
-       }
+       String targetId = PlatformConfigurationManager.getBuildTargetName(config);      
        SmartBuildInterface sbi = SmartBuildInterface.getInstance();
        String toolId = sbi.getToolchainIDFromTargetID(targetId);
        String newTargetId = SmartBuildInterface.makeTargetID(rootId, toolId);