libcosmic/examples/app_library/utils.rs

12 lines
270 B
Rust
Raw Normal View History

2021-12-06 10:56:45 -05:00
use std::path::PathBuf;
use gtk4::glib;
pub fn data_path() -> PathBuf {
let mut path = glib::user_data_dir();
path.push("com.cosmic.app_library");
std::fs::create_dir_all(&path).expect("Could not create directory.");
path.push("data.json");
path
}