- if (_collator) {
- UErrorCode error = U_ZERO_ERROR;
- boost::scoped_array<uint16_t> utf16_a(new uint16_t[utf8_a.size() + 1]);
- u_strFromUTF8(reinterpret_cast<UChar*>(utf16_a.get()), utf8_a.size() + 1, nullptr, utf8_a.c_str(), -1, &error);
- boost::scoped_array<uint16_t> utf16_b(new uint16_t[utf8_b.size() + 1]);
- u_strFromUTF8(reinterpret_cast<UChar*>(utf16_b.get()), utf8_b.size() + 1, nullptr, utf8_b.c_str(), -1, &error);
- return ucol_strcoll(_collator, reinterpret_cast<UChar*>(utf16_a.get()), -1, reinterpret_cast<UChar*>(utf16_b.get()), -1);
- } else {
- return strcoll(utf8_a.c_str(), utf8_b.c_str());
+ _ignore_cinemas_changed = true;
+ ScopeGuard sg = [this]() { _ignore_cinemas_changed = false; };
+
+ try {
+ Config::instance()->changed(Config::CINEMAS);
+ } catch (FileError& e) {
+ error_dialog(GetParent(), _("Could not write cinema details to the cinemas.xml file. Check that the location of cinemas.xml is valid in DCP-o-matic's preferences."), std_to_wx(e.what()));
+ return false;
+ }
+
+ return true;
+}
+
+
+void
+ScreensPanel::config_changed(Config::Property property)
+{
+ if (property == Config::Property::CINEMAS && !_ignore_cinemas_changed) {
+ clear_and_re_add();