AbstractSourceCodeManager.st
changeset 2743 0539670d18e4
parent 2742 bb8d754b8edb
child 2762 bc40f1e6821e
--- a/AbstractSourceCodeManager.st	Fri Jan 20 16:48:33 2012 +0100
+++ b/AbstractSourceCodeManager.st	Tue Jan 24 00:13:49 2012 +0100
@@ -156,6 +156,26 @@
     "Modified: 12.9.1996 / 02:22:56 / cg"
 !
 
+enabledManagers
+    "Return list of source code managers that are enabled"
+
+    "If source code management is disabled, return #(). Following code
+     is hack since  there is no global boolean flag, sigh"
+    ^(Smalltalk at:#SourceCodeManager) isNil ifTrue:[
+        #()
+    ] ifFalse:[
+        self availableManagers select:[:manager|manager enabled].  
+    ]
+
+
+
+    "
+     self enabledManagers   
+    "
+
+    "Created: / 23-01-2012 / 19:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 managerForMatchingModule:aPackageIDMatchString put:aSourceCodeManagerClass
     "update the per-module manager definitions, adding a manager class for a matchString"
 
@@ -213,6 +233,12 @@
 managerForPackage:aPackageID
     "return the sourceCodeManager for a aPackageID, nil if unspecified in the manager per package list"
 
+    "JV@2012-01-23: If source code management is disabled, return nil. Following code
+     is hack since  there is no global boolean flag, sigh"
+    (Smalltalk at:#SourceCodeManager) isNil ifTrue:[ ^nil ].
+
+    "JV@2012-01-23: HACK: Q: Shouldn't it filter configured manager through
+     'enabled' managers?"         
     self managerPerMatchingModuleDefinitions do:[:each |
         (each match:aPackageID) ifTrue:[^ each manager].
     ].
@@ -225,9 +251,9 @@
     "
 
     "Created: / 18-04-2011 / 19:39:19 / cg"
-    "Modified: / 09-07-2011 / 15:09:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Created: / 10-10-2011 / 14:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 19-10-2011 / 16:45:38 / cg"
+    "Modified (comment): / 23-01-2012 / 19:46:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 managerPerMatchingModuleDefinitions
@@ -1626,9 +1652,13 @@
 sourceCodeManagerForPackage:aPackageID
     |module mgr|
 
+    "JV@2012-01-23: If source code management is disabled, return #(). Following code
+     is hack since there is no global boolean flag, sigh"
+    (Smalltalk at:#SourceCodeManager) isNil ifTrue:[ ^ nil ].
+
     aPackageID notNil ifTrue:[
         "/ see if there is a package-specific manager
-        (mgr := self managerForModule:aPackageID) notNil ifTrue:[^ mgr].
+        (mgr := self managerForPackage:aPackageID) notNil ifTrue:[^ mgr].
 
        "/ more or less obsolete now - I know which manager is to be used per package
 "/        self availableManagers do:[:mgr |
@@ -1652,7 +1682,7 @@
     "
 
     "Modified: / 18-04-2011 / 19:53:03 / cg"
-    "Modified: / 09-07-2011 / 12:25:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 23-01-2012 / 19:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 supportsCheckinLogMessages
@@ -2223,7 +2253,7 @@
 
     doubleColon := source indexOf: $: startingAt: startQuote + 2.
     "/There may be no double colon at all, if the version method
-    "/is fresh, like '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.284 2012-01-20 15:48:33 cg Exp $'
+    "/is fresh, like '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.285 2012-01-23 23:13:49 vrany Exp $'
     (doubleColon == 0 or:[doubleColon > endQuote]) ifTrue:[
         doubleColon := endQuote - 1.
     ].
@@ -3466,11 +3496,11 @@
 !AbstractSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.284 2012-01-20 15:48:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.285 2012-01-23 23:13:49 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.284 2012-01-20 15:48:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.285 2012-01-23 23:13:49 vrany Exp $'
 ! !
 
 AbstractSourceCodeManager initialize!