summaryrefslogtreecommitdiff
path: root/src/contacts-main-window.vala
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2022-08-16 12:36:08 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2022-09-03 08:50:19 +0200
commit1d44c11483e3d00611c0beed9afc8f2c9facc3a8 (patch)
tree6a38fecd4acca16fb8c6d1b4322b2e10fbe0d5ad /src/contacts-main-window.vala
parent4d0710b8a6c7a3cd2ee0311b62f5e2707c34c305 (diff)
downloadgnome-contacts-1d44c11483e3d00611c0beed9afc8f2c9facc3a8.tar.gz
Introduce the concept of Contacts.Chunk
This commit introduces a new class `Contacts.Chunk`. Just like libfolks, we see a contact as a collection of data, or to word it differently: a collection built up from "chunks" of information. The net result of adding this concept adds quite a bit of lines of code, but it does have some major benefits: * Rather than stuffing new properties into yet another if-else spread out over multiple places in contacts-utils (and quite a bit of other files), we can create a new subclass of `Contacts.Chunk` * This also goes for property-specific logic, which we can consolidate within their appropriate classes/files. * All of our logic is now unit-testable In the future, this would allow for more cleanups/features: * We can put the serialization code for each property inside the `Contacts.Chunk` * We can extend ContactSheet to show a vCard's information, before actually importing it into a Folks.Individual. * We can write unit tests on the set of chunks, rather than regularly having to deal with yet another regression in e.g. the birthday editor.
Diffstat (limited to 'src/contacts-main-window.vala')
-rw-r--r--src/contacts-main-window.vala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/contacts-main-window.vala b/src/contacts-main-window.vala
index f6f465c..e2fbeec 100644
--- a/src/contacts-main-window.vala
+++ b/src/contacts-main-window.vala
@@ -443,7 +443,7 @@ public class Contacts.MainWindow : Adw.ApplicationWindow {
// clearing right_header
this.right_header.title_widget = new Adw.WindowTitle ("", "");
- if (selected == null) {
+ if (selected != null) {
this.ignore_favorite_button_toggled = true;
this.favorite_button.active = selected.is_favourite;
this.ignore_favorite_button_toggled = false;