|
|
@ -30,7 +30,7 @@ Browser::Browser( |
|
|
|
"session_clean", |
|
|
|
"session_clean", |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
clean(); |
|
|
|
session_clean(); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -38,7 +38,7 @@ Browser::Browser( |
|
|
|
"session_restore", |
|
|
|
"session_restore", |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
restore(); |
|
|
|
session_restore(); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ Browser::Browser( |
|
|
|
"session_save", |
|
|
|
"session_save", |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
save(); |
|
|
|
session_save(); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -243,14 +243,14 @@ Browser::Browser( |
|
|
|
"<Primary>q" |
|
|
|
"<Primary>q" |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
restore(); // last session from DB
|
|
|
|
session_restore(); // last session from DB
|
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
signal_close_request().connect( |
|
|
|
signal_close_request().connect( |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
|
save(); |
|
|
|
session_save(); |
|
|
|
|
|
|
|
|
|
|
|
// @TODO sqlite3_close(db);
|
|
|
|
// @TODO sqlite3_close(db);
|
|
|
|
|
|
|
|
|
|
|
@ -261,7 +261,7 @@ Browser::Browser( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
int Browser::restore() |
|
|
|
int Browser::session_restore() |
|
|
|
{ |
|
|
|
{ |
|
|
|
sqlite3_stmt* statement; // @TODO move to the DB model namespace
|
|
|
|
sqlite3_stmt* statement; // @TODO move to the DB model namespace
|
|
|
|
|
|
|
|
|
|
|
@ -298,7 +298,7 @@ int Browser::restore() |
|
|
|
) ? fullscreen() : unfullscreen(); |
|
|
|
) ? fullscreen() : unfullscreen(); |
|
|
|
|
|
|
|
|
|
|
|
// Restore children components
|
|
|
|
// Restore children components
|
|
|
|
browserMain->restore( |
|
|
|
browserMain->session_restore( |
|
|
|
sqlite3_column_int( |
|
|
|
sqlite3_column_int( |
|
|
|
statement, |
|
|
|
statement, |
|
|
|
DB::SESSION::ID |
|
|
|
DB::SESSION::ID |
|
|
@ -312,7 +312,7 @@ int Browser::restore() |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Browser::clean() |
|
|
|
void Browser::session_clean() |
|
|
|
{ |
|
|
|
{ |
|
|
|
DB::SESSION::clean( |
|
|
|
DB::SESSION::clean( |
|
|
|
db |
|
|
|
db |
|
|
@ -321,7 +321,7 @@ void Browser::clean() |
|
|
|
browserMain->tab_close_all(); |
|
|
|
browserMain->tab_close_all(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Browser::save() |
|
|
|
void Browser::session_save() |
|
|
|
{ |
|
|
|
{ |
|
|
|
char * error; // @TODO
|
|
|
|
char * error; // @TODO
|
|
|
|
|
|
|
|
|
|
|
@ -339,7 +339,7 @@ void Browser::save() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Delegate save actions to children components
|
|
|
|
// Delegate save actions to children components
|
|
|
|
browserMain->save( |
|
|
|
browserMain->session_save( |
|
|
|
APP_BROWSER__SESSION__ID |
|
|
|
APP_BROWSER__SESSION__ID |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|