paths: remove hardcoded basepath
Before we were hardcoding the basepath with dirs, which isn't that useful for testing, previews, or for android. Let's fix that. This also moves the db and cache directories into our root DataPaths. This is a breaking change, we don't have a migration step. sorry. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::app_style::NotedeckTextStyle;
|
||||
use crate::imgcache::ImageCache;
|
||||
use crate::storage::{DataPath, DataPathType};
|
||||
use crate::ui::ProfilePic;
|
||||
use crate::user_account::UserAccount;
|
||||
use crate::{colors, images, DisplayName};
|
||||
@@ -126,7 +127,10 @@ mod previews {
|
||||
impl<'a> ProfilePreviewPreview<'a> {
|
||||
pub fn new() -> Self {
|
||||
let profile = test_profile_record();
|
||||
let cache = ImageCache::new(ImageCache::rel_datadir().into());
|
||||
let path = DataPath::new("previews")
|
||||
.path(DataPathType::Cache)
|
||||
.join(ImageCache::rel_dir());
|
||||
let cache = ImageCache::new(path);
|
||||
ProfilePreviewPreview { profile, cache }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user