diff --git a/src/app/browser.cpp b/src/app/browser.cpp index b9123bd4..b0694ee1 100644 --- a/src/app/browser.cpp +++ b/src/app/browser.cpp @@ -8,7 +8,7 @@ Browser::Browser( sqlite3 * db ) { // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -243,7 +243,7 @@ Browser::Browser( "q" ); - session_restore(); // last session from DB + session_restore(); // last session from Database } ); @@ -263,7 +263,7 @@ Browser::Browser( // Actions int Browser::session_restore() { - sqlite3_stmt* statement; // @TODO move to the DB model namespace + sqlite3_stmt* statement; // @TODO move to the Database model namespace const int PREPARE_STATUS = sqlite3_prepare_v3( db, @@ -284,24 +284,24 @@ int Browser::session_restore() set_default_size( sqlite3_column_int( statement, - DB::SESSION::WIDTH + Database::Session::WIDTH ), sqlite3_column_int( statement, - DB::SESSION::HEIGHT + Database::Session::HEIGHT ) ); sqlite3_column_int( statement, - DB::SESSION::IS_FULLSCREEN + Database::Session::IS_FULLSCREEN ) == 1 ? fullscreen() : unfullscreen(); // Restore children components browserMain->session_restore( sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ); } @@ -314,7 +314,7 @@ int Browser::session_restore() void Browser::session_clean() { - DB::SESSION::clean( + Database::Session::clean( db ); @@ -326,12 +326,12 @@ void Browser::session_save() char * error; // @TODO // Delete previous data - DB::SESSION::clean( + Database::Session::clean( db ); // @TODO run on background // Create new session - const sqlite3_int64 APP_BROWSER__SESSION__ID = DB::SESSION::add( + const sqlite3_int64 APP_BROWSER__SESSION__ID = Database::Session::add( db, get_width(), get_height(), @@ -345,7 +345,7 @@ void Browser::session_save() } // Database -int Browser::DB::SESSION::init( +int Browser::Database::Session::init( sqlite3 * db ) { char * error; @@ -368,7 +368,7 @@ int Browser::DB::SESSION::init( ); } -int Browser::DB::SESSION::clean( +int Browser::Database::Session::clean( sqlite3 * db ) { char * error; // @TODO @@ -391,7 +391,7 @@ int Browser::DB::SESSION::clean( { const sqlite3_int64 APP_BROWSER__SESSION__ID = sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ); // Delete record @@ -411,7 +411,7 @@ int Browser::DB::SESSION::clean( // Delegate children dependencies cleanup if (EXEC_STATUS == SQLITE_OK) { - browser::Main::DB::SESSION::clean( + browser::Main::Database::Session::clean( db, APP_BROWSER__SESSION__ID ); @@ -424,7 +424,7 @@ int Browser::DB::SESSION::clean( ); } -sqlite3_int64 Browser::DB::SESSION::add( +sqlite3_int64 Browser::Database::Session::add( sqlite3 * db, const int & WIDTH, const int & HEIGHT, diff --git a/src/app/browser.hpp b/src/app/browser.hpp index a94dd4b0..72dd325b 100644 --- a/src/app/browser.hpp +++ b/src/app/browser.hpp @@ -27,10 +27,10 @@ namespace app * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER__* - struct SESSION + struct Session { enum { diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index f56447aa..9294809a 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -13,7 +13,7 @@ Main::Main( const Glib::RefPtr & ACTION__UPDATE ) { // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -48,7 +48,7 @@ Main::Main( int Main::session_restore( const sqlite3_int64 & APP_BROWSER__SESSION__ID ) { - sqlite3_stmt* statement; // @TODO move to the DB model namespace + sqlite3_stmt* statement; // @TODO move to the Database model namespace const int PREPARE_STATUS = sqlite3_prepare_v3( db, @@ -72,7 +72,7 @@ int Main::session_restore( mainTab->session_restore( sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ); } @@ -89,13 +89,13 @@ void Main::session_save( char * error; // @TODO // Delete previous data - DB::SESSION::clean( + Database::Session::clean( db, APP_BROWSER__SESSION__ID ); // @TODO run on background // Create new session - const sqlite3_int64 APP_BROWSER_MAIN__SESSION__ID = DB::SESSION::add( + const sqlite3_int64 APP_BROWSER_MAIN__SESSION__ID = Database::Session::add( db, APP_BROWSER__SESSION__ID ); @@ -184,7 +184,7 @@ Glib::ustring Main::get_tab_page_description() // Database -int Main::DB::SESSION::init( +int Main::Database::Session::init( sqlite3 * db ) { char * error; @@ -204,7 +204,7 @@ int Main::DB::SESSION::init( ); } -int Main::DB::SESSION::clean( +int Main::Database::Session::clean( sqlite3 * db, const sqlite3_int64 & APP_BROWSER__SESSION__ID ) { @@ -232,7 +232,7 @@ int Main::DB::SESSION::clean( { const sqlite3_int64 APP_BROWSER_MAIN__SESSION__ID = sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ); // Delete record @@ -252,7 +252,7 @@ int Main::DB::SESSION::clean( // Delegate children dependencies cleanup if (EXEC_STATUS == SQLITE_OK) { - main::Tab::DB::SESSION::clean( + main::Tab::Database::Session::clean( db, APP_BROWSER_MAIN__SESSION__ID ); @@ -265,7 +265,7 @@ int Main::DB::SESSION::clean( ); } -sqlite3_int64 Main::DB::SESSION::add( +sqlite3_int64 Main::Database::Session::add( sqlite3 * db, const sqlite3_int64 & APP_BROWSER__SESSION__ID ) { diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 74b8ea2a..feff0125 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -25,10 +25,10 @@ namespace app::browser * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER_MAIN__* - struct SESSION + struct Session { enum { diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 424a955d..18c9b09f 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -14,7 +14,7 @@ Tab::Tab( const Glib::RefPtr & ACTION__UPDATE ) { // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -43,7 +43,7 @@ Tab::Tab( int Tab::session_restore( const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID ) { - sqlite3_stmt* statement; // @TODO move to the DB model namespace + sqlite3_stmt* statement; // @TODO move to the Database model namespace const int PREPARE_STATUS = sqlite3_prepare_v3( db, @@ -69,7 +69,7 @@ int Tab::session_restore( const int PAGE_NUMBER = append( sqlite3_column_int( statement, - DB::SESSION::IS_CURRENT + Database::Session::IS_CURRENT ) == 1 ); @@ -79,7 +79,7 @@ int Tab::session_restore( )->session_restore( sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ); // maybe not much reasons to restore as page title in use @TODO @@ -88,7 +88,7 @@ int Tab::session_restore( )->session_restore( sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ); } @@ -105,7 +105,7 @@ void Tab::session_save( char * error; // @TODO // Delete previous data - DB::SESSION::clean( + Database::Session::clean( db, APP_BROWSER_MAIN__SESSION__ID ); // @TODO run on background @@ -114,7 +114,7 @@ void Tab::session_save( for (int page_number = 0; page_number < get_n_pages(); page_number++) { // Create new session - const sqlite3_int64 APP_BROWSER_MAIN_TAB__SESSION__ID = DB::SESSION::add( + const sqlite3_int64 APP_BROWSER_MAIN_TAB__SESSION__ID = Database::Session::add( db, APP_BROWSER_MAIN__SESSION__ID, page_number, @@ -339,7 +339,7 @@ tab::Page * Tab::get_tabPage( } // Database -int Tab::DB::SESSION::init( +int Tab::Database::Session::init( sqlite3 * db ) { char * error; @@ -361,7 +361,7 @@ int Tab::DB::SESSION::init( ); } -int Tab::DB::SESSION::clean( +int Tab::Database::Session::clean( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID ) { @@ -389,7 +389,7 @@ int Tab::DB::SESSION::clean( { const sqlite3_int64 APP_BROWSER_MAIN_TAB__SESSION__ID = sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ); // Delete record @@ -409,12 +409,12 @@ int Tab::DB::SESSION::clean( // Delegate children dependencies cleanup if (EXEC_STATUS == SQLITE_OK) { - tab::Label::DB::SESSION::clean( + tab::Label::Database::Session::clean( db, APP_BROWSER_MAIN_TAB__SESSION__ID ); - tab::Page::DB::SESSION::clean( + tab::Page::Database::Session::clean( db, APP_BROWSER_MAIN_TAB__SESSION__ID ); @@ -427,7 +427,7 @@ int Tab::DB::SESSION::clean( ); } -sqlite3_int64 Tab::DB::SESSION::add( +sqlite3_int64 Tab::Database::Session::add( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN__SESSION__ID, const int & PAGE_NUMBER, diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index 716841ab..bd8025b6 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -25,10 +25,10 @@ namespace app::browser::main * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER_MAIN_TAB__* - struct SESSION + struct Session { enum { diff --git a/src/app/browser/main/tab/label.cpp b/src/app/browser/main/tab/label.cpp index 57d581d5..7272e27e 100644 --- a/src/app/browser/main/tab/label.cpp +++ b/src/app/browser/main/tab/label.cpp @@ -7,7 +7,7 @@ Label::Label( const Glib::RefPtr & ACTION__TAB_CLOSE ) { // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -115,12 +115,12 @@ int Label::session_restore( reinterpret_cast( sqlite3_column_text( statement, - DB::SESSION::TEXT + Database::Session::TEXT ) ), sqlite3_column_int( statement, - DB::SESSION::IS_PINNED + Database::Session::IS_PINNED ) == 1 ); @@ -139,7 +139,7 @@ int Label::session_save( // Delegate save action to child components (on available) // Save label session - return DB::SESSION::add( + return Database::Session::add( db, APP_BROWSER_MAIN_TAB__SESSION__ID, is_pinned, @@ -210,7 +210,7 @@ void Label::update( } // Database model -int Label::DB::SESSION::init( +int Label::Database::Session::init( sqlite3 * db ) { char * error; @@ -232,7 +232,7 @@ int Label::DB::SESSION::init( ); } -int Label::DB::SESSION::clean( +int Label::Database::Session::clean( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID ) { @@ -267,7 +267,7 @@ int Label::DB::SESSION::clean( )SQL", sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ).c_str(), nullptr, @@ -288,7 +288,7 @@ int Label::DB::SESSION::clean( ); } -sqlite3_int64 Label::DB::SESSION::add( +sqlite3_int64 Label::Database::Session::add( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID, const bool & IS_PINNED, diff --git a/src/app/browser/main/tab/label.hpp b/src/app/browser/main/tab/label.hpp index 37312556..f6b3f45d 100644 --- a/src/app/browser/main/tab/label.hpp +++ b/src/app/browser/main/tab/label.hpp @@ -22,10 +22,10 @@ namespace app::browser::main::tab * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER_MAIN_TAB_LABEL__* - struct SESSION + struct Session { enum { diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index 5faddf53..e4bf5b4d 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -17,7 +17,7 @@ Page::Page( progress_fraction = 0; // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -93,7 +93,7 @@ Page::Page( int Page::session_restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID ) { - sqlite3_stmt* statement; // @TODO move to the DB model namespace + sqlite3_stmt* statement; // @TODO move to the Database model namespace const int PREPARE_STATUS = sqlite3_prepare_v3( db, @@ -120,7 +120,7 @@ int Page::session_restore( switch ( sqlite3_column_int( statement, - DB::SESSION::MIME + Database::Session::MIME ) ) { case 0: mime = MIME::TEXT_PLAIN; break; @@ -133,14 +133,14 @@ int Page::session_restore( title = reinterpret_cast( sqlite3_column_text( statement, - DB::SESSION::TITLE + Database::Session::TITLE ) ); description = reinterpret_cast( sqlite3_column_text( statement, - DB::SESSION::DESCRIPTION + Database::Session::DESCRIPTION ) ); @@ -148,7 +148,7 @@ int Page::session_restore( pageNavigation->session_restore( sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ); } @@ -164,7 +164,7 @@ void Page::session_save( ) { // Delegate save action to child components pageNavigation->session_save( - DB::SESSION::add( + Database::Session::add( db, APP_BROWSER_MAIN_TAB__SESSION__ID, mime, @@ -519,7 +519,7 @@ Glib::ustring Page::get_description() } // Database model -int Page::DB::SESSION::init( +int Page::Database::Session::init( sqlite3 * db ) { char * error; @@ -542,7 +542,7 @@ int Page::DB::SESSION::init( ); } -int Page::DB::SESSION::clean( +int Page::Database::Session::clean( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID ) { @@ -569,7 +569,7 @@ int Page::DB::SESSION::clean( { const sqlite3_int64 APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID = sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ); // Delete record @@ -589,7 +589,7 @@ int Page::DB::SESSION::clean( // Delegate children dependencies cleanup if (EXEC_STATUS == SQLITE_OK) { - page::Navigation::DB::SESSION::clean( + page::Navigation::Database::Session::clean( db, APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ); @@ -602,7 +602,7 @@ int Page::DB::SESSION::clean( ); } -sqlite3_int64 Page::DB::SESSION::add( +sqlite3_int64 Page::Database::Session::add( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID, const Page::MIME & MIME, diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index 9cc255d1..639522e1 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -43,10 +43,10 @@ namespace app::browser::main::tab * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER_MAIN_TAB_PAGE__* - struct SESSION + struct Session { enum { diff --git a/src/app/browser/main/tab/page/navigation.cpp b/src/app/browser/main/tab/page/navigation.cpp index 1ba754c9..8e3d53fa 100644 --- a/src/app/browser/main/tab/page/navigation.cpp +++ b/src/app/browser/main/tab/page/navigation.cpp @@ -16,7 +16,7 @@ Navigation::Navigation( const Glib::RefPtr & ACTION__UPDATE ) { // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -112,7 +112,7 @@ void Navigation::update( int Navigation::session_restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ) { - sqlite3_stmt* statement; // @TODO move to the DB model namespace + sqlite3_stmt* statement; // @TODO move to the Database model namespace const int PREPARE_STATUS = sqlite3_prepare_v3( db, @@ -139,14 +139,14 @@ int Navigation::session_restore( navigationHistory->session_restore( sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ); navigationRequest->session_restore( sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ); } @@ -161,13 +161,13 @@ void Navigation::session_save( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ) { // Delete previous session - DB::SESSION::clean( + Database::Session::clean( db, APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ); // Create new record - const sqlite3_int64 APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID = DB::SESSION::add( + const sqlite3_int64 APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID = Database::Session::add( db, APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ); @@ -256,7 +256,7 @@ void Navigation::set_request_text( } // Database model -int Navigation::DB::SESSION::init( +int Navigation::Database::Session::init( sqlite3 * db ) { char * error; @@ -276,7 +276,7 @@ int Navigation::DB::SESSION::init( ); } -int Navigation::DB::SESSION::clean( +int Navigation::Database::Session::clean( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ) { @@ -304,7 +304,7 @@ int Navigation::DB::SESSION::clean( { const sqlite3_int64 APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID = sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ); // Delete record @@ -324,12 +324,12 @@ int Navigation::DB::SESSION::clean( // Delegate children dependencies cleanup if (EXEC_STATUS == SQLITE_OK) { - navigation::History::DB::SESSION::clean( + navigation::History::Database::Session::clean( db, APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ); - navigation::Request::DB::SESSION::clean( + navigation::Request::Database::Session::clean( db, APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ); @@ -342,7 +342,7 @@ int Navigation::DB::SESSION::clean( ); } -sqlite3_int64 Navigation::DB::SESSION::add( +sqlite3_int64 Navigation::Database::Session::add( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID ) { diff --git a/src/app/browser/main/tab/page/navigation.hpp b/src/app/browser/main/tab/page/navigation.hpp index 66eef30c..c53ca8ed 100644 --- a/src/app/browser/main/tab/page/navigation.hpp +++ b/src/app/browser/main/tab/page/navigation.hpp @@ -28,10 +28,10 @@ namespace app::browser::main::tab::page * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__* - struct SESSION + struct Session { enum { diff --git a/src/app/browser/main/tab/page/navigation/history.cpp b/src/app/browser/main/tab/page/navigation/history.cpp index 95dba158..54182802 100644 --- a/src/app/browser/main/tab/page/navigation/history.cpp +++ b/src/app/browser/main/tab/page/navigation/history.cpp @@ -10,7 +10,7 @@ History::History( const Glib::RefPtr & ACTION__HISTORY_FORWARD ) { // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -59,7 +59,7 @@ void History::add( int History::session_restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { - sqlite3_stmt* statement; // @TODO move to the DB model namespace + sqlite3_stmt* statement; // @TODO move to the Database model namespace const int PREPARE_STATUS = sqlite3_prepare_v3( db, @@ -94,17 +94,17 @@ int History::session_restore( reinterpret_cast( sqlite3_column_text( statement, - DB::SESSION::REQUEST + Database::Session::REQUEST ) ), sqlite3_column_int( statement, - DB::SESSION::TIME + Database::Session::TIME ) } ); - if (sqlite3_column_int(statement, DB::SESSION::IS_CURRENT) == 1) + if (sqlite3_column_int(statement, Database::Session::IS_CURRENT) == 1) { index = memory.size() - 1; } @@ -128,7 +128,7 @@ void History::session_save( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { // Delete previous records for session - DB::SESSION::clean( + Database::Session::clean( db, APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ); @@ -136,7 +136,7 @@ void History::session_save( // Add new records int offset = -1; for (const auto & MEMORY : memory) { - DB::SESSION::add( + Database::Session::add( db, APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID, MEMORY.time, @@ -232,7 +232,7 @@ bool History::try_forward( } // Database model -int History::DB::SESSION::init( +int History::Database::Session::init( sqlite3 * db ) { char * error; @@ -254,7 +254,7 @@ int History::DB::SESSION::init( ); } -int History::DB::SESSION::clean( +int History::Database::Session::clean( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { @@ -289,7 +289,7 @@ int History::DB::SESSION::clean( )SQL", sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ).c_str(), nullptr, @@ -310,7 +310,7 @@ int History::DB::SESSION::clean( ); } -sqlite3_int64 History::DB::SESSION::add( +sqlite3_int64 History::Database::Session::add( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID, const int & TIME, diff --git a/src/app/browser/main/tab/page/navigation/history.hpp b/src/app/browser/main/tab/page/navigation/history.hpp index 13b1f8a8..a288fdaf 100644 --- a/src/app/browser/main/tab/page/navigation/history.hpp +++ b/src/app/browser/main/tab/page/navigation/history.hpp @@ -27,10 +27,10 @@ namespace app::browser::main::tab::page::navigation * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY__* - struct SESSION + struct Session { enum { diff --git a/src/app/browser/main/tab/page/navigation/request.cpp b/src/app/browser/main/tab/page/navigation/request.cpp index 3329d2b9..fe21fea2 100644 --- a/src/app/browser/main/tab/page/navigation/request.cpp +++ b/src/app/browser/main/tab/page/navigation/request.cpp @@ -9,7 +9,7 @@ Request::Request( const Glib::RefPtr & ACTION__UPDATE ) { // Init database - DB::SESSION::init( + Database::Session::init( this->db = db ); @@ -92,7 +92,7 @@ void Request::update( int Request::session_restore( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { - sqlite3_stmt* statement; // @TODO move to the DB model namespace + sqlite3_stmt* statement; // @TODO move to the Database model namespace const int PREPARE_STATUS = sqlite3_prepare_v3( db, @@ -120,7 +120,7 @@ int Request::session_restore( reinterpret_cast( sqlite3_column_text( statement, - DB::SESSION::TEXT + Database::Session::TEXT ) ) ); @@ -138,13 +138,13 @@ int Request::session_save( const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { // Delete previous records - DB::SESSION::clean( + Database::Session::clean( db, APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ); // Add new record - return DB::SESSION::add( + return Database::Session::add( db, APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID, get_text() @@ -152,7 +152,7 @@ int Request::session_save( } // Database model -int Request::DB::SESSION::init( +int Request::Database::Session::init( sqlite3 * db ) { char * error; @@ -173,7 +173,7 @@ int Request::DB::SESSION::init( ); } -int Request::DB::SESSION::clean( +int Request::Database::Session::clean( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID ) { @@ -208,7 +208,7 @@ int Request::DB::SESSION::clean( )SQL", sqlite3_column_int64( statement, - DB::SESSION::ID + Database::Session::ID ) ).c_str(), nullptr, @@ -229,7 +229,7 @@ int Request::DB::SESSION::clean( ); } -sqlite3_int64 Request::DB::SESSION::add( +sqlite3_int64 Request::Database::Session::add( sqlite3 * db, const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID, const Glib::ustring & TEXT diff --git a/src/app/browser/main/tab/page/navigation/request.hpp b/src/app/browser/main/tab/page/navigation/request.hpp index 46c5a11c..d7098953 100644 --- a/src/app/browser/main/tab/page/navigation/request.hpp +++ b/src/app/browser/main/tab/page/navigation/request.hpp @@ -22,10 +22,10 @@ namespace app::browser::main::tab::page::navigation * * Allowed parental access to enums and relationship methods */ - struct DB + struct Database { // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST__* - struct SESSION + struct Session { enum {