Sync develop presets through the library
Presets were the one piece of the photographer's work that never left the device: faces, sidecars, albums, collections, keywords and camera profiles all travel with the sync pass, the preset library did not. It now goes to <derived>/presets/library.drpl. PresetLibrary::merge decides each name against the base the last exchange left (kept per library beside place.json), so presets added on two devices both survive, a deletion reaches the other device instead of being restored by it, and an edit outlives a deletion made elsewhere. The upload is If-Match / If-None-Match on the server's copy, and a 412 reads and merges again, so two devices exchanging at once cannot save over each other. A server copy that will not parse (a newer build's) is left alone, and a local file that will not read stops the exchange rather than being taken for an empty library. The develop view's save merges with the file when the sync changed it since the view read it, and a sync that brought presets reloads and redraws the list. Also corrects the register, which still said camera profiles do not sync.
This commit is contained in:
@@ -290,6 +290,10 @@ pub struct LibraryController {
|
||||
/// old behaviour rather than a crash.
|
||||
pub(super) coll_ctl:
|
||||
RefCell<Option<std::rc::Weak<crate::collections_ui::CollectionsController>>>,
|
||||
/// TRACES: FR-DEV-6
|
||||
/// The develop view's preset list, so a sync that brought presets from
|
||||
/// another device can redraw it. `Weak` for the reason `coll_ctl` is.
|
||||
pub(crate) named_presets: RefCell<Option<std::rc::Weak<crate::presets::NamedPresets>>>,
|
||||
/// Timeline view state: how far zoomed in, and around what instant.
|
||||
///
|
||||
/// Zoom is a level rather than a span so the axis halves and doubles in
|
||||
@@ -497,6 +501,7 @@ impl LibraryController {
|
||||
applying_place: std::cell::Cell::new(false),
|
||||
viewing_trash: std::cell::Cell::new(false),
|
||||
coll_ctl: RefCell::new(None),
|
||||
named_presets: RefCell::new(None),
|
||||
timeline_zoom: RefCell::new(0),
|
||||
timeline_centre: RefCell::new(None),
|
||||
pinch_accum: RefCell::new(1.0),
|
||||
|
||||
Reference in New Issue
Block a user