From 844d04f2d9ea7273b39060bb435150df0062dcd8 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Thu, 28 Jan 2021 17:12:33 +0100 Subject: [PATCH] Remove unused CallsParty --- po/POTFILES.in | 1 - src/calls-party.c | 207 ---------------------------------------------- src/calls-party.h | 45 ---------- src/meson.build | 1 - 4 files changed, 254 deletions(-) delete mode 100644 src/calls-party.c delete mode 100644 src/calls-party.h diff --git a/po/POTFILES.in b/po/POTFILES.in index 857faa7..8225b42 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -20,7 +20,6 @@ src/calls-message-source.c src/calls-new-call-box.c src/calls-notifier.c src/calls-origin.c -src/calls-party.c src/calls-provider.c src/calls-record-store.c src/calls-ringer.c diff --git a/src/calls-party.c b/src/calls-party.c deleted file mode 100644 index b6eac9e..0000000 --- a/src/calls-party.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2018 Purism SPC - * - * This file is part of Calls. - * - * Calls is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calls is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calls. If not, see . - * - * Author: Bob Ham - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - */ - -#include "calls-party.h" -#include "util.h" - -#include - -/** - * SECTION:calls-party - * @short_description: A collection of data about an entity that party to a call. - * @Title: CallsParty - */ - -struct _CallsParty -{ - GObject parent_instance; - gchar *name; - gchar *number; -}; - -G_DEFINE_TYPE(CallsParty, calls_party, G_TYPE_OBJECT) - -enum { - PROP_0, - PROP_NAME, - PROP_NUMBER, - PROP_LAST_PROP, -}; -static GParamSpec *props[PROP_LAST_PROP]; - - -CallsParty * -calls_party_new (const gchar *name, const gchar *number) -{ - return g_object_new (CALLS_TYPE_PARTY, - "name", name, - "number", number, - NULL); -} - - -/** - * calls_party_create_image: - * @party: a #CallsParty - * - * Create a new #GtkImage widget that displays an appropriate image for - * the party. - * - * Returns: a new #GtkImage widget. - */ -GtkWidget * -calls_party_create_image (CallsParty *party) -{ - return gtk_image_new_from_icon_name ("avatar-default-symbolic", GTK_ICON_SIZE_DIALOG); -} - - -const gchar * -calls_party_get_name (CallsParty *party) -{ - g_return_val_if_fail (CALLS_IS_PARTY (party), NULL); - return CALLS_PARTY (party)->name; -} - - -const gchar * -calls_party_get_number (CallsParty *party) -{ - g_return_val_if_fail (CALLS_IS_PARTY (party), NULL); - return CALLS_PARTY (party)->number; -} - - -/** - * calls_party_get_label: - * @party: a #CallsParty - * - * Get an appropriate user-visible label for the party. - * - * Returns: the party's name if the name is non-NULL, otherwise the - * party's number. - */ -const gchar * calls_party_get_label (CallsParty *party) -{ - if (party->name) - { - return party->name; - } - - return party->number; -} - - -static void -get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - CallsParty *self = CALLS_PARTY (object); - - switch (property_id) { - case PROP_NAME: - g_value_set_string (value, self->name); - break; - - case PROP_NUMBER: - g_value_set_string (value, self->number); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - CallsParty *self = CALLS_PARTY (object); - - switch (property_id) { - case PROP_NAME: - CALLS_SET_PTR_PROPERTY (self->name, g_value_dup_string (value)); - break; - - case PROP_NUMBER: - CALLS_SET_PTR_PROPERTY (self->number, g_value_dup_string (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - - -static void -finalize (GObject *object) -{ - CallsParty *self = CALLS_PARTY (object); - - CALLS_SET_PTR_PROPERTY (self->number, NULL); - CALLS_SET_PTR_PROPERTY (self->name, NULL); - - G_OBJECT_CLASS (calls_party_parent_class)->finalize (object); -} - - -static void -calls_party_class_init (CallsPartyClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->finalize = finalize; - object_class->get_property = get_property; - object_class->set_property = set_property; - - props[PROP_NAME] = - g_param_spec_string ("name", - "Name", - "The party's name", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT); - - props[PROP_NUMBER] = - g_param_spec_string ("number", - "Number", - "The party's telephone number", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT); - - g_object_class_install_properties (object_class, PROP_LAST_PROP, props); -} - - -static void -calls_party_init (CallsParty *self) -{ -} - - diff --git a/src/calls-party.h b/src/calls-party.h deleted file mode 100644 index c691fb2..0000000 --- a/src/calls-party.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2018 Purism SPC - * - * This file is part of Calls. - * - * Calls is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calls is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calls. If not, see . - * - * Author: Bob Ham - * - * SPDX-License-Identifier: GPL-3.0-or-later - * - */ - -#ifndef CALLS_PARTY_H__ -#define CALLS_PARTY_H__ - -#include - -G_BEGIN_DECLS - -#define CALLS_TYPE_PARTY (calls_party_get_type ()) - -G_DECLARE_FINAL_TYPE (CallsParty, calls_party, CALLS, PARTY, GObject); - -CallsParty *calls_party_new (const gchar *name, - const gchar *number); -GtkWidget *calls_party_create_image (CallsParty *party); -const gchar * calls_party_get_name (CallsParty *party); -const gchar * calls_party_get_number (CallsParty *party); -const gchar * calls_party_get_label (CallsParty *party); - -G_END_DECLS - -#endif /* CALLS_PARTY_H__ */ diff --git a/src/meson.build b/src/meson.build index b864dc4..1db1fee 100644 --- a/src/meson.build +++ b/src/meson.build @@ -69,7 +69,6 @@ calls_sources = files(['calls-message-source.c', 'calls-message-source.h', 'calls-ussd.c', 'calls-origin.c', 'calls-origin.h', 'calls-provider.c', 'calls-provider.h', - 'calls-party.c', 'calls-party.h', 'calls-call-display.c', 'calls-call-display.h', 'calls-call-selector-item.c', 'calls-call-selector-item.h', 'calls-call-window.c', 'calls-call-window.h',