# HG changeset patch # User ca # Date 821744068 -3600 # Node ID 82691623dd4cfc865ff816ac142606452c51c3c0 # Parent 3ec5d73fdf545a77dd63d007eaa79cdde42fcd97 update fixes diff -r 3ec5d73fdf54 -r 82691623dd4c FSelList.st --- a/FSelList.st Mon Jan 15 14:41:39 1996 +0100 +++ b/FSelList.st Mon Jan 15 23:14:28 1996 +0100 @@ -11,9 +11,9 @@ " SelectionInListView subclass:#FileSelectionList - instanceVariableNames:'pattern directory timeStamp directoryId directoryName - directoryContents directoryFileTypes fileTypes realAction matchBlock - stayInDirectory ignoreParentDirectory markDirectories' + instanceVariableNames:'pattern directory timeStamp directoryId directoryName + directoryContents directoryFileTypes fileTypes realAction + matchBlock stayInDirectory ignoreParentDirectory markDirectories' classVariableNames:'' poolDictionaries:'' category:'Views-Text' @@ -413,12 +413,12 @@ updateList "set the lists contents to the filenames in the directory" - |oldCursor files newList index path| + |oldCursor files newList index path obsolete| directory isNil ifTrue:[ - super list:nil. - files := newList := fileTypes := nil. - ^ self + super list:nil. + files := newList := fileTypes := nil. + ^ self ]. oldCursor := cursor. @@ -429,14 +429,18 @@ (can happen after a restart, when a file is no longer there, has moved or is NFS-mounted differently) " - (directoryId == directory id - and:[directoryName = directory pathName]) ifFalse:[ - timeStamp := directory timeOfLastChange. - directoryId := directory id. - directoryName := directory pathName. - directoryContents := directory asStringCollection sort. - directoryFileTypes := OrderedCollection new. - directoryContents do:[:name | directoryFileTypes add:(directory typeOf:name)]. + obsolete := directoryId ~~ directory id + or:[directoryName ~= directory pathName + or:[timeStamp notNil + and:[directory timeOfLastChange > timeStamp]]]. + + obsolete ifTrue:[ + timeStamp := directory timeOfLastChange. + directoryId := directory id. + directoryName := directory pathName. + directoryContents := directory asStringCollection sort. + directoryFileTypes := OrderedCollection new. + directoryContents do:[:name | directoryFileTypes add:(directory typeOf:name)]. ]. files := directoryContents. @@ -446,39 +450,40 @@ path := directory pathName , Filename separator asString. files do:[:name | - |type| + |type| - (matchBlock isNil or:[matchBlock value:(path , name)]) ifTrue:[ - type := directoryFileTypes at:index. - type == #directory ifTrue:[ - name = '..' ifTrue:[ - ignoreParentDirectory ifFalse:[ - newList add:name. - fileTypes add:type - ] - ] ifFalse:[ - name = '.' ifTrue:[ - "ignore" - ] ifFalse:[ - newList add:(name ", ' ...'"). - fileTypes add:type - ] - ] - ] ifFalse:[ - (pattern isNil - or:[pattern isEmpty - or:[pattern = '*' - or:[pattern match:name]]]) ifTrue:[ - newList add:name. - fileTypes add:type - ] - ]. - ]. - index := index + 1 + (matchBlock isNil or:[matchBlock value:(path , name)]) ifTrue:[ + type := directoryFileTypes at:index. + type == #directory ifTrue:[ + name = '..' ifTrue:[ + ignoreParentDirectory ifFalse:[ + newList add:name. + fileTypes add:type + ] + ] ifFalse:[ + name = '.' ifTrue:[ + "ignore" + ] ifFalse:[ + newList add:(name ", ' ...'"). + fileTypes add:type + ] + ] + ] ifFalse:[ + (pattern isNil + or:[pattern isEmpty + or:[pattern = '*' + or:[pattern match:name]]]) ifTrue:[ + newList add:name. + fileTypes add:type + ] + ]. + ]. + index := index + 1 ]. super list:newList. self cursor:oldCursor. + ! visibleLineNeedsSpecialCare:visLineNr @@ -518,5 +523,5 @@ !FileSelectionList class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelList.st,v 1.18 1996-01-14 16:46:33 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelList.st,v 1.19 1996-01-15 22:14:28 ca Exp $' ! ! diff -r 3ec5d73fdf54 -r 82691623dd4c FileSelectionList.st --- a/FileSelectionList.st Mon Jan 15 14:41:39 1996 +0100 +++ b/FileSelectionList.st Mon Jan 15 23:14:28 1996 +0100 @@ -11,9 +11,9 @@ " SelectionInListView subclass:#FileSelectionList - instanceVariableNames:'pattern directory timeStamp directoryId directoryName - directoryContents directoryFileTypes fileTypes realAction matchBlock - stayInDirectory ignoreParentDirectory markDirectories' + instanceVariableNames:'pattern directory timeStamp directoryId directoryName + directoryContents directoryFileTypes fileTypes realAction + matchBlock stayInDirectory ignoreParentDirectory markDirectories' classVariableNames:'' poolDictionaries:'' category:'Views-Text' @@ -413,12 +413,12 @@ updateList "set the lists contents to the filenames in the directory" - |oldCursor files newList index path| + |oldCursor files newList index path obsolete| directory isNil ifTrue:[ - super list:nil. - files := newList := fileTypes := nil. - ^ self + super list:nil. + files := newList := fileTypes := nil. + ^ self ]. oldCursor := cursor. @@ -429,14 +429,18 @@ (can happen after a restart, when a file is no longer there, has moved or is NFS-mounted differently) " - (directoryId == directory id - and:[directoryName = directory pathName]) ifFalse:[ - timeStamp := directory timeOfLastChange. - directoryId := directory id. - directoryName := directory pathName. - directoryContents := directory asStringCollection sort. - directoryFileTypes := OrderedCollection new. - directoryContents do:[:name | directoryFileTypes add:(directory typeOf:name)]. + obsolete := directoryId ~~ directory id + or:[directoryName ~= directory pathName + or:[timeStamp notNil + and:[directory timeOfLastChange > timeStamp]]]. + + obsolete ifTrue:[ + timeStamp := directory timeOfLastChange. + directoryId := directory id. + directoryName := directory pathName. + directoryContents := directory asStringCollection sort. + directoryFileTypes := OrderedCollection new. + directoryContents do:[:name | directoryFileTypes add:(directory typeOf:name)]. ]. files := directoryContents. @@ -446,39 +450,40 @@ path := directory pathName , Filename separator asString. files do:[:name | - |type| + |type| - (matchBlock isNil or:[matchBlock value:(path , name)]) ifTrue:[ - type := directoryFileTypes at:index. - type == #directory ifTrue:[ - name = '..' ifTrue:[ - ignoreParentDirectory ifFalse:[ - newList add:name. - fileTypes add:type - ] - ] ifFalse:[ - name = '.' ifTrue:[ - "ignore" - ] ifFalse:[ - newList add:(name ", ' ...'"). - fileTypes add:type - ] - ] - ] ifFalse:[ - (pattern isNil - or:[pattern isEmpty - or:[pattern = '*' - or:[pattern match:name]]]) ifTrue:[ - newList add:name. - fileTypes add:type - ] - ]. - ]. - index := index + 1 + (matchBlock isNil or:[matchBlock value:(path , name)]) ifTrue:[ + type := directoryFileTypes at:index. + type == #directory ifTrue:[ + name = '..' ifTrue:[ + ignoreParentDirectory ifFalse:[ + newList add:name. + fileTypes add:type + ] + ] ifFalse:[ + name = '.' ifTrue:[ + "ignore" + ] ifFalse:[ + newList add:(name ", ' ...'"). + fileTypes add:type + ] + ] + ] ifFalse:[ + (pattern isNil + or:[pattern isEmpty + or:[pattern = '*' + or:[pattern match:name]]]) ifTrue:[ + newList add:name. + fileTypes add:type + ] + ]. + ]. + index := index + 1 ]. super list:newList. self cursor:oldCursor. + ! visibleLineNeedsSpecialCare:visLineNr @@ -518,5 +523,5 @@ !FileSelectionList class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionList.st,v 1.18 1996-01-14 16:46:33 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/FileSelectionList.st,v 1.19 1996-01-15 22:14:28 ca Exp $' ! !