diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index 1e5e4832..705c6d28 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -351,6 +351,7 @@ void Page::navigation_reload( // Set content driver pageContent->update( page::Content::TEXT_GEMINI, + pageNavigation->get_request_text(), buffer ); diff --git a/src/app/browser/main/tab/page/content.cpp b/src/app/browser/main/tab/page/content.cpp index ac8938fc..7281b8d1 100644 --- a/src/app/browser/main/tab/page/content.cpp +++ b/src/app/browser/main/tab/page/content.cpp @@ -40,7 +40,8 @@ Glib::ustring Content::get_title() // Setters void Content::update( const MIME & MIME, - const Glib::ustring & DATA + const Glib::ustring & REQUEST, + const Glib::ustring & SOURCE ) { // Cleanup, free memory if (contentText != nullptr) @@ -63,7 +64,8 @@ void Content::update( contentText = new content::Text( content::Text::Type::GEMINI, - DATA + REQUEST, + SOURCE ); title = contentText->get_title(); diff --git a/src/app/browser/main/tab/page/content.hpp b/src/app/browser/main/tab/page/content.hpp index 9294b37a..e9185ff4 100644 --- a/src/app/browser/main/tab/page/content.hpp +++ b/src/app/browser/main/tab/page/content.hpp @@ -42,7 +42,8 @@ namespace app::browser::main::tab::page // Actions void update( const MIME & MIME, - const Glib::ustring & DATA + const Glib::ustring & REQUEST, + const Glib::ustring & SOURCE ); // Getters diff --git a/src/app/browser/main/tab/page/content/text.cpp b/src/app/browser/main/tab/page/content/text.cpp index 0b8c66db..64ec1dd7 100644 --- a/src/app/browser/main/tab/page/content/text.cpp +++ b/src/app/browser/main/tab/page/content/text.cpp @@ -6,7 +6,8 @@ using namespace app::browser::main::tab::page::content; Text::Text( const Type & TYPE, - const Glib::ustring & TEXT + const Glib::ustring & REQUEST, + const Glib::ustring & SOURCE ) { switch (TYPE) { @@ -14,7 +15,8 @@ Text::Text( set_child( * Gtk::make_managed( - TEXT, + REQUEST, + SOURCE, title ) ); @@ -25,7 +27,7 @@ Text::Text( set_child( * Gtk::make_managed( - TEXT + SOURCE ) ); diff --git a/src/app/browser/main/tab/page/content/text.hpp b/src/app/browser/main/tab/page/content/text.hpp index 667ca6dd..9eb0563f 100644 --- a/src/app/browser/main/tab/page/content/text.hpp +++ b/src/app/browser/main/tab/page/content/text.hpp @@ -30,7 +30,8 @@ namespace app::browser::main::tab::page::content */ Text( const Type & TYPE, - const Glib::ustring & TEXT + const Glib::ustring & REQUEST, + const Glib::ustring & SOURCE ); // Getters diff --git a/src/app/browser/main/tab/page/content/text/gemini.cpp b/src/app/browser/main/tab/page/content/text/gemini.cpp index 2a4b0532..2f851620 100644 --- a/src/app/browser/main/tab/page/content/text/gemini.cpp +++ b/src/app/browser/main/tab/page/content/text/gemini.cpp @@ -4,6 +4,7 @@ using namespace app::browser::main::tab::page::content::text; Gemini::Gemini( + const Glib::ustring & REQUEST, const Glib::ustring & GEMTEXT, Glib::ustring & title ) : Gtk::Viewport( // add scrolled window features to childs @@ -17,6 +18,7 @@ Gemini::Gemini( set_child( * Gtk::make_managed( + REQUEST, GEMTEXT, title ) diff --git a/src/app/browser/main/tab/page/content/text/gemini.hpp b/src/app/browser/main/tab/page/content/text/gemini.hpp index 4cc0a5f4..48008345 100644 --- a/src/app/browser/main/tab/page/content/text/gemini.hpp +++ b/src/app/browser/main/tab/page/content/text/gemini.hpp @@ -14,6 +14,7 @@ namespace app::browser::main::tab::page::content::text public: Gemini( + const Glib::ustring & REQUEST, const Glib::ustring & GEMTEXT, Glib::ustring & title ); diff --git a/src/app/browser/main/tab/page/content/text/gemini/reader.cpp b/src/app/browser/main/tab/page/content/text/gemini/reader.cpp index 7155b6b5..63bee0d4 100644 --- a/src/app/browser/main/tab/page/content/text/gemini/reader.cpp +++ b/src/app/browser/main/tab/page/content/text/gemini/reader.cpp @@ -3,6 +3,7 @@ using namespace app::browser::main::tab::page::content::text::gemini; Reader::Reader( + const Glib::ustring & REQUEST, const Glib::ustring & GEMTEXT, Glib::ustring & title ) { @@ -47,6 +48,7 @@ Reader::Reader( { markup.append( Make::link( + REQUEST, address, date, alt @@ -245,6 +247,7 @@ Glib::ustring Reader::Make::header( } Glib::ustring Reader::Make::link( + const Glib::ustring & BASE, const Glib::ustring & ADDRESS, const Glib::ustring & DATE, const Glib::ustring & ALT @@ -265,25 +268,15 @@ Glib::ustring Reader::Make::link( ); } - /* @TODO - - GError * error; - - g_uri_resolve_relative( - get_text().c_str(), - get_text().c_str(), - G_URI_FLAGS_NONE, - &error - ); - - if (NULL) - - */ - return Glib::ustring::sprintf( "%s\n", Glib::Markup::escape_text( - ADDRESS // @TODO to absolute + g_uri_resolve_relative( + BASE.c_str(), + ADDRESS.c_str(), + G_URI_FLAGS_NONE, + NULL // GError * @TODO + ) ), Glib::Markup::escape_text( ADDRESS diff --git a/src/app/browser/main/tab/page/content/text/gemini/reader.hpp b/src/app/browser/main/tab/page/content/text/gemini/reader.hpp index f3991376..3251abf5 100644 --- a/src/app/browser/main/tab/page/content/text/gemini/reader.hpp +++ b/src/app/browser/main/tab/page/content/text/gemini/reader.hpp @@ -48,6 +48,7 @@ namespace app::browser::main::tab::page::content::text::gemini ); static Glib::ustring link( + const Glib::ustring & REQUEST, const Glib::ustring & ADDRESS, const Glib::ustring & DATE, const Glib::ustring & ALT @@ -68,6 +69,7 @@ namespace app::browser::main::tab::page::content::text::gemini public: Reader( + const Glib::ustring & REQUEST, const Glib::ustring & GEMTEXT, Glib::ustring & title );