From 24711d5688b0bf26b8bbd571a0791855e7937692 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 27 Aug 2024 21:37:10 +0300 Subject: [PATCH] enshort constructions --- src/app/browser/main/tab/page.cpp | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index 05e798a4..358795de 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -129,7 +129,7 @@ void Page::update() [this](const Glib::RefPtr & result) { set( - _("Connected.."), + _("Connect.."), pageNavbar->get_request_host(), .25 ); @@ -139,11 +139,11 @@ void Page::update() ); // Request - const Glib::ustring navbar_request_text = pageNavbar->get_request_text() + "\r\n"; + const Glib::ustring request = pageNavbar->get_request_text() + "\r\n"; GioSocketConnection_RefPtr->get_output_stream()->write_async( - navbar_request_text.data(), - navbar_request_text.size(), + request.data(), + request.size(), [this](const Glib::RefPtr & result) { set( @@ -212,26 +212,10 @@ void Page::update() } // Scheme not found but host provided, redirect to gemini:// - else if (!pageNavbar->get_request_host().empty()) + else if (pageNavbar->get_request_scheme().empty() && !pageNavbar->get_request_host().empty()) { - Glib::ustring navbar_request_text = "gemini://"; - - navbar_request_text += pageNavbar->get_request_host(); // @TODO validate - - if (!pageNavbar->get_request_port().empty()) - { - navbar_request_text += pageNavbar->get_request_port(); - } - - navbar_request_text += pageNavbar->get_request_path(); - - if (!pageNavbar->get_request_query().empty()) - { - navbar_request_text += "?" + pageNavbar->get_request_query(); - } - pageNavbar->set_request_text( - navbar_request_text + "gemini://" + pageNavbar->get_request_text() ); update();