mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
use arc for db connection
This commit is contained in:
parent
db43289e24
commit
998e3170fb
2 changed files with 6 additions and 5 deletions
|
|
@ -9,13 +9,13 @@ use gtk::{
|
|||
Application, ApplicationWindow,
|
||||
};
|
||||
|
||||
use sqlite::Connection;
|
||||
pub struct Browser {
|
||||
db: Arc<sqlite::Connection>,
|
||||
pub widget: Arc<gtk::ApplicationWindow>,
|
||||
pub main: Arc<main::Main>,
|
||||
}
|
||||
|
||||
pub fn new(app: &Application, db: &Connection, width: i32, height: i32) -> Browser {
|
||||
pub fn new(app: &Application, db: Arc<sqlite::Connection>, width: i32, height: i32) -> Browser {
|
||||
// Init components
|
||||
let main = Arc::new(main::new());
|
||||
|
||||
|
|
@ -55,5 +55,5 @@ pub fn new(app: &Application, db: &Connection, width: i32, height: i32) -> Brows
|
|||
widget.add_action_entries([action_tab_append, action_debug, action_quit]);
|
||||
|
||||
// Done
|
||||
Browser { widget, main }
|
||||
Browser { db, widget, main }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue