* elmo-archive.el (elmo-archive-folder): Added `dir-name' slot.
authorteranisi <teranisi>
Thu, 13 Dec 2001 15:04:55 +0000 (15:04 +0000)
committerteranisi <teranisi>
Thu, 13 Dec 2001 15:04:55 +0000 (15:04 +0000)
(elmo-archive-folder-path): Define.
(elmo-folder-initialize): Setup `dir-name' slot.
(elmo-archive-folder-list-subfolders): Fixed problem when `name' is "".
Use `dir-name' as prefix of each subfolders.

elmo/ChangeLog
elmo/elmo-archive.el

index 978e04c..450ea7c 100644 (file)
@@ -1,3 +1,11 @@
+2001-12-14  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-archive.el (elmo-archive-folder): Added `dir-name' slot.
+       (elmo-archive-folder-path): Define.
+       (elmo-folder-initialize): Setup `dir-name' slot.
+       (elmo-archive-folder-list-subfolders): Fixed problem when `name' is "".
+       Use `dir-name' as prefix of each subfolders.
+
 2001-12-13  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * elmo-pipe.el (elmo-pipe-folder-copied-filename): New variable.
index a889c64..7a888be 100644 (file)
 ;;; ELMO Local directory folder
 (eval-and-compile
   (luna-define-class elmo-archive-folder (elmo-folder)
-                    (archive-name archive-type archive-prefix))
+                    (archive-name archive-type archive-prefix dir-name))
   (luna-define-internal-accessors 'elmo-archive-folder))
 
+(luna-define-generic elmo-archive-folder-path (folder)
+  "Return local directory path of the FOLDER.")
+
+(luna-define-method elmo-archive-folder-path ((folder elmo-archive-folder))
+  elmo-archive-folder-path)
+
 (luna-define-method elmo-folder-initialize ((folder
                                             elmo-archive-folder)
                                            name)
+  (elmo-archive-folder-set-dir-name-internal folder name)
   (when (string-match
         "^\\([^;]*\\);?\\([^;]*\\);?\\([^;]*\\)$"
         name)
@@ -485,7 +492,9 @@ TYPE specifies the archiver's symbol."
                       "" (file-name-nondirectory path)))
             (flist (and (file-directory-p dir)
                         (directory-files dir nil
-                                         (concat "^" name "[^A-z][^A-z]")
+                                         (if (> (length name) 0)
+                                             (concat "^" name "[^A-z][^A-z]")
+                                           name)
                                          nil)))
             (regexp (format "^\\(.*\\)\\(%s\\)$"
                             (mapconcat
@@ -511,10 +520,20 @@ TYPE specifies the archiver's symbol."
                       suffix prefix)))
          flist)))
     (elmo-mapcar-list-of-list
-     (function (lambda (x) (concat (elmo-folder-prefix-internal folder) x)))
+     (function (lambda (x)
+                (if (file-exists-p
+                     (expand-file-name 
+                      (concat elmo-archive-basename
+                              (elmo-archive-get-suffix
+                               (elmo-archive-folder-archive-type-internal
+                                folder)))
+                      (expand-file-name
+                       x
+                       (elmo-archive-folder-path folder))))
+                    (concat (elmo-folder-prefix-internal folder) x))))
      (elmo-list-subdirectories
-      (elmo-archive-get-archive-directory folder)
-      ""
+      (elmo-archive-folder-path folder)
+      (or (elmo-archive-folder-dir-name-internal folder) "")
       one-level))))
 
 (luna-define-method elmo-folder-list-subfolders ((folder elmo-archive-folder)