SourceCodeManagerUtilities.st
changeset 3814 466fa886aa65
parent 3812 173678af0074
child 3818 25607a4f1e98
--- a/SourceCodeManagerUtilities.st	Fri Feb 27 22:24:57 2015 +0100
+++ b/SourceCodeManagerUtilities.st	Sun Mar 01 00:41:31 2015 +0100
@@ -3152,7 +3152,7 @@
 removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn
     "show container & optionally let user confirm twice."
 
-    |module directory fileName info mgr|
+    |info mgr|
 
     aClass isLoaded ifFalse:[
         doWarn ifTrue:[
@@ -3171,6 +3171,32 @@
     ].
 
     info := mgr sourceInfoOfClass:aClass.
+    ^ self removeSourceContainerForClass:aClass usingSourceInfo:info confirm:doConfirm warn:doWarn
+
+    "Modified: / 16-07-2013 / 19:46:50 / cg"
+!
+
+removeSourceContainerForClass:aClass usingSourceInfo:info confirm:doConfirm warn:doWarn
+    "show container & optionally let user confirm twice."
+
+    |module directory fileName mgr|
+
+    aClass isLoaded ifFalse:[
+        doWarn ifTrue:[
+            self warn:(resources string:'Please load the class first.').
+        ].
+        ^ false.
+    ].
+
+    "/
+    "/ ask the sourceCodeManager if it knows anything about that class
+    "/ if so, take that as a default.
+    "/
+    mgr := self sourceCodeManagerFor:aClass.
+    mgr isNil ifTrue:[
+        ^ false
+    ].
+
     info notNil ifTrue:[
         (info includesKey:#module) ifTrue:[
             module := (info at:#module).
@@ -3233,9 +3259,8 @@
         ].
     ].
 
-    (mgr removeContainer:fileName
-                inModule:module
-               directory:directory) ifFalse:[
+    (mgr removeContainer:fileName inModule:module directory:directory) 
+    ifFalse:[
         doWarn ifTrue:[
             self warn:(resources string:'failed to remove container.').
         ].
@@ -4300,10 +4325,10 @@
 !SourceCodeManagerUtilities class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.317 2015-02-27 15:36:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.318 2015-02-28 23:41:31 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.317 2015-02-27 15:36:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.318 2015-02-28 23:41:31 cg Exp $'
 ! !