Skip to content

Commit 4279684

Browse files
Move consts to extra module
1 parent 6dd17f7 commit 4279684

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

desktop/src/consts.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub(crate) static APP_NAME: &str = "Graphite";
2+
pub(crate) static APP_ID: &str = "rs.graphite.GraphiteEditor";
3+
pub(crate) static APP_DIRECTORY_NAME: &str = "graphite-editor";

desktop/src/dirs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fs::create_dir_all;
22
use std::path::PathBuf;
33

4-
static APP_NAME: &str = "graphite-desktop";
4+
use crate::consts::APP_DIRECTORY_NAME;
55

66
pub(crate) fn ensure_dir_exists(path: &PathBuf) {
77
if !path.exists() {
@@ -10,7 +10,7 @@ pub(crate) fn ensure_dir_exists(path: &PathBuf) {
1010
}
1111

1212
pub(crate) fn graphite_data_dir() -> PathBuf {
13-
let path = dirs::data_dir().expect("Failed to get data directory").join(APP_NAME);
13+
let path = dirs::data_dir().expect("Failed to get data directory").join(APP_DIRECTORY_NAME);
1414
ensure_dir_exists(&path);
1515
path
1616
}

desktop/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use graphite_editor::messages::prelude::Message;
66
use tracing_subscriber::EnvFilter;
77
use winit::event_loop::EventLoop;
88

9+
pub(crate) mod consts;
10+
911
mod cef;
1012
use cef::{Setup, WindowSize};
1113

0 commit comments

Comments
 (0)