Browse Source

cleanup extras

master
yggverse 2 months ago
parent
commit
395551e14c
  1. 17
      src/app/browser/window.rs
  2. 2
      src/app/browser/window/tab.rs
  3. 3
      src/app/browser/window/tab/database.rs

17
src/app/browser/window.rs

@ -120,10 +120,7 @@ impl Window {
match self.database.delete(tx, &record.id) { match self.database.delete(tx, &record.id) {
Ok(_) => { Ok(_) => {
// Delegate clean action to childs // Delegate clean action to childs
// @TODO
self.tab.clean(tx, &record.id); self.tab.clean(tx, &record.id);
// self.widget.clean(tx, &record.id);
} }
Err(e) => todo!("{e}"), Err(e) => todo!("{e}"),
} }
@ -138,11 +135,7 @@ impl Window {
Ok(records) => { Ok(records) => {
for record in records { for record in records {
// Delegate restore action to childs // Delegate restore action to childs
// @TODO self.tab.restore(tx, &record.id);
// self.header.restore(record.id);
// self.window.restore(record.id);
// self.widget.restore(tx, &record.id);
} }
} }
Err(e) => todo!("{e}"), Err(e) => todo!("{e}"),
@ -153,13 +146,7 @@ impl Window {
match self.database.add(tx, app_browser_id) { match self.database.add(tx, app_browser_id) {
Ok(_) => { Ok(_) => {
// Delegate save action to childs // Delegate save action to childs
let id = self.database.last_insert_id(tx); self.tab.save(tx, &self.database.last_insert_id(tx));
// @TODO
// self.header.save(id);
// self.window.save(id);
// self.widget.save(tx, &id);
} }
Err(e) => todo!("{e}"), Err(e) => todo!("{e}"),
} }

2
src/app/browser/window/tab.rs

@ -253,7 +253,7 @@ impl Tab {
pub fn restore(&self, tx: &Transaction, app_browser_window_id: &i64) { pub fn restore(&self, tx: &Transaction, app_browser_window_id: &i64) {
match self.database.records(tx, app_browser_window_id) { match self.database.records(tx, app_browser_window_id) {
Ok(records) => { Ok(records) => {
for record in records { for _ in records {
// Delegate restore action to childs // Delegate restore action to childs
// nothing yet.. // nothing yet..
} }

3
src/app/browser/window/tab/database.rs

@ -60,7 +60,8 @@ impl Database {
tx.execute("DELETE FROM `app_browser_window_tab` WHERE `id` = ?", [id]) tx.execute("DELETE FROM `app_browser_window_tab` WHERE `id` = ?", [id])
} }
/* not in use
pub fn last_insert_id(&self, tx: &Transaction) -> i64 { pub fn last_insert_id(&self, tx: &Transaction) -> i64 {
tx.last_insert_rowid() tx.last_insert_rowid()
} } */
} }

Loading…
Cancel
Save