open directories found
authorpenk
Tue, 14 Oct 2003 13:32:14 +0200
changeset 5279 165a7b841a86
parent 5278 67cd86f196dc
child 5280 a68af81b7b2c
open directories found
FileApplicationNoteBook.st
FindFileApplication.st
--- a/FileApplicationNoteBook.st	Tue Oct 14 10:03:54 2003 +0200
+++ b/FileApplicationNoteBook.st	Tue Oct 14 13:32:14 2003 +0200
@@ -449,6 +449,10 @@
     | applList applItem itemClass|
 
     anItem isNil ifTrue:[ ^ self ].
+    anItem isDirectory ifTrue:[
+        self warn:'No Application to open for directory:', anItem fileName asString, ' found'.
+        ^ nil.
+    ].
     applList := self applicationList.
     self openAlwaysInTextEditor value ifTrue:[
         ^ self openDefaultApplicationByItem:anItem.
@@ -4943,5 +4947,5 @@
 !FileApplicationNoteBook class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.116 2003-10-10 07:06:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.117 2003-10-14 11:32:14 penk Exp $'
 ! !
--- a/FindFileApplication.st	Tue Oct 14 10:03:54 2003 +0200
+++ b/FindFileApplication.st	Tue Oct 14 13:32:14 2003 +0200
@@ -789,9 +789,13 @@
     file := self resultList at:entries first.
     file asFilename exists not ifTrue:[^ self].
     app := targetApplication ? self masterApplication.
+    file asFilename isDirectory ifTrue:[
+        app gotoFile:(file asFilename).
+        ^ self.
+    ].
     app notNil ifTrue:[
         openedAppl := app openApplForFile:file.
-        openedAppl isTextEditor ifTrue:[
+        (openedAppl notNil and:[openedAppl isTextEditor]) ifTrue:[
             contentsPattern := self contentsPatternHolder value.
             (contentsPattern notNil and:[ contentsPattern notEmpty and:[contentsPattern ~= '*']]) ifTrue:[
                 openedAppl searchForPattern:contentsPattern ignoreCase:(self ignoreCaseInContents value).
@@ -1107,5 +1111,5 @@
 !FindFileApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.18 2003-10-08 15:34:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.19 2003-10-14 11:32:04 penk Exp $'
 ! !