There are some deeper issues at play here when taking i18n into account
- meaning that the rows in the sections model will be sorted depending
on the runtime.
I talked it over with njpatel and we agreed that the cleanest way around
this is to keep the solution on the view side. Having the view created a
sorted copy of the sections for rendering and then compute the right
offset into the sections model when requesting a specific section.
I just committed some code to lp:dee that will make this a lot easier
than it sounds :-) I suggest we use the fact that DeeFilterModel can
show a re-sorted view of an original model and then use a collating
DeeFilter like so:
{
DeeModel *sections, *sorted_sections;
DeeFilter *collator;
sections = get_the_real_shared_model_for_sections();
filter = dee_filter_new_collator (4); // offset for the display_name column
sorted_sections = dee_filter_model_new (collator, sections);
render (sorted_sections);
}
Using the fact that DeeFilterModels share row iters with their parent
DeeModel we can easily get the offset into the original model given some
row that was activated in the sorted_sections model. Fx ala:
{
static void
on_sorted_sections_row_activated (DeeModel *sorted_sections, DeeModelIter
*sorted_iter)
{
guint orig_offset = dee_model_get_position (sections, sorted_iter);
call_SetActiveSection_on_dbus (orig_offset);
}
}
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/732981
Title:
Application sections dropdown is not alphabetized
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs