summaryrefslogtreecommitdiff
path: root/src/ui/sidebarwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-06-30 08:20:38 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-06-30 08:20:38 +0300
commit73a721fc93c3be7b13361dea41d4431ad14a3fdd (patch)
treee6de1687d1932509789e21ed4232fe2c6def32ad /src/ui/sidebarwidget.c
parent42d461f32eb77a83c0f9d7b4fb202de72c64a97f (diff)
Canonical URIs
Internally, all URIs should be converted to a canonical form so that they can be compared against each other. The canonical form is an IRI with spaces and reserved characters percent-encoded.
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r--src/ui/sidebarwidget.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index c0a22e99..4c2a9d64 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -217,7 +217,7 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) {
217 iBool isEmpty = iFalse; /* show blank? */ 217 iBool isEmpty = iFalse; /* show blank? */
218 switch (d->mode) { 218 switch (d->mode) {
219 case feeds_SidebarMode: { 219 case feeds_SidebarMode: {
220 const iString *docUrl = withSpacesEncoded_String(url_DocumentWidget(document_App())); 220 const iString *docUrl = canonicalUrl_String(url_DocumentWidget(document_App()));
221 /* TODO: internal URI normalization */ 221 /* TODO: internal URI normalization */
222 iTime now; 222 iTime now;
223 iDate on; 223 iDate on;
@@ -1111,7 +1111,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)
1111 else if (isCommand_Widget(w, ev, "bookmark.copy")) { 1111 else if (isCommand_Widget(w, ev, "bookmark.copy")) {
1112 const iSidebarItem *item = d->contextItem; 1112 const iSidebarItem *item = d->contextItem;
1113 if (d->mode == bookmarks_SidebarMode && item) { 1113 if (d->mode == bookmarks_SidebarMode && item) {
1114 SDL_SetClipboardText(cstr_String(withSpacesEncoded_String(&item->url))); 1114 SDL_SetClipboardText(cstr_String(canonicalUrl_String(&item->url)));
1115 } 1115 }
1116 return iTrue; 1116 return iTrue;
1117 } 1117 }
@@ -1374,7 +1374,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)
1374 else if (isCommand_Widget(w, ev, "history.copy")) { 1374 else if (isCommand_Widget(w, ev, "history.copy")) {
1375 const iSidebarItem *item = d->contextItem; 1375 const iSidebarItem *item = d->contextItem;
1376 if (item && !isEmpty_String(&item->url)) { 1376 if (item && !isEmpty_String(&item->url)) {
1377 SDL_SetClipboardText(cstr_String(withSpacesEncoded_String(&item->url))); 1377 SDL_SetClipboardText(cstr_String(canonicalUrl_String(&item->url)));
1378 } 1378 }
1379 return iTrue; 1379 return iTrue;
1380 } 1380 }