Tools__ChangeSetDiffList.st
branchjv
changeset 12275 a416cf8a4b50
parent 12274 1e0599b8a007
child 12317 aac0f12a3327
--- a/Tools__ChangeSetDiffList.st	Fri Aug 03 14:08:30 2012 +0100
+++ b/Tools__ChangeSetDiffList.st	Fri Aug 03 14:47:21 2012 +0100
@@ -384,6 +384,23 @@
     "Nothing to do"
 !
 
+shouldDisplayDiff: aDiffCompoment
+    "Return true if given diff component should be displayed"
+
+    (showVersionMethodDiffsHolder value not and:[aDiffCompoment isForVersionMethod])
+        ifTrue:[ ^ false ].
+
+    (showCopyrightMethodDiffsHolder value not and:[aDiffCompoment isForCopyrightMethod])
+        ifTrue:[ ^ false ].
+
+    aDiffCompoment isDiffSet 
+        ifTrue:[ ^ aDiffCompoment diffs anySatisfy:[:diff|self shouldDisplayDiff: diff]].
+
+    ^true
+
+    "Created: / 03-08-2012 / 14:38:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 updateList
     "Superclass Tools::BrowserList says that I am responsible to implement this method"
     
@@ -393,26 +410,21 @@
     newDiffs := self inGeneratorHolder value ? #().
     (newDiffs isKindOf: ChangeSetDiffComponent) ifTrue:
         [newDiffs := newDiffs diffs].
-    showVersionMethodDiffsHolder value ifFalse:[
-        newDiffs := newDiffs reject:[:diff|diff isForVersionMethod]
-    ].
-    showCopyrightMethodDiffsHolder value ifFalse:[
-        newDiffs := newDiffs reject:[:diff|diff isForCopyrightMethod]
-    ].
-
 
     newDiffs := self filterList: newDiffs.
     newList := OrderedCollection new:16.    
     newDiffs do:
         [:item|
-        newList add:(ListEntry model: item application: self).
-        item addDependent: self].
+        (self shouldDisplayDiff: item) ifTrue:[
+            newList add:(ListEntry model: item application: self).
+            item addDependent: self].
+        ].
 
     newList sort:[:a :b|a label < b label].
     self listHolder value:newList
 
     "Modified: / 07-07-2011 / 14:17:26 / jv"
-    "Modified: / 01-08-2012 / 16:37:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-08-2012 / 14:42:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetDiffList::ListEntry class methodsFor:'instance creation'!
@@ -490,5 +502,5 @@
 !
 
 version_SVN
-    ^ '$Id: Tools__ChangeSetDiffList.st 8034 2012-08-03 13:08:30Z vranyj1 $'
+    ^ '$Id: Tools__ChangeSetDiffList.st 8035 2012-08-03 13:47:21Z vranyj1 $'
 ! !