diff --git a/src/app/browser/main/tab/page/navbar/history.cpp b/src/app/browser/main/tab/page/navbar/history.cpp index e8b7f50b..a6db4abd 100644 --- a/src/app/browser/main/tab/page/navbar/history.cpp +++ b/src/app/browser/main/tab/page/navbar/history.cpp @@ -31,9 +31,20 @@ History::~History() // Actions void History::push( - const Glib::ustring & VALUE + const Glib::ustring & REQUEST ) { - // @TODO + if (memory.empty() || memory.back().request != REQUEST) + { + memory.push_back( + { + REQUEST, + std::time( + nullptr + ), + true + } + ); + } } void History::refresh() diff --git a/src/app/browser/main/tab/page/navbar/history.hpp b/src/app/browser/main/tab/page/navbar/history.hpp index 81021628..ded9791f 100644 --- a/src/app/browser/main/tab/page/navbar/history.hpp +++ b/src/app/browser/main/tab/page/navbar/history.hpp @@ -1,6 +1,7 @@ #ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP #define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP +#include #include #include #include @@ -16,9 +17,16 @@ namespace app::browser::main::tab::page::navbar class History : public Gtk::Box { - // Memory - std::vector history; - std::vector::iterator index; + // Extras + struct Memory + { + Glib::ustring request; + std::time_t time; // event unix time + bool permanent; // save in database (on application close) @TODO + }; + + std::vector memory; + std::vector::iterator memory_index; // Components history::Back * historyBack; @@ -31,7 +39,7 @@ namespace app::browser::main::tab::page::navbar ~History(); void push( - const Glib::ustring & VALUE + const Glib::ustring & REQUEST ); void refresh();