mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-24 17:03:00 +10:00
Semantic naming changes
This commit is contained in:
@@ -39,7 +39,7 @@ pub type DatabaseInterface =
|
|||||||
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
|
pub static DATA_ROOT_DIR: LazyLock<PathBuf> =
|
||||||
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
|
LazyLock::new(|| BaseDirs::new().unwrap().data_dir().join("drop"));
|
||||||
|
|
||||||
pub fn setup() -> DatabaseInterface {
|
pub fn set_up_database() -> DatabaseInterface {
|
||||||
let db_path = DATA_ROOT_DIR.join("drop.db");
|
let db_path = DATA_ROOT_DIR.join("drop.db");
|
||||||
let apps_base_dir = DATA_ROOT_DIR.join("apps");
|
let apps_base_dir = DATA_ROOT_DIR.join("apps");
|
||||||
|
|
||||||
@@ -62,8 +62,8 @@ pub fn setup() -> DatabaseInterface {
|
|||||||
db
|
db
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_set_up() -> bool {
|
pub fn database_is_set_up() -> bool {
|
||||||
return !DB.borrow_data().unwrap().base_url.is_empty();
|
!DB.borrow_data().unwrap().base_url.is_empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch_base_url() -> Url {
|
pub fn fetch_base_url() -> Url {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ fn fetch_state(state: tauri::State<'_, Mutex<AppState>>) -> Result<AppState, Str
|
|||||||
fn setup() -> AppState {
|
fn setup() -> AppState {
|
||||||
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
||||||
|
|
||||||
let is_set_up = db::is_set_up();
|
let is_set_up = db::database_is_set_up();
|
||||||
if !is_set_up {
|
if !is_set_up {
|
||||||
return AppState {
|
return AppState {
|
||||||
status: AppStatus::NotConfigured,
|
status: AppStatus::NotConfigured,
|
||||||
@@ -71,7 +71,7 @@ fn setup() -> AppState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static DB: LazyLock<DatabaseInterface> = LazyLock::new(db::setup);
|
pub static DB: LazyLock<DatabaseInterface> = LazyLock::new(db::set_up_database);
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user