summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/documentwidget.c16
-rw-r--r--src/ui/sidebarwidget.c2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 6c0337a0..8f31c690 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -540,16 +540,16 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse
540 const iString *mimeStr = collect_String(lower_String(&response->meta)); /* for convenience */ 540 const iString *mimeStr = collect_String(lower_String(&response->meta)); /* for convenience */
541 iRangecc mime = range_String(mimeStr); 541 iRangecc mime = range_String(mimeStr);
542 iRangecc seg = iNullRange; 542 iRangecc seg = iNullRange;
543 while (nextSplit_Rangecc(&mime, ";", &seg)) { 543 while (nextSplit_Rangecc(mime, ";", &seg)) {
544 iRangecc param = seg; 544 iRangecc param = seg;
545 trim_Rangecc(&param); 545 trim_Rangecc(&param);
546 if (equal_Rangecc(&param, "text/plain")) { 546 if (equal_Rangecc(param, "text/plain")) {
547 docFormat = plainText_GmDocumentFormat; 547 docFormat = plainText_GmDocumentFormat;
548 } 548 }
549 else if (equal_Rangecc(&param, "text/gemini")) { 549 else if (equal_Rangecc(param, "text/gemini")) {
550 docFormat = gemini_GmDocumentFormat; 550 docFormat = gemini_GmDocumentFormat;
551 } 551 }
552 else if (startsWith_Rangecc(&param, "image/")) { 552 else if (startsWith_Rangecc(param, "image/")) {
553 docFormat = gemini_GmDocumentFormat; 553 docFormat = gemini_GmDocumentFormat;
554 if (!d->request || isFinished_GmRequest(d->request)) { 554 if (!d->request || isFinished_GmRequest(d->request)) {
555 /* Make a simple document with an image. */ 555 /* Make a simple document with an image. */
@@ -568,7 +568,7 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse
568 clear_String(&str); 568 clear_String(&str);
569 } 569 }
570 } 570 }
571 else if (startsWith_Rangecc(&param, "charset=")) { 571 else if (startsWith_Rangecc(param, "charset=")) {
572 charset = (iRangecc){ param.start + 8, param.end }; 572 charset = (iRangecc){ param.start + 8, param.end };
573 /* Remove whitespace and quotes. */ 573 /* Remove whitespace and quotes. */
574 trim_Rangecc(&charset); 574 trim_Rangecc(&charset);
@@ -584,7 +584,7 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse
584 return; 584 return;
585 } 585 }
586 /* Convert the source to UTF-8 if needed. */ 586 /* Convert the source to UTF-8 if needed. */
587 if (!equalCase_Rangecc(&charset, "utf-8")) { 587 if (!equalCase_Rangecc(charset, "utf-8")) {
588 set_String(&str, 588 set_String(&str,
589 collect_String(decode_Block(&str.chars, cstr_Rangecc(charset)))); 589 collect_String(decode_Block(&str.chars, cstr_Rangecc(charset))));
590 } 590 }
@@ -1083,7 +1083,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1083 d->state = ready_RequestState; 1083 d->state = ready_RequestState;
1084 /* The response may be cached. */ { 1084 /* The response may be cached. */ {
1085 const iRangecc proto = urlProtocol_String(d->mod.url); 1085 const iRangecc proto = urlProtocol_String(d->mod.url);
1086 if (!equal_Rangecc(&proto, "about")) { 1086 if (!equal_Rangecc(proto, "about")) {
1087 setCachedResponse_History(d->mod.history, response_GmRequest(d->request)); 1087 setCachedResponse_History(d->mod.history, response_GmRequest(d->request));
1088 } 1088 }
1089 } 1089 }
@@ -1607,7 +1607,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) {
1607 &str, 1607 &str,
1608 " \u2014%s%s%s\r%c%s", 1608 " \u2014%s%s%s\r%c%s",
1609 showHost ? " " : "", 1609 showHost ? " " : "",
1610 showHost ? (!equalCase_Rangecc(&parts.protocol, "gemini") 1610 showHost ? (!equalCase_Rangecc(parts.protocol, "gemini")
1611 ? format_CStr("%s://%s", 1611 ? format_CStr("%s://%s",
1612 cstr_Rangecc(parts.protocol), 1612 cstr_Rangecc(parts.protocol),
1613 cstr_Rangecc(parts.host)) 1613 cstr_Rangecc(parts.host))
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 066386cb..82efb04e 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -719,7 +719,7 @@ static void draw_SidebarWidget_(const iSidebarWidget *d) {
719 else { 719 else {
720 iUrl parts; 720 iUrl parts;
721 init_Url(&parts, &item->url); 721 init_Url(&parts, &item->url);
722 const iBool isGemini = equalCase_Rangecc(&parts.protocol, "gemini"); 722 const iBool isGemini = equalCase_Rangecc(parts.protocol, "gemini");
723 draw_Text( 723 draw_Text(
724 font, 724 font,
725 add_I2(topLeft_Rect(itemRect), 725 add_I2(topLeft_Rect(itemRect),