diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-27 02:48:21 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-27 02:51:41 +0200 |
commit | ac3e737867245ac65adfa2352ce6e7fdacc57b18 (patch) | |
tree | e747a5891176c7dce618bafaf79d750d5a40416f /src/local/container.nim | |
parent | 285b6f32c28d1cda403ba33bfb2d22c34fab2a1e (diff) | |
download | chawan-ac3e737867245ac65adfa2352ce6e7fdacc57b18.tar.gz |
buffer: simplify contentType handling
* remove contentType member of Buffer object * add ishtml to reduce string comparisons * consistent spelling: contenttype -> contentType
Diffstat (limited to 'src/local/container.nim')
-rw-r--r-- | src/local/container.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/local/container.nim b/src/local/container.nim index fb48e89e..ad98419d 100644 --- a/src/local/container.nim +++ b/src/local/container.nim @@ -181,7 +181,7 @@ func charset*(container: Container): Charset = return container.source.charset func contentType*(container: Container): Option[string] {.jsfget.} = - return container.source.contenttype + return container.source.contentType func lineLoaded(container: Container, y: int): bool = return y - container.lineshift in 0..container.lines.high @@ -836,9 +836,9 @@ proc load(container: Container) = "application/octet-stream", container.config.mimeTypes) if contentType != "application/octet-stream": container.iface.setContentType(contentType) - container.source.contenttype = some(contentType) - elif res.contentType != "": - container.source.contenttype = some(res.contentType) + container.source.contentType = some(contentType) + else: + container.source.contentType = some(res.contentType) container.triggerEvent(CHECK_MAILCAP) else: container.setLoadInfo("") |