Commit 8332df4e authored by Eric Gregory's avatar Eric Gregory

3736 direct view ordering fix

Mirroring now respects the comparator, additionally the view type must be set to DirectView.
parent 8ab28b0c
......@@ -1018,7 +1018,7 @@ public abstract class EditingHostPage : SinglePhotoPage {
}
}
private DataView create_photo_view(DataSource source) {
protected virtual DataView create_photo_view(DataSource source) {
return new PhotoView((PhotoSource) source);
}
......
......@@ -223,6 +223,10 @@ public class DataCollection {
return dataset.get_comparator();
}
public ComparatorPredicate get_comparator_predicate() {
return dataset.get_comparator_predicate();
}
public virtual void set_comparator(Comparator comparator, ComparatorPredicate? predicate) {
dataset.set_comparator(comparator, predicate);
notify_ordering_changed();
......
......@@ -78,6 +78,10 @@ public class DataSet {
return user_comparator;
}
public ComparatorPredicate get_comparator_predicate() {
return comparator_predicate;
}
public void set_comparator(Comparator user_comparator, ComparatorPredicate? comparator_predicate) {
this.user_comparator = user_comparator;
this.comparator_predicate = comparator_predicate;
......
......@@ -268,6 +268,7 @@ public class ViewCollection : DataCollection {
mirroring = to_mirror;
this.mirroring_ctor = mirroring_ctor;
this.should_mirror = should_mirror;
set_comparator(to_mirror.get_comparator(), to_mirror.get_comparator_predicate());
// load up with current items
on_mirror_contents_added(mirroring.get_all());
......
......@@ -507,5 +507,9 @@ public class DirectPhotoPage : EditingHostPage {
(Gee.Collection<Photo>) get_view().get_selected_sources_of_type(typeof(Photo)));
}
}
protected override DataView create_photo_view(DataSource source) {
return new DirectView((DirectPhoto) source);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment