contacts_db_remove_changed_cb(_contacts_phone_log._uri, makeCallbackWithLastParam(&LogProvider::onLogsChanged), this);
contacts_db_remove_changed_cb(_contacts_person._uri, makeCallbackWithLastParam(&LogProvider::onContactChanged), this);
+ contacts_setting_remove_name_display_order_changed_cb(makeCallbackWithLastParam(&LogProvider::onNameFormatChanged), this);
for (auto &&log : m_Logs) {
delete log;
contacts_db_get_current_version(&m_DbVersion);
contacts_db_add_changed_cb(_contacts_phone_log._uri, makeCallbackWithLastParam(&LogProvider::onLogsChanged), this);
contacts_db_add_changed_cb(_contacts_person._uri, makeCallbackWithLastParam(&LogProvider::onContactChanged), this);
+ contacts_setting_add_name_display_order_changed_cb(makeCallbackWithLastParam(&LogProvider::onNameFormatChanged), this);
phone_number_connect();
new Utils::Thread([this] {
contacts_list_destroy(list, true);
}
+
+void LogProvider::onNameFormatChanged(contacts_name_display_order_e order)
+{
+ for (auto &&group : m_Groups) {
+ const Log &log = group->getFirstLog();
+ if (log.getContactId() != 0) {
+ group->updateLogList();
+ group->setChangedType(LogGroup::ChangeName);
+ group->onChange();
+ }
+ }
+}