Use data manager name everywhere
This commit is contained in:
parent
7610b291a4
commit
11dca1fab2
6 changed files with 15 additions and 13 deletions
|
@ -12,10 +12,10 @@ use crate :: error :: { * , ZoodexError :: * } ;
|
|||
|
||||
|
||||
|
||||
pub struct Collection { sqlite_client : Client }
|
||||
pub struct DataManager { sqlite_client : Client }
|
||||
|
||||
impl Collection {
|
||||
pub async fn new () -> Result <Collection> {
|
||||
impl DataManager {
|
||||
pub async fn new () -> Result <Self> {
|
||||
let sqlite_client = ClientBuilder :: new ()
|
||||
. path ("zoodex.sqlite")
|
||||
. flags ( OpenFlags :: SQLITE_OPEN_READ_WRITE | OpenFlags :: SQLITE_OPEN_NO_MUTEX )
|
||||
|
@ -24,7 +24,7 @@ impl Collection {
|
|||
Ok ( Self { sqlite_client } )
|
||||
}
|
||||
|
||||
pub async fn get_overview ( & self ) -> CollectionOverview {
|
||||
pub async fn get_collection_overview ( & self ) -> CollectionOverview {
|
||||
self . sqlite_client . conn ( |sqlite_connection| {
|
||||
let films = sqlite_connection
|
||||
. prepare ( "
|
10
src/main.rs
10
src/main.rs
|
@ -1,5 +1,5 @@
|
|||
mod error ;
|
||||
mod persistence ;
|
||||
mod data_manager ;
|
||||
mod ui ;
|
||||
mod utility ;
|
||||
|
||||
|
@ -13,7 +13,7 @@ use {
|
|||
} ,
|
||||
libadwaita :: { * , prelude :: * } } ;
|
||||
|
||||
use crate :: { error :: { * , ZoodexError :: * } , persistence :: * , ui :: * } ;
|
||||
use crate :: { data_manager :: * , error :: { * , ZoodexError :: * } , ui :: * } ;
|
||||
|
||||
|
||||
|
||||
|
@ -43,9 +43,9 @@ fn show_window ( app : & Application ) {
|
|||
spawn_future_local ( async move {
|
||||
async_unit_result_context (
|
||||
async {
|
||||
let collection = Collection :: new () . await ? ;
|
||||
let collection_overview = collection . get_overview () . await ;
|
||||
ui . render_collection_overview (collection_overview) ;
|
||||
let data_manager = DataManager :: new () . await ? ;
|
||||
let collection = data_manager . get_collection_overview () . await ;
|
||||
ui . render_collection_overview (collection) ;
|
||||
Ok (())
|
||||
} ,
|
||||
|error| {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use {
|
||||
gtk4 :: {
|
||||
* ,
|
||||
Align :: * , Orientation :: * ,
|
||||
Align :: * ,
|
||||
Orientation :: * ,
|
||||
gdk :: * ,
|
||||
pango :: { * , Weight :: * } ,
|
||||
prelude :: * ,
|
||||
|
|
|
@ -6,7 +6,8 @@ use {
|
|||
} ;
|
||||
|
||||
use crate :: ui :: {
|
||||
component :: * , utility :: * ,
|
||||
component :: * ,
|
||||
utility :: * ,
|
||||
collatable_container :: { * , collation_menu :: sort_button :: * } ,
|
||||
} ;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ mod collation_menu ;
|
|||
use gtk4 :: { * , Orientation :: * , prelude :: * } ;
|
||||
|
||||
use crate :: {
|
||||
persistence :: * ,
|
||||
data_manager :: * ,
|
||||
ui :: {
|
||||
component :: * , utility :: * ,
|
||||
collatable_container :: { collated_grid :: * , collation_menu :: * } ,
|
||||
|
|
|
@ -10,7 +10,7 @@ use {
|
|||
} ;
|
||||
|
||||
use crate :: {
|
||||
persistence :: * ,
|
||||
data_manager :: * ,
|
||||
ui :: {
|
||||
application_header_bar :: * ,
|
||||
collatable_container :: * ,
|
||||
|
|
Loading…
Add table
Reference in a new issue