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

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

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

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

@ -38,7 +38,8 @@ namespace app::browser::main::tab::page @@ -38,7 +38,8 @@ namespace app::browser::main::tab::page
// Actions
void history_add(
const Glib::ustring & REQUEST
const Glib::ustring & REQUEST,
const bool & FOLLOW
);
void refresh();
@ -57,12 +58,15 @@ namespace app::browser::main::tab::page @@ -57,12 +58,15 @@ namespace app::browser::main::tab::page
Glib::ustring get_request_path();
Glib::ustring get_request_query();
// Actionable getters
bool try_history_back(
Glib::ustring & request
Glib::ustring & request,
const bool & FOLLOW
);
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 @@ -42,7 +42,7 @@ namespace app::browser::main::tab::page::navigation
// Actions
void add(
const Glib::ustring & REQUEST,
const bool & FOLLOW = true
const bool & FOLLOW
);
void refresh();
@ -51,12 +51,12 @@ namespace app::browser::main::tab::page::navigation @@ -51,12 +51,12 @@ namespace app::browser::main::tab::page::navigation
bool try_back(
Memory & match,
const bool & FOLLOW = true
const bool & FOLLOW
);
bool try_forward(
Memory & match,
const bool & FOLLOW = true
const bool & FOLLOW
);
};
}

Loading…
Cancel
Save