Changeset 16202


Ignore:
Timestamp:
Sep 16, 2014, 5:27:36 PM (5 years ago)
Author:
plkrueger
Message:

Bug Fixes to Cocoa Tools contrib

Location:
trunk/cocoa-ide-contrib/krueger/InterfaceProjects
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/cocoa-ide-contrib/krueger/InterfaceProjects/Cocoa Dev/lisp-app-doc.lisp

    r16178 r16202  
    944944              (when exts
    945945                (setf dt-file-ext (array-to-string exts))))
    946             (setf dt-owner-for-doc (if (string= (gethash "LSHandlerRank" dt-ht 0) "Owner") t nil))
     946            (setf dt-owner-for-doc (if (string= (gethash "LSHandlerRank" dt-ht "") "Owner") t nil))
    947947            (setf dt-doc-class (string-downcase (ns-to-lisp-classname (gethash "NSDocumentClass" dt-ht nil) dt-doc-class)))
    948948   
     
    10091009         (ns-plist (#/dictionaryWithContentsOfFile: ns:ns-mutable-dictionary pl-path)))
    10101010    (setf (app-info-plist self)
    1011           (ns-to-lisp-hash-table ns-plist))
     1011          (ns-to-lisp-hash-table ns-plist :test 'equal))
    10121012    (setf (app-info-plist-date self) (file-write-date path))))
    10131013   
  • trunk/cocoa-ide-contrib/krueger/InterfaceProjects/Utilities/lisp-doc-controller.lisp

    r15808 r16202  
    173173    (gethash doc-type-str doc-type-dc-hash nil))
    174174
     175  (defun controlled-doc-types ()
     176    (let ((types nil))
     177      (maphash #'(lambda (k v)
     178                   (declare (ignore v))
     179                   (push k types))
     180               doc-type-dc-hash)
     181      types))
     182
    175183)
    176184
  • trunk/cocoa-ide-contrib/krueger/InterfaceProjects/Utilities/ns-object-utils.lisp

    r16178 r16202  
    3939
    4040(defvar *debug-convert* nil)
    41 
     41(defvar *minimal-hash-table-encoding* nil)
    4242
    4343;;;;;;;;;;;;;;;;;;;;;;;
     
    614614;; Methods dealing with NSDictionary objects
    615615
    616 (defmethod ns-to-lisp-hash-table ((dict ns:ns-dictionary) &key (element-class nil))
     616(defmethod ns-to-lisp-hash-table ((dict ns:ns-dictionary) &key (element-class nil) (test nil))
    617617  (let* ((dict-keys (ns-to-lisp-list (#/allKeys dict)
    618618                                                     :element-class ns:ns-object))
     
    620620         (tab-size (if (%null-ptr-p ts) 60 (ns-to-lisp-object ts)))
    621621         (tt (#/objectForKey: dict (lisp-to-ns-object "hash-table-test")))
    622          (tab-test (if (%null-ptr-p tt) 'eql (ns-to-lisp-object tt)))
     622         (tab-test (or test (if (%null-ptr-p tt) 'eql (ns-to-lisp-object tt))))
    623623         (trs (#/objectForKey: dict (lisp-to-ns-object "hash-table-rehash-size")))
    624624         (tab-rehash-size (if (%null-ptr-p trs) 1.5 (ns-to-lisp-object trs)))
     
    661661
    662662(defmethod lisp-to-ns-plist-dict ((ht hash-table))
     663  ;; arrays put in info.plist files have become picky about allowing any fields that
     664  ;; are not expected, so we can't add extraneous fields to support hash table attributes
     665  ;; because the write to the info.plist file will fail. So this routing does a vanilla
     666  ;; encoding of any hash-table that we used in lisp that will end up as part of an info
     667  ;; plist file. That includes any sub-fields.
    663668  (let* ((count (hash-table-count ht))
    664          (new-dict (#/dictionaryWithCapacity: ns:ns-mutable-dictionary count)))
     669         (new-dict (#/dictionaryWithCapacity: ns:ns-mutable-dictionary count))
     670         (*minimal-hash-table-encoding* t))
    665671    (maphash #'(lambda (key val)
    666672                 (#/setObject:forKey: new-dict
     
    687693                                      (lisp-to-ns-object key)))
    688694             ht)
    689     (#/setObject:forKey: new-dict
    690                          (lisp-to-ns-object (hash-table-size ht))
    691                          (lisp-to-ns-object "hash-table-size"))
    692     (#/setObject:forKey: new-dict
    693                          (lisp-to-ns-object (hash-table-test ht))
    694                          (lisp-to-ns-object "hash-table-test"))
    695     (#/setObject:forKey: new-dict
    696                          (lisp-to-ns-object (hash-table-rehash-size ht))
    697                          (lisp-to-ns-object "hash-table-rehash-size"))
    698     (#/setObject:forKey: new-dict
    699                          (lisp-to-ns-object (hash-table-rehash-threshold ht))
    700                          (lisp-to-ns-object "hash-table-rehash-threshold"))
     695    (unless *minimal-hash-table-encoding*
     696      (#/setObject:forKey: new-dict
     697                           (lisp-to-ns-object (hash-table-size ht))
     698                           (lisp-to-ns-object "hash-table-size"))
     699      (#/setObject:forKey: new-dict
     700                           (lisp-to-ns-object (hash-table-test ht))
     701                           (lisp-to-ns-object "hash-table-test"))
     702      (#/setObject:forKey: new-dict
     703                           (lisp-to-ns-object (hash-table-rehash-size ht))
     704                           (lisp-to-ns-object "hash-table-rehash-size"))
     705      (#/setObject:forKey: new-dict
     706                           (lisp-to-ns-object (hash-table-rehash-threshold ht))
     707                           (lisp-to-ns-object "hash-table-rehash-threshold")))
    701708    new-dict))
    702709
Note: See TracChangeset for help on using the changeset viewer.