Browse Source

update relationship fields postfix

CPP-GTK4
yggverse 4 months ago
parent
commit
edabd68be9
  1. 6
      src/app/browser/main/tab.cpp
  2. 24
      src/app/browser/main/tab/page.cpp
  3. 6
      src/app/browser/main/tab/page.hpp
  4. 24
      src/app/browser/main/tab/page/navigation.cpp
  5. 6
      src/app/browser/main/tab/page/navigation.hpp
  6. 18
      src/app/browser/main/tab/page/navigation/request.cpp
  7. 6
      src/app/browser/main/tab/page/navigation/request.hpp

6
src/app/browser/main/tab.cpp

@ -377,7 +377,7 @@ int Tab::DB::SESSION::clean( @@ -377,7 +377,7 @@ int Tab::DB::SESSION::clean(
{
while (sqlite3_step(statement) == SQLITE_ROW)
{
const int APP_BROWSER_MAIN_TAB__SESSION_ID = sqlite3_column_int(
const int APP_BROWSER_MAIN_TAB__SESSION__ID = sqlite3_column_int(
statement,
DB::SESSION::ID
);
@ -389,7 +389,7 @@ int Tab::DB::SESSION::clean( @@ -389,7 +389,7 @@ int Tab::DB::SESSION::clean(
R"SQL(
DELETE FROM `app_browser_main_tab__session` WHERE `id` = %d
)SQL",
APP_BROWSER_MAIN_TAB__SESSION_ID
APP_BROWSER_MAIN_TAB__SESSION__ID
).c_str(),
nullptr,
nullptr,
@ -401,7 +401,7 @@ int Tab::DB::SESSION::clean( @@ -401,7 +401,7 @@ int Tab::DB::SESSION::clean(
{
tab::Page::DB::SESSION::clean(
db,
APP_BROWSER_MAIN_TAB__SESSION_ID
APP_BROWSER_MAIN_TAB__SESSION__ID
);
}
}

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

@ -71,13 +71,13 @@ void Page::refresh() @@ -71,13 +71,13 @@ void Page::refresh()
}
int Page::save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
) {
// Delegate save action to child components
return pageNavigation->save(
DB::SESSION::add(
db,
APP_BROWSER_MAIN_TAB__SESSION_ID,
APP_BROWSER_MAIN_TAB__SESSION__ID,
mime,
title,
description
@ -375,7 +375,7 @@ int Page::DB::SESSION::init( @@ -375,7 +375,7 @@ int Page::DB::SESSION::init(
R"SQL(
CREATE TABLE IF NOT EXISTS `app_browser_main_tab_page__session`
(
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `app_browser_main_tab__session_id` INTEGER NOT NULL,
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `app_browser_main_tab__session__id` INTEGER NOT NULL,
`time` INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP,
`mime` INTEGER NOT NULL,
`title` VARCHAR(1024) NOT NULL,
@ -390,7 +390,7 @@ int Page::DB::SESSION::init( @@ -390,7 +390,7 @@ int Page::DB::SESSION::init(
int Page::DB::SESSION::clean(
sqlite3 * db,
const int & APP_BROWSER_MAIN_TAB__SESSION_ID
const int & APP_BROWSER_MAIN_TAB__SESSION__ID
) {
char * error; // @TODO
sqlite3_stmt * statement;
@ -399,9 +399,9 @@ int Page::DB::SESSION::clean( @@ -399,9 +399,9 @@ int Page::DB::SESSION::clean(
db,
Glib::ustring::sprintf(
R"SQL(
SELECT * FROM `app_browser_main_tab_page__session` WHERE `app_browser_main_tab__session_id` = %d
SELECT * FROM `app_browser_main_tab_page__session` WHERE `app_browser_main_tab__session__id` = %d
)SQL",
APP_BROWSER_MAIN_TAB__SESSION_ID
APP_BROWSER_MAIN_TAB__SESSION__ID
).c_str(),
-1,
SQLITE_PREPARE_NORMALIZE,
@ -413,7 +413,7 @@ int Page::DB::SESSION::clean( @@ -413,7 +413,7 @@ int Page::DB::SESSION::clean(
{
while (sqlite3_step(statement) == SQLITE_ROW)
{
const int APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID = sqlite3_column_int(
const int APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID = sqlite3_column_int(
statement,
DB::SESSION::ID
);
@ -425,7 +425,7 @@ int Page::DB::SESSION::clean( @@ -425,7 +425,7 @@ int Page::DB::SESSION::clean(
R"SQL(
DELETE FROM `app_browser_main_tab_page__session` WHERE `id` = %d
)SQL",
APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
).c_str(),
nullptr,
nullptr,
@ -437,7 +437,7 @@ int Page::DB::SESSION::clean( @@ -437,7 +437,7 @@ int Page::DB::SESSION::clean(
{
page::Navigation::DB::SESSION::clean(
db,
APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
);
}
}
@ -450,7 +450,7 @@ int Page::DB::SESSION::clean( @@ -450,7 +450,7 @@ int Page::DB::SESSION::clean(
sqlite3_int64 Page::DB::SESSION::add(
sqlite3 * db,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION_ID,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID,
const Page::MIME & MIME,
const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION
@ -462,7 +462,7 @@ sqlite3_int64 Page::DB::SESSION::add( @@ -462,7 +462,7 @@ sqlite3_int64 Page::DB::SESSION::add(
Glib::ustring::sprintf(
R"SQL(
INSERT INTO `app_browser_main_tab_page__session` (
`app_browser_main_tab__session_id`,
`app_browser_main_tab__session__id`,
`mime`,
`title`,
`description`
@ -473,7 +473,7 @@ sqlite3_int64 Page::DB::SESSION::add( @@ -473,7 +473,7 @@ sqlite3_int64 Page::DB::SESSION::add(
'%s'
)
)SQL",
APP_BROWSER_MAIN_TAB__SESSION_ID,
APP_BROWSER_MAIN_TAB__SESSION__ID,
MIME,
TITLE,
DESCRIPTION

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

@ -60,12 +60,12 @@ namespace app::browser::main::tab @@ -60,12 +60,12 @@ namespace app::browser::main::tab
static int clean(
sqlite3 * db,
const int & APP_BROWSER_MAIN_TAB__SESSION_ID
const int & APP_BROWSER_MAIN_TAB__SESSION__ID
); // return sqlite3_finalize status code
static sqlite3_int64 add(
sqlite3 * db,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION_ID,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID,
const Page::MIME & MIME,
const Glib::ustring & TITLE,
const Glib::ustring & DESCRIPTION
@ -120,7 +120,7 @@ namespace app::browser::main::tab @@ -120,7 +120,7 @@ namespace app::browser::main::tab
void refresh();
int save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
);
void update(

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

@ -109,12 +109,12 @@ void Navigation::refresh( @@ -109,12 +109,12 @@ void Navigation::refresh(
}
int Navigation::save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
) {
return navigationRequest->save(
DB::SESSION::add(
db,
APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
)
);
}
@ -213,7 +213,7 @@ int Navigation::DB::SESSION::init( @@ -213,7 +213,7 @@ int Navigation::DB::SESSION::init(
R"SQL(
CREATE TABLE IF NOT EXISTS `app_browser_main_tab_page_navigation__session`
(
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `app_browser_main_tab_page__session_id` INTEGER NOT NULL,
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `app_browser_main_tab_page__session__id` INTEGER NOT NULL,
`time` INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
)
)SQL",
@ -225,7 +225,7 @@ int Navigation::DB::SESSION::init( @@ -225,7 +225,7 @@ int Navigation::DB::SESSION::init(
int Navigation::DB::SESSION::clean(
sqlite3 * db,
const int & APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
const int & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
) {
char * error; // @TODO
sqlite3_stmt * statement;
@ -234,9 +234,9 @@ int Navigation::DB::SESSION::clean( @@ -234,9 +234,9 @@ int Navigation::DB::SESSION::clean(
db,
Glib::ustring::sprintf(
R"SQL(
SELECT * FROM `app_browser_main_tab_page_navigation__session` WHERE `app_browser_main_tab_page__session_id` = %d
SELECT * FROM `app_browser_main_tab_page_navigation__session` WHERE `app_browser_main_tab_page__session__id` = %d
)SQL",
APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
).c_str(),
-1,
SQLITE_PREPARE_NORMALIZE,
@ -248,7 +248,7 @@ int Navigation::DB::SESSION::clean( @@ -248,7 +248,7 @@ int Navigation::DB::SESSION::clean(
{
while (sqlite3_step(statement) == SQLITE_ROW)
{
const int APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID = sqlite3_column_int(
const int APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID = sqlite3_column_int(
statement,
DB::SESSION::ID
);
@ -260,7 +260,7 @@ int Navigation::DB::SESSION::clean( @@ -260,7 +260,7 @@ int Navigation::DB::SESSION::clean(
R"SQL(
DELETE FROM `app_browser_main_tab_page_navigation__session` WHERE `id` = %d
)SQL",
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
).c_str(),
nullptr,
nullptr,
@ -272,7 +272,7 @@ int Navigation::DB::SESSION::clean( @@ -272,7 +272,7 @@ int Navigation::DB::SESSION::clean(
{
navigation::Request::DB::SESSION::clean(
db,
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
);
}
}
@ -285,7 +285,7 @@ int Navigation::DB::SESSION::clean( @@ -285,7 +285,7 @@ int Navigation::DB::SESSION::clean(
sqlite3_int64 Navigation::DB::SESSION::add(
sqlite3 * db,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
) {
char * error; // @TODO
@ -294,12 +294,12 @@ sqlite3_int64 Navigation::DB::SESSION::add( @@ -294,12 +294,12 @@ sqlite3_int64 Navigation::DB::SESSION::add(
Glib::ustring::sprintf(
R"SQL(
INSERT INTO `app_browser_main_tab_page_navigation__session` (
`app_browser_main_tab_page__session_id`
`app_browser_main_tab_page__session__id`
) VALUES (
'%d'
)
)SQL",
APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
).c_str(),
nullptr,
nullptr,

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

@ -45,12 +45,12 @@ namespace app::browser::main::tab::page @@ -45,12 +45,12 @@ namespace app::browser::main::tab::page
static int clean(
sqlite3 * db,
const int & APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
const int & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
); // return sqlite3_finalize status code
static sqlite3_int64 add(
sqlite3 * db,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE__SESSION__ID
); // return sqlite3_last_insert_rowid
};
};
@ -93,7 +93,7 @@ namespace app::browser::main::tab::page @@ -93,7 +93,7 @@ namespace app::browser::main::tab::page
);
int save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB__SESSION__ID
);
void history_add(

18
src/app/browser/main/tab/page/navigation/request.cpp

@ -85,11 +85,11 @@ void Request::refresh( @@ -85,11 +85,11 @@ void Request::refresh(
}
int Request::save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
) {
return DB::SESSION::add(
db,
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID,
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID,
get_text()
);
}
@ -161,7 +161,7 @@ int Request::DB::SESSION::init( @@ -161,7 +161,7 @@ int Request::DB::SESSION::init(
R"SQL(
CREATE TABLE IF NOT EXISTS `app_browser_main_tab_page_navigation_request__session`
(
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `app_browser_main_tab_page_navigation__session_id` INTEGER NOT NULL,
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `app_browser_main_tab_page_navigation__session__id` INTEGER NOT NULL,
`time` INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP,
`text` VARCHAR (1024) NOT NULL
)
@ -174,7 +174,7 @@ int Request::DB::SESSION::init( @@ -174,7 +174,7 @@ int Request::DB::SESSION::init(
int Request::DB::SESSION::clean(
sqlite3 * db,
const int & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID
const int & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
) {
char * error; // @TODO
sqlite3_stmt * statement;
@ -184,9 +184,9 @@ int Request::DB::SESSION::clean( @@ -184,9 +184,9 @@ int Request::DB::SESSION::clean(
Glib::ustring::sprintf(
R"SQL(
SELECT * FROM `app_browser_main_tab_page_navigation_request__session`
WHERE `app_browser_main_tab_page_navigation__session_id` = %d
WHERE `app_browser_main_tab_page_navigation__session__id` = %d
)SQL",
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
).c_str(),
-1,
SQLITE_PREPARE_NORMALIZE,
@ -230,7 +230,7 @@ int Request::DB::SESSION::clean( @@ -230,7 +230,7 @@ int Request::DB::SESSION::clean(
sqlite3_int64 Request::DB::SESSION::add(
sqlite3 * db,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID,
const Glib::ustring & TEXT
) {
char * error; // @TODO
@ -240,14 +240,14 @@ sqlite3_int64 Request::DB::SESSION::add( @@ -240,14 +240,14 @@ sqlite3_int64 Request::DB::SESSION::add(
Glib::ustring::sprintf(
R"SQL(
INSERT INTO `app_browser_main_tab_page_navigation_request__session` (
`app_browser_main_tab_page_navigation__session_id`,
`app_browser_main_tab_page_navigation__session__id`,
`text`
) VALUES (
'%d',
'%s'
)
)SQL",
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID,
APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID,
TEXT
).c_str(),
nullptr,

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

@ -39,12 +39,12 @@ namespace app::browser::main::tab::page::navigation @@ -39,12 +39,12 @@ namespace app::browser::main::tab::page::navigation
static int clean(
sqlite3 * db,
const int & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID
const int & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
); // return sqlite3_finalize status code
static sqlite3_int64 add(
sqlite3 * db,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID,
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID,
const Glib::ustring & TEXT
); // return sqlite3_last_insert_rowid
};
@ -96,7 +96,7 @@ namespace app::browser::main::tab::page::navigation @@ -96,7 +96,7 @@ namespace app::browser::main::tab::page::navigation
);
int save(
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION_ID
const sqlite3_int64 & APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION__SESSION__ID
);
// Getters

Loading…
Cancel
Save