ag_db_save_identical can now compare based only on chart-related data

This way the chart won’t get recalculated on a name change.
This commit is contained in:
2014-08-05 23:45:16 +02:00
parent 881b58080a
commit aefbb8e4fa
3 changed files with 9 additions and 7 deletions

View File

@@ -1060,7 +1060,7 @@ string_collate(const gchar *str1, const gchar *str2)
* with string_collate()), FALSE otherwise
*/
gboolean
ag_db_save_identical(const AgDbSave *a, const AgDbSave *b)
ag_db_save_identical(const AgDbSave *a, const AgDbSave *b, gboolean chart_only)
{
if (a == b) {
return TRUE;
@@ -1070,15 +1070,15 @@ ag_db_save_identical(const AgDbSave *a, const AgDbSave *b)
return FALSE;
}
if (string_collate(a->name, b->name) != 0) {
if (!chart_only && string_collate(a->name, b->name) != 0) {
return FALSE;
}
if (string_collate(a->country, b->country) != 0) {
if (!chart_only && string_collate(a->country, b->country) != 0) {
return FALSE;
}
if (string_collate(a->city, b->city) != 0) {
if (!chart_only && string_collate(a->city, b->city) != 0) {
return FALSE;
}
@@ -1126,7 +1126,7 @@ ag_db_save_identical(const AgDbSave *a, const AgDbSave *b)
return FALSE;
}
if (string_collate(a->note, b->note) != 0) {
if (!chart_only && string_collate(a->note, b->note) != 0) {
return FALSE;
}