Browse Source

remove default values, add follow argument

CPP-GTK4
yggverse 2 months ago
parent
commit
ab0c28badf
  1. 7
      src/app/browser/main/tab/page.cpp
  2. 17
      src/app/browser/main/tab/page/navigation.cpp
  3. 10
      src/app/browser/main/tab/page/navigation.hpp
  4. 6
      src/app/browser/main/tab/page/navigation/history.hpp

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

@ -78,7 +78,8 @@ void Page::navigation_update(
if (ADD_HISTORY) if (ADD_HISTORY)
{ {
pageNavigation->history_add( pageNavigation->history_add(
pageNavigation->get_request_text() pageNavigation->get_request_text(),
true
); );
} }
@ -246,7 +247,7 @@ void Page::navigation_history_back()
{ {
Glib::ustring request; Glib::ustring request;
if (pageNavigation->try_history_back(request)) if (pageNavigation->try_history_back(request, true))
{ {
pageNavigation->set_request_text( pageNavigation->set_request_text(
request request
@ -262,7 +263,7 @@ void Page::navigation_history_forward()
{ {
Glib::ustring request; Glib::ustring request;
if (pageNavigation->try_history_forward(request)) if (pageNavigation->try_history_forward(request, true))
{ {
pageNavigation->set_request_text( pageNavigation->set_request_text(
request request

17
src/app/browser/main/tab/page/navigation.cpp

@ -88,10 +88,12 @@ Navigation::Navigation(
// Actions // Actions
void Navigation::history_add( void Navigation::history_add(
const Glib::ustring & REQUEST const Glib::ustring & REQUEST,
const bool & FOLLOW
) { ) {
navigationHistory->add( navigationHistory->add(
REQUEST REQUEST,
FOLLOW
); );
} }
@ -153,12 +155,14 @@ Glib::ustring Navigation::get_request_port()
return navigationRequest->get_port(); return navigationRequest->get_port();
} }
// Actionable getters
bool Navigation::try_history_back( bool Navigation::try_history_back(
Glib::ustring & request Glib::ustring & request,
const bool & FOLLOW
) { ) {
navigation::History::Memory match; navigation::History::Memory match;
if (navigationHistory->try_back(match)) if (navigationHistory->try_back(match, FOLLOW))
{ {
request = match.request; request = match.request;
@ -169,11 +173,12 @@ bool Navigation::try_history_back(
} }
bool Navigation::try_history_forward( bool Navigation::try_history_forward(
Glib::ustring & request Glib::ustring & request,
const bool & FOLLOW
) { ) {
navigation::History::Memory match; navigation::History::Memory match;
if (navigationHistory->try_forward(match)) if (navigationHistory->try_forward(match, FOLLOW))
{ {
request = match.request; request = match.request;

10
src/app/browser/main/tab/page/navigation.hpp

@ -38,7 +38,8 @@ namespace app::browser::main::tab::page
// Actions // Actions
void history_add( void history_add(
const Glib::ustring & REQUEST const Glib::ustring & REQUEST,
const bool & FOLLOW
); );
void refresh(); void refresh();
@ -57,12 +58,15 @@ namespace app::browser::main::tab::page
Glib::ustring get_request_path(); Glib::ustring get_request_path();
Glib::ustring get_request_query(); Glib::ustring get_request_query();
// Actionable getters
bool try_history_back( bool try_history_back(
Glib::ustring & request Glib::ustring & request,
const bool & FOLLOW
); );
bool try_history_forward( bool try_history_forward(
Glib::ustring & request Glib::ustring & request,
const bool & FOLLOW
); );
}; };
} }

6
src/app/browser/main/tab/page/navigation/history.hpp

@ -42,7 +42,7 @@ namespace app::browser::main::tab::page::navigation
// Actions // Actions
void add( void add(
const Glib::ustring & REQUEST, const Glib::ustring & REQUEST,
const bool & FOLLOW = true const bool & FOLLOW
); );
void refresh(); void refresh();
@ -51,12 +51,12 @@ namespace app::browser::main::tab::page::navigation
bool try_back( bool try_back(
Memory & match, Memory & match,
const bool & FOLLOW = true const bool & FOLLOW
); );
bool try_forward( bool try_forward(
Memory & match, Memory & match,
const bool & FOLLOW = true const bool & FOLLOW
); );
}; };
} }

Loading…
Cancel
Save