From 5cfd7247ae3b97d42079d5588b3b8c97db138625 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 26 Aug 2024 22:55:51 +0300 Subject: [PATCH] update variables namespace format --- src/app/browser/main/tab/page/navbar.cpp | 58 ++++++++++++------------ src/app/browser/main/tab/page/navbar.hpp | 14 ++---- 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/app/browser/main/tab/page/navbar.cpp b/src/app/browser/main/tab/page/navbar.cpp index 66584eb4..0f5b9ef1 100644 --- a/src/app/browser/main/tab/page/navbar.cpp +++ b/src/app/browser/main/tab/page/navbar.cpp @@ -36,43 +36,43 @@ Navbar::Navbar( ); // Init components - base = new navbar::Base(); + navbarBase = new navbar::Base(); append( - * base + * navbarBase ); - history = new navbar::History(); + navbarHistory = new navbar::History(); append( - * history + * navbarHistory ); - update = new navbar::Update(); + navbarUpdate = new navbar::Update(); append( - * update + * navbarUpdate ); - request = new navbar::Request( + navbarRequest = new navbar::Request( request_text ); append( - * request + * navbarRequest ); - bookmark = new navbar::Bookmark(); + navbarBookmark = new navbar::Bookmark(); append( - * bookmark + * navbarBookmark ); // Init actions group - action_group = Gio::SimpleActionGroup::create(); + auto GioSimpleActionGroup_RefPtr = Gio::SimpleActionGroup::create(); // Define group actions - action_group->add_action( + GioSimpleActionGroup_RefPtr->add_action( "refresh", [this] { @@ -82,30 +82,30 @@ Navbar::Navbar( insert_action_group( "navbar", - action_group + GioSimpleActionGroup_RefPtr ); } Navbar::~Navbar() { - delete base; - delete bookmark; - delete history; - delete request; - delete update; + delete navbarBase; + delete navbarBookmark; + delete navbarHistory; + delete navbarRequest; + delete navbarUpdate; }; // Actions void Navbar::refresh() { // Toggle base button sensibility - base->set_sensitive( - !request->get_host().empty() && !request->get_path().empty() + navbarBase->set_sensitive( + !navbarRequest->get_host().empty() && !navbarRequest->get_path().empty() ); // Toggle update button sensibility - update->set_sensitive( - (bool) request->get_text_length() + navbarUpdate->set_sensitive( + navbarRequest->get_text_length() > 0 ); } @@ -113,7 +113,7 @@ void Navbar::refresh() void Navbar::set_request_text( const Glib::ustring & value ) { - request->set_text( + navbarRequest->set_text( value ); @@ -123,30 +123,30 @@ void Navbar::set_request_text( // Getters Glib::ustring Navbar::get_request_text() { - return request->get_text(); + return navbarRequest->get_text(); } Glib::ustring Navbar::get_request_scheme() { - return request->get_scheme(); + return navbarRequest->get_scheme(); } Glib::ustring Navbar::get_request_host() { - return request->get_host(); + return navbarRequest->get_host(); } Glib::ustring Navbar::get_request_path() { - return request->get_path(); + return navbarRequest->get_path(); } Glib::ustring Navbar::get_request_query() { - return request->get_query(); + return navbarRequest->get_query(); } Glib::ustring Navbar::get_request_port() { - return request->get_port(); + return navbarRequest->get_port(); } \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar.hpp b/src/app/browser/main/tab/page/navbar.hpp index 1b717d4f..2c397335 100644 --- a/src/app/browser/main/tab/page/navbar.hpp +++ b/src/app/browser/main/tab/page/navbar.hpp @@ -2,7 +2,6 @@ #define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HPP #include -#include #include #include @@ -19,15 +18,12 @@ namespace app::browser::main::tab::page class Navbar : public Gtk::Box { - // Actions - Glib::RefPtr action_group; - // Components - navbar::Base * base; - navbar::Bookmark * bookmark; - navbar::History * history; - navbar::Request * request; - navbar::Update * update; + navbar::Base * navbarBase; + navbar::Bookmark * navbarBookmark; + navbar::History * navbarHistory; + navbar::Request * navbarRequest; + navbar::Update * navbarUpdate; // Defaults const int SPACING = 8;