Adjust qif-dialog-utils to new namespaces

For US users it will no longer distinguish between NASDAQ and NYSE but
map both to SHARE for new commodities.
This commit is contained in:
Frank H. Ellenberger 2021-07-08 21:23:17 +02:00 committed by John Ralls
parent c7f842c081
commit 716d746315

View File

@ -736,7 +736,7 @@
;; compatible with the QIF type? ;; compatible with the QIF type?
(and (string=? s (caddr elt)) (and (string=? s (caddr elt))
(not (and (string? qif-type) (not (and (string? qif-type)
(string=? GNC_COMMODITY_NS_MUTUAL (string=? (GNC-COMMODITY-NS-MUTUAL)
(cadr elt)) (cadr elt))
(or (string-ci=? qif-type "stock") (or (string-ci=? qif-type "stock")
(string-ci=? qif-type "etf")))))) (string-ci=? qif-type "etf"))))))
@ -747,27 +747,15 @@
(pref-match (pref-match
(cadr pref-match)) (cadr pref-match))
;; Guess NYSE for symbols of 1-3 characters. ;; Guess SHARE for symbols of 1-4 characters.
((< l 4) ((<= l 4)
GNC_COMMODITY_NS_NYSE) (GNC-COMMODITY-NS-SHARE))
;; Guess NYSE for symbols of 1-3 characters
;; followed by a dot and 1-2 characters.
((and d
(< l 7)
(< 0 d 4)
(<= 2 (- l d) 3))
GNC_COMMODITY_NS_NYSE)
;; Guess NASDAQ for symbols of 4 characters.
((= l 4)
GNC_COMMODITY_NS_NASDAQ)
;; Otherwise it's probably a fund. ;; Otherwise it's probably a fund.
(else (else
GNC_COMMODITY_NS_MUTUAL))) (GNC-COMMODITY-NS-MUTUAL))))
;; There's no symbol. Default to a fund. ;; There's no symbol. Default to a fund.
GNC_COMMODITY_NS_MUTUAL)) (GNC-COMMODITY-NS-MUTUAL)))
;; Was a QIF type given? ;; Was a QIF type given?
(if (string? qif-type) (if (string? qif-type)
@ -775,12 +763,12 @@
(cond (cond
;; Mutual fund ;; Mutual fund
((string-ci=? qif-type "mutual fund") ((string-ci=? qif-type "mutual fund")
GNC_COMMODITY_NS_MUTUAL) (GNC-COMMODITY-NS-MUTUAL))
;; Index ;; Index
((string-ci=? qif-type "index") ((string-ci=? qif-type "index")
;; This QIF type must be wrong; indexes aren't tradable! ;; This QIF type must be wrong; indexes aren't tradable!
GNC_COMMODITY_NS_MUTUAL) (GNC-COMMODITY-NS-MUTUAL))
(else (else
(guess-by-symbol qif-symbol))) (guess-by-symbol qif-symbol)))