From f1f848c5f3d5d8d6866274a2e93dde0c1cddb5b6 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Mon, 2 Mar 2020 13:40:31 +0100 Subject: [PATCH] CallHistory: Don't pass the CallsNewCallBox to the CallsHistory Since we now have a "dial" action we can uses it also in the History, this way we don't need to pass arond the NewCallBox. --- src/calls-call-record-row.c | 13 +------------ src/calls-call-record-row.h | 3 +-- src/calls-history-box.c | 15 ++------------- src/calls-history-box.h | 3 +-- src/calls-main-window.c | 3 +-- 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/src/calls-call-record-row.c b/src/calls-call-record-row.c index fddfee7..888522d 100644 --- a/src/calls-call-record-row.c +++ b/src/calls-call-record-row.c @@ -54,8 +54,6 @@ struct _CallsCallRecordRow CallsContacts *contacts; CallsBestMatch *contact; - - CallsNewCallBox *new_call; }; G_DEFINE_TYPE (CallsCallRecordRow, calls_call_record_row, GTK_TYPE_LIST_BOX_ROW) @@ -461,11 +459,6 @@ set_property (GObject *object, CALLS_CONTACTS (g_value_get_object (value))); break; - case PROP_NEW_CALL: - g_set_object (&self->new_call, - CALLS_NEW_CALL_BOX (g_value_get_object (value))); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -534,8 +527,6 @@ dispose (GObject *object) { CallsCallRecordRow *self = CALLS_CALL_RECORD_ROW (object); - g_clear_object (&self->new_call); - g_clear_object (&self->contact); g_clear_object (&self->contacts); @@ -601,13 +592,11 @@ calls_call_record_row_init (CallsCallRecordRow *self) CallsCallRecordRow * calls_call_record_row_new (CallsCallRecord *record, - CallsContacts *contacts, - CallsNewCallBox *new_call) + CallsContacts *contacts) { return g_object_new (CALLS_TYPE_CALL_RECORD_ROW, "record", record, "contacts", contacts, - "new-call", new_call, NULL); } diff --git a/src/calls-call-record-row.h b/src/calls-call-record-row.h index 01b20c1..eb3b5e2 100644 --- a/src/calls-call-record-row.h +++ b/src/calls-call-record-row.h @@ -39,8 +39,7 @@ G_DECLARE_FINAL_TYPE (CallsCallRecordRow, calls_call_record_row, CALLS, CALL_RECORD_ROW, GtkListBoxRow) CallsCallRecordRow *calls_call_record_row_new (CallsCallRecord *record, - CallsContacts *contacts, - CallsNewCallBox *new_call); + CallsContacts *contacts); CallsCallRecord * calls_call_record_row_get_record (CallsCallRecordRow *self); G_END_DECLS diff --git a/src/calls-history-box.c b/src/calls-history-box.c index df17f80..32d75a5 100644 --- a/src/calls-history-box.c +++ b/src/calls-history-box.c @@ -44,8 +44,6 @@ struct _CallsHistoryBox gulong model_changed_handler_id; CallsContacts *contacts; - - CallsNewCallBox *new_call; }; G_DEFINE_TYPE (CallsHistoryBox, calls_history_box, GTK_TYPE_STACK); @@ -111,8 +109,7 @@ create_row_cb (CallsCallRecord *record, CallsHistoryBox *self) { return GTK_WIDGET (calls_call_record_row_new (record, - self->contacts, - self->new_call)); + self->contacts)); } @@ -136,11 +133,6 @@ set_property (GObject *object, CALLS_CONTACTS (g_value_get_object (value))); break; - case PROP_NEW_CALL: - g_set_object (&self->new_call, - CALLS_NEW_CALL_BOX (g_value_get_object (value))); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -182,7 +174,6 @@ dispose (GObject *object) { CallsHistoryBox *self = CALLS_HISTORY_BOX (object); - g_clear_object (&self->new_call); g_clear_object (&self->contacts); g_clear_object (&self->model); @@ -238,12 +229,10 @@ calls_history_box_init (CallsHistoryBox *self) CallsHistoryBox * calls_history_box_new (GListModel *model, - CallsContacts *contacts, - CallsNewCallBox *new_call) + CallsContacts *contacts) { return g_object_new (CALLS_TYPE_HISTORY_BOX, "model", model, "contacts", contacts, - "new-call", new_call, NULL); } diff --git a/src/calls-history-box.h b/src/calls-history-box.h index 49b8b5b..53613bb 100644 --- a/src/calls-history-box.h +++ b/src/calls-history-box.h @@ -40,8 +40,7 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (CallsHistoryBox, calls_history_box, CALLS, HISTORY_BOX, GtkStack); CallsHistoryBox * calls_history_box_new (GListModel *model, - CallsContacts *contacts, - CallsNewCallBox *new_call); + CallsContacts *contacts); G_END_DECLS diff --git a/src/calls-main-window.c b/src/calls-main-window.c index be499ca..7e92865 100644 --- a/src/calls-main-window.c +++ b/src/calls-main-window.c @@ -233,8 +233,7 @@ constructed (GObject *object) // Add call records history = calls_history_box_new (self->record_store, - self->contacts, - self->new_call); + self->contacts); widget = GTK_WIDGET (history); gtk_stack_add_titled (self->main_stack, widget, "recent", _("Recent"));