Browse Source

use entire uri pointer

CPP-GTK4
yggverse 3 months ago
parent
commit
4c0cb8c6f0
  1. 4
      src/app/browser/main/tab/page.cpp
  2. 8
      src/app/browser/main/tab/page/content.cpp
  3. 4
      src/app/browser/main/tab/page/content.hpp
  4. 8
      src/app/browser/main/tab/page/content/text.cpp
  5. 4
      src/app/browser/main/tab/page/content/text.hpp
  6. 8
      src/app/browser/main/tab/page/content/text/gemini.cpp
  7. 4
      src/app/browser/main/tab/page/content/text/gemini.hpp
  8. 8
      src/app/browser/main/tab/page/content/text/gemini/reader.cpp
  9. 6
      src/app/browser/main/tab/page/content/text/gemini/reader.hpp

4
src/app/browser/main/tab/page.cpp

@ -351,8 +351,8 @@ void Page::navigation_reload(
// Set content driver // Set content driver
pageContent->update( pageContent->update(
page::Content::TEXT_GEMINI, page::Content::TEXT_GEMINI,
pageNavigation->get_request_text(), // @TODO use current page URI parsed instead of request able to change after buffer,
buffer uri
); );
// Update title on detected by document provider // Update title on detected by document provider

8
src/app/browser/main/tab/page/content.cpp

@ -40,8 +40,8 @@ Glib::ustring Content::get_title()
// Setters // Setters
void Content::update( void Content::update(
const MIME & MIME, const MIME & MIME,
const Glib::ustring & REQUEST, const Glib::ustring & SOURCE,
const Glib::ustring & SOURCE GUri * uri
) { ) {
// Cleanup, free memory // Cleanup, free memory
if (contentText != nullptr) if (contentText != nullptr)
@ -64,8 +64,8 @@ void Content::update(
contentText = new content::Text( contentText = new content::Text(
content::Text::Type::GEMINI, content::Text::Type::GEMINI,
REQUEST, SOURCE,
SOURCE uri
); );
title = contentText->get_title(); title = contentText->get_title();

4
src/app/browser/main/tab/page/content.hpp

@ -42,8 +42,8 @@ namespace app::browser::main::tab::page
// Actions // Actions
void update( void update(
const MIME & MIME, const MIME & MIME,
const Glib::ustring & REQUEST, const Glib::ustring & SOURCE,
const Glib::ustring & SOURCE GUri * uri
); );
// Getters // Getters

8
src/app/browser/main/tab/page/content/text.cpp

@ -6,8 +6,8 @@ using namespace app::browser::main::tab::page::content;
Text::Text( Text::Text(
const Type & TYPE, const Type & TYPE,
const Glib::ustring & REQUEST, const Glib::ustring & SOURCE,
const Glib::ustring & SOURCE GUri * uri
) { ) {
switch (TYPE) switch (TYPE)
{ {
@ -15,9 +15,9 @@ Text::Text(
set_child( set_child(
* Gtk::make_managed<text::Gemini>( * Gtk::make_managed<text::Gemini>(
REQUEST,
SOURCE, SOURCE,
title title,
uri
) )
); );

4
src/app/browser/main/tab/page/content/text.hpp

@ -30,8 +30,8 @@ namespace app::browser::main::tab::page::content
*/ */
Text( Text(
const Type & TYPE, const Type & TYPE,
const Glib::ustring & REQUEST, const Glib::ustring & SOURCE,
const Glib::ustring & SOURCE GUri * uri
); );
// Getters // Getters

8
src/app/browser/main/tab/page/content/text/gemini.cpp

@ -4,9 +4,9 @@
using namespace app::browser::main::tab::page::content::text; using namespace app::browser::main::tab::page::content::text;
Gemini::Gemini( Gemini::Gemini(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT, const Glib::ustring & GEMTEXT,
Glib::ustring & title Glib::ustring & title,
GUri * uri
) : Gtk::Viewport( // add scrolled window features to childs ) : Gtk::Viewport( // add scrolled window features to childs
NULL, NULL,
NULL NULL
@ -18,9 +18,9 @@ Gemini::Gemini(
set_child( set_child(
* Gtk::make_managed<gemini::Reader>( * Gtk::make_managed<gemini::Reader>(
REQUEST,
GEMTEXT, GEMTEXT,
title title,
uri
) )
); );
} }

4
src/app/browser/main/tab/page/content/text/gemini.hpp

@ -14,9 +14,9 @@ namespace app::browser::main::tab::page::content::text
public: public:
Gemini( Gemini(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT, const Glib::ustring & GEMTEXT,
Glib::ustring & title Glib::ustring & title,
GUri * uri
); );
}; };
} }

8
src/app/browser/main/tab/page/content/text/gemini/reader.cpp

@ -3,9 +3,9 @@
using namespace app::browser::main::tab::page::content::text::gemini; using namespace app::browser::main::tab::page::content::text::gemini;
Reader::Reader( Reader::Reader(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT, const Glib::ustring & GEMTEXT,
Glib::ustring & title Glib::ustring & title,
GUri * base
) { ) {
// Build markup // Build markup
Glib::ustring markup; Glib::ustring markup;
@ -48,7 +48,9 @@ Reader::Reader(
{ {
markup.append( markup.append(
Make::link( Make::link(
REQUEST, g_uri_to_string(
base
),
address, address,
date, date,
alt alt

6
src/app/browser/main/tab/page/content/text/gemini/reader.hpp

@ -48,7 +48,7 @@ namespace app::browser::main::tab::page::content::text::gemini
); );
static Glib::ustring link( static Glib::ustring link(
const Glib::ustring & REQUEST, const Glib::ustring & BASE,
const Glib::ustring & ADDRESS, const Glib::ustring & ADDRESS,
const Glib::ustring & DATE, const Glib::ustring & DATE,
const Glib::ustring & ALT const Glib::ustring & ALT
@ -69,9 +69,9 @@ namespace app::browser::main::tab::page::content::text::gemini
public: public:
Reader( Reader(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT, const Glib::ustring & GEMTEXT,
Glib::ustring & title Glib::ustring & title,
GUri * uri
); );
}; };
} }

Loading…
Cancel
Save