From 455a635080a1c1c4b164af3060836f0d8c1b3c1c Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 24 Aug 2020 13:15:00 +0300 Subject: Updated for the_Foundation API changes --- src/ui/documentwidget.c | 16 ++++++++-------- src/ui/sidebarwidget.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/ui') 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 const iString *mimeStr = collect_String(lower_String(&response->meta)); /* for convenience */ iRangecc mime = range_String(mimeStr); iRangecc seg = iNullRange; - while (nextSplit_Rangecc(&mime, ";", &seg)) { + while (nextSplit_Rangecc(mime, ";", &seg)) { iRangecc param = seg; trim_Rangecc(¶m); - if (equal_Rangecc(¶m, "text/plain")) { + if (equal_Rangecc(param, "text/plain")) { docFormat = plainText_GmDocumentFormat; } - else if (equal_Rangecc(¶m, "text/gemini")) { + else if (equal_Rangecc(param, "text/gemini")) { docFormat = gemini_GmDocumentFormat; } - else if (startsWith_Rangecc(¶m, "image/")) { + else if (startsWith_Rangecc(param, "image/")) { docFormat = gemini_GmDocumentFormat; if (!d->request || isFinished_GmRequest(d->request)) { /* Make a simple document with an image. */ @@ -568,7 +568,7 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse clear_String(&str); } } - else if (startsWith_Rangecc(¶m, "charset=")) { + else if (startsWith_Rangecc(param, "charset=")) { charset = (iRangecc){ param.start + 8, param.end }; /* Remove whitespace and quotes. */ trim_Rangecc(&charset); @@ -584,7 +584,7 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse return; } /* Convert the source to UTF-8 if needed. */ - if (!equalCase_Rangecc(&charset, "utf-8")) { + if (!equalCase_Rangecc(charset, "utf-8")) { set_String(&str, collect_String(decode_Block(&str.chars, cstr_Rangecc(charset)))); } @@ -1083,7 +1083,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) d->state = ready_RequestState; /* The response may be cached. */ { const iRangecc proto = urlProtocol_String(d->mod.url); - if (!equal_Rangecc(&proto, "about")) { + if (!equal_Rangecc(proto, "about")) { setCachedResponse_History(d->mod.history, response_GmRequest(d->request)); } } @@ -1607,7 +1607,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) { &str, " \u2014%s%s%s\r%c%s", showHost ? " " : "", - showHost ? (!equalCase_Rangecc(&parts.protocol, "gemini") + showHost ? (!equalCase_Rangecc(parts.protocol, "gemini") ? format_CStr("%s://%s", cstr_Rangecc(parts.protocol), 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) { else { iUrl parts; init_Url(&parts, &item->url); - const iBool isGemini = equalCase_Rangecc(&parts.protocol, "gemini"); + const iBool isGemini = equalCase_Rangecc(parts.protocol, "gemini"); draw_Text( font, add_I2(topLeft_Rect(itemRect), -- cgit v1.2.3