Uncrustify sources
Ran `find src plugins -iname '*.[c|h]' -print0 | xargs -0 uncrustify --no-backup` with some minimal manual intervention.
This commit is contained in:
@@ -29,8 +29,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
||||
struct _CallsDummyCall
|
||||
{
|
||||
struct _CallsDummyCall {
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
@@ -83,7 +82,7 @@ outbound_timeout_cb (CallsDummyCall *self)
|
||||
case CALLS_CALL_STATE_DIALING:
|
||||
calls_call_set_state (call, CALLS_CALL_STATE_ALERTING);
|
||||
g_timeout_add_seconds
|
||||
(3, (GSourceFunc)outbound_timeout_cb, self);
|
||||
(3, (GSourceFunc) outbound_timeout_cb, self);
|
||||
break;
|
||||
|
||||
case CALLS_CALL_STATE_ALERTING:
|
||||
@@ -116,7 +115,7 @@ constructed (GObject *object)
|
||||
CallsDummyCall *self = CALLS_DUMMY_CALL (object);
|
||||
|
||||
if (!calls_call_get_inbound (CALLS_CALL (object)))
|
||||
g_timeout_add_seconds (1, (GSourceFunc)outbound_timeout_cb, self);
|
||||
g_timeout_add_seconds (1, (GSourceFunc) outbound_timeout_cb, self);
|
||||
|
||||
G_OBJECT_CLASS (calls_dummy_call_parent_class)->constructed (object);
|
||||
}
|
||||
|
@@ -31,8 +31,7 @@
|
||||
#include <glib-object.h>
|
||||
|
||||
|
||||
struct _CallsDummyOrigin
|
||||
{
|
||||
struct _CallsDummyOrigin {
|
||||
GObject parent_instance;
|
||||
GString *name;
|
||||
GList *calls;
|
||||
@@ -99,8 +98,7 @@ remove_calls (CallsDummyOrigin *self, const gchar *reason)
|
||||
}
|
||||
|
||||
|
||||
struct DisconnectedData
|
||||
{
|
||||
struct DisconnectedData {
|
||||
CallsDummyOrigin *self;
|
||||
CallsCall *call;
|
||||
};
|
||||
|
@@ -22,8 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALLS_DUMMY_ORIGIN_H__
|
||||
#define CALLS_DUMMY_ORIGIN_H__
|
||||
#pragma once
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
@@ -38,5 +37,3 @@ void calls_dummy_origin_create_inbound (CallsDummyOrigin *self,
|
||||
const gchar *number);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* CALLS_DUMMY_ORIGIN_H__ */
|
||||
|
@@ -37,8 +37,7 @@ static const char * const supported_protocols[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
struct _CallsDummyProvider
|
||||
{
|
||||
struct _CallsDummyProvider {
|
||||
CallsProvider parent_instance;
|
||||
|
||||
GListStore *origins;
|
||||
@@ -50,14 +49,14 @@ static void calls_dummy_provider_message_source_interface_init (CallsMessageSour
|
||||
#ifdef FOR_TESTING
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE
|
||||
(CallsDummyProvider, calls_dummy_provider, CALLS_TYPE_PROVIDER,
|
||||
(CallsDummyProvider, calls_dummy_provider, CALLS_TYPE_PROVIDER,
|
||||
G_IMPLEMENT_INTERFACE (CALLS_TYPE_MESSAGE_SOURCE,
|
||||
calls_dummy_provider_message_source_interface_init))
|
||||
|
||||
#else
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE_EXTENDED
|
||||
(CallsDummyProvider, calls_dummy_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
(CallsDummyProvider, calls_dummy_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
G_IMPLEMENT_INTERFACE_DYNAMIC (CALLS_TYPE_MESSAGE_SOURCE,
|
||||
calls_dummy_provider_message_source_interface_init))
|
||||
|
||||
@@ -68,7 +67,8 @@ static gboolean
|
||||
usr1_handler (CallsDummyProvider *self)
|
||||
{
|
||||
GListModel *model;
|
||||
g_autoptr(CallsDummyOrigin) origin = NULL;
|
||||
|
||||
g_autoptr (CallsDummyOrigin) origin = NULL;
|
||||
|
||||
model = G_LIST_MODEL (self->origins);
|
||||
g_return_val_if_fail (g_list_model_get_n_items (model) > 0, FALSE);
|
||||
@@ -85,8 +85,9 @@ usr1_handler (CallsDummyProvider *self)
|
||||
static gboolean
|
||||
usr2_handler (CallsDummyProvider *self)
|
||||
{
|
||||
g_autoptr (CallsDummyOrigin) origin = NULL;
|
||||
|
||||
GListModel *model;
|
||||
g_autoptr(CallsDummyOrigin) origin = NULL;
|
||||
|
||||
model = G_LIST_MODEL (self->origins);
|
||||
g_return_val_if_fail (g_list_model_get_n_items (model) > 0, FALSE);
|
||||
@@ -120,7 +121,7 @@ calls_dummy_provider_get_origins (CallsProvider *provider)
|
||||
return G_LIST_MODEL (self->origins);
|
||||
}
|
||||
|
||||
static const char * const *
|
||||
static const char *const *
|
||||
calls_dummy_provider_get_protocols (CallsProvider *provider)
|
||||
{
|
||||
return supported_protocols;
|
||||
@@ -140,7 +141,7 @@ constructed (GObject *object)
|
||||
calls_dummy_provider_add_origin (self, "Dummy origin");
|
||||
|
||||
g_unix_signal_add (SIGUSR1,
|
||||
(GSourceFunc)usr1_handler,
|
||||
(GSourceFunc) usr1_handler,
|
||||
self);
|
||||
g_unix_signal_add (SIGUSR2,
|
||||
(GSourceFunc) usr2_handler,
|
||||
|
@@ -33,8 +33,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
||||
struct _CallsMMCall
|
||||
{
|
||||
struct _CallsMMCall {
|
||||
GObject parent_instance;
|
||||
MMCall *mm_call;
|
||||
gchar *disconnect_reason;
|
||||
@@ -61,8 +60,7 @@ notify_id_cb (CallsMMCall *self,
|
||||
}
|
||||
|
||||
|
||||
struct CallsMMCallStateReasonMap
|
||||
{
|
||||
struct CallsMMCallStateReasonMap {
|
||||
MMCallStateReason value;
|
||||
const gchar *desc;
|
||||
};
|
||||
@@ -95,14 +93,10 @@ set_disconnect_reason (CallsMMCall *self,
|
||||
const struct CallsMMCallStateReasonMap *map_row;
|
||||
|
||||
if (self->disconnect_reason)
|
||||
{
|
||||
g_free (self->disconnect_reason);
|
||||
}
|
||||
|
||||
for (map_row = STATE_REASON_MAP; map_row->desc; ++map_row)
|
||||
{
|
||||
if (map_row->value == reason)
|
||||
{
|
||||
for (map_row = STATE_REASON_MAP; map_row->desc; ++map_row) {
|
||||
if (map_row->value == reason) {
|
||||
self->disconnect_reason =
|
||||
g_strdup (gettext (map_row->desc));
|
||||
return;
|
||||
@@ -111,14 +105,13 @@ set_disconnect_reason (CallsMMCall *self,
|
||||
|
||||
self->disconnect_reason =
|
||||
g_strdup_printf (_("Call disconnected (unknown reason code %i)"),
|
||||
(int)reason);
|
||||
(int) reason);
|
||||
|
||||
g_warning ("%s", self->disconnect_reason);
|
||||
}
|
||||
|
||||
|
||||
struct CallsMMCallStateMap
|
||||
{
|
||||
struct CallsMMCallStateMap {
|
||||
MMCallState mm;
|
||||
CallsCallState calls;
|
||||
const gchar *name;
|
||||
@@ -152,14 +145,10 @@ state_changed_cb (CallsMMCall *self,
|
||||
const struct CallsMMCallStateMap *map_row;
|
||||
|
||||
if (mm_new == MM_CALL_STATE_TERMINATED)
|
||||
{
|
||||
set_disconnect_reason (self, reason);
|
||||
}
|
||||
|
||||
for (map_row = STATE_MAP; map_row->mm != -1; ++map_row)
|
||||
{
|
||||
if (map_row->mm == mm_new)
|
||||
{
|
||||
for (map_row = STATE_MAP; map_row->mm != -1; ++map_row) {
|
||||
if (map_row->mm == mm_new) {
|
||||
g_debug ("MM call state changed to `%s'",
|
||||
map_row->name);
|
||||
calls_call_set_state (CALLS_CALL (self), map_row->calls);
|
||||
@@ -175,8 +164,7 @@ calls_mm_call_get_protocol (CallsCall *self)
|
||||
return "tel";
|
||||
}
|
||||
|
||||
struct CallsMMOperationData
|
||||
{
|
||||
struct CallsMMOperationData {
|
||||
const gchar *desc;
|
||||
CallsMMCall *self;
|
||||
gboolean (*finish_func) (MMCall *, GAsyncResult *, GError **);
|
||||
@@ -188,11 +176,11 @@ operation_cb (MMCall *mm_call,
|
||||
struct CallsMMOperationData *data)
|
||||
{
|
||||
gboolean ok;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
ok = data->finish_func (mm_call, res, &error);
|
||||
if (!ok)
|
||||
{
|
||||
if (!ok) {
|
||||
g_warning ("Error %s ModemManager call to `%s': %s",
|
||||
data->desc,
|
||||
calls_call_get_id (CALLS_CALL (data->self)),
|
||||
@@ -222,9 +210,9 @@ operation_cb (MMCall *mm_call,
|
||||
data); \
|
||||
}
|
||||
|
||||
DEFINE_OPERATION(accept, calls_mm_call_answer, "accepting");
|
||||
DEFINE_OPERATION(hangup, calls_mm_call_hang_up, "hanging up");
|
||||
DEFINE_OPERATION(start, calls_mm_call_start_call, "starting outgoing call");
|
||||
DEFINE_OPERATION (accept, calls_mm_call_answer, "accepting");
|
||||
DEFINE_OPERATION (hangup, calls_mm_call_hang_up, "hanging up");
|
||||
DEFINE_OPERATION (start, calls_mm_call_start_call, "starting outgoing call");
|
||||
|
||||
|
||||
static void
|
||||
|
@@ -34,8 +34,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
||||
struct _CallsMMOrigin
|
||||
{
|
||||
struct _CallsMMOrigin {
|
||||
GObject parent_instance;
|
||||
MMObject *mm_obj;
|
||||
MMModemVoice *voice;
|
||||
@@ -85,8 +84,9 @@ ussd_initiate_cb (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMModem3gppUssd *ussd = (MMModem3gppUssd *)object;
|
||||
g_autoptr(GTask) task = user_data;
|
||||
MMModem3gppUssd *ussd = (MMModem3gppUssd *) object;
|
||||
|
||||
g_autoptr (GTask) task = user_data;
|
||||
CallsMMOrigin *self = user_data;
|
||||
char *response = NULL;
|
||||
GError *error = NULL;
|
||||
@@ -110,8 +110,9 @@ ussd_reinitiate_cb (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
CallsUssd *ussd = (CallsUssd *)object;
|
||||
g_autoptr(GTask) task = user_data;
|
||||
CallsUssd *ussd = (CallsUssd *) object;
|
||||
|
||||
g_autoptr (GTask) task = user_data;
|
||||
CallsMMOrigin *self = user_data;
|
||||
GCancellable *cancellable;
|
||||
GError *error = NULL;
|
||||
@@ -139,9 +140,10 @@ ussd_respond_cb (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMModem3gppUssd *ussd = (MMModem3gppUssd *)object;
|
||||
MMModem3gppUssd *ussd = (MMModem3gppUssd *) object;
|
||||
CallsMMOrigin *self;
|
||||
g_autoptr(GTask) task = user_data;
|
||||
|
||||
g_autoptr (GTask) task = user_data;
|
||||
char *response = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
@@ -164,9 +166,10 @@ ussd_cancel_cb (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMModem3gppUssd *ussd = (MMModem3gppUssd *)object;
|
||||
MMModem3gppUssd *ussd = (MMModem3gppUssd *) object;
|
||||
CallsMMOrigin *self;
|
||||
g_autoptr(GTask) task = user_data;
|
||||
|
||||
g_autoptr (GTask) task = user_data;
|
||||
GError *error = NULL;
|
||||
gboolean response;
|
||||
|
||||
@@ -203,22 +206,21 @@ calls_mm_ussd_initiate_async (CallsUssd *ussd,
|
||||
gpointer user_data)
|
||||
{
|
||||
CallsMMOrigin *self = CALLS_MM_ORIGIN (ussd);
|
||||
g_autoptr(GTask) task = NULL;
|
||||
|
||||
g_autoptr (GTask) task = NULL;
|
||||
CallsUssdState state;
|
||||
|
||||
g_return_if_fail (CALLS_IS_USSD (ussd));
|
||||
|
||||
task = g_task_new (self, cancellable, callback, user_data);
|
||||
|
||||
if (!self->ussd)
|
||||
{
|
||||
if (!self->ussd) {
|
||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
|
||||
"No USSD interface found");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!command || !*command)
|
||||
{
|
||||
if (!command || !*command) {
|
||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"USSD command empty");
|
||||
return;
|
||||
@@ -312,11 +314,11 @@ dial_cb (MMModemVoice *voice,
|
||||
CallsMMOrigin *self)
|
||||
{
|
||||
MMCall *call;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
call = mm_modem_voice_create_call_finish (voice, res, &error);
|
||||
if (!call)
|
||||
{
|
||||
if (!call) {
|
||||
g_warning ("Error dialing number on ModemManager modem `%s': %s",
|
||||
self->name, error->message);
|
||||
CALLS_ERROR (self, error);
|
||||
@@ -365,11 +367,10 @@ remove_calls (CallsMMOrigin *self, const gchar *reason)
|
||||
|
||||
paths = g_hash_table_get_keys (self->calls);
|
||||
|
||||
for (node = paths; node != NULL; node = node->next)
|
||||
{
|
||||
for (node = paths; node != NULL; node = node->next) {
|
||||
g_hash_table_steal_extended (self->calls, node->data, NULL, &call);
|
||||
g_signal_emit_by_name (self, "call-removed",
|
||||
CALLS_CALL(call), reason);
|
||||
CALLS_CALL (call), reason);
|
||||
g_object_unref (call);
|
||||
}
|
||||
|
||||
@@ -377,8 +378,7 @@ remove_calls (CallsMMOrigin *self, const gchar *reason)
|
||||
}
|
||||
|
||||
|
||||
struct CallsMMOriginDeleteCallData
|
||||
{
|
||||
struct CallsMMOriginDeleteCallData {
|
||||
CallsMMOrigin *self;
|
||||
gchar *path;
|
||||
};
|
||||
@@ -390,11 +390,11 @@ delete_call_cb (MMModemVoice *voice,
|
||||
struct CallsMMOriginDeleteCallData *data)
|
||||
{
|
||||
gboolean ok;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
ok = mm_modem_voice_delete_call_finish (voice, res, &error);
|
||||
if (!ok)
|
||||
{
|
||||
if (!ok) {
|
||||
g_warning ("Error deleting call `%s' on MMModemVoice `%s': %s",
|
||||
data->path, data->self->name, error->message);
|
||||
CALLS_ERROR (data->self, error);
|
||||
@@ -422,7 +422,7 @@ delete_call (CallsMMOrigin *self,
|
||||
(self->voice,
|
||||
path,
|
||||
NULL,
|
||||
(GAsyncReadyCallback)delete_call_cb,
|
||||
(GAsyncReadyCallback) delete_call_cb,
|
||||
data);
|
||||
}
|
||||
|
||||
@@ -457,12 +457,11 @@ add_call (CallsMMOrigin *self,
|
||||
path = mm_call_dup_path (mm_call);
|
||||
g_hash_table_insert (self->calls, path, call);
|
||||
|
||||
g_signal_emit_by_name (CALLS_ORIGIN(self), "call-added",
|
||||
CALLS_CALL(call));
|
||||
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added",
|
||||
CALLS_CALL (call));
|
||||
|
||||
if (mm_call_get_state (mm_call) == MM_CALL_STATE_TERMINATED)
|
||||
{
|
||||
// Delete any remnant disconnected call
|
||||
if (mm_call_get_state (mm_call) == MM_CALL_STATE_TERMINATED) {
|
||||
/* Delete any remnant disconnected call */
|
||||
delete_call (self, call);
|
||||
}
|
||||
|
||||
@@ -476,8 +475,7 @@ add_call (CallsMMOrigin *self,
|
||||
}
|
||||
|
||||
|
||||
struct CallsMMOriginCallAddedData
|
||||
{
|
||||
struct CallsMMOriginCallAddedData {
|
||||
CallsMMOrigin *self;
|
||||
gchar *path;
|
||||
};
|
||||
@@ -488,45 +486,37 @@ call_added_list_calls_cb (MMModemVoice *voice,
|
||||
GAsyncResult *res,
|
||||
struct CallsMMOriginCallAddedData *data)
|
||||
{
|
||||
GList *calls;
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
GList *calls;
|
||||
|
||||
calls = mm_modem_voice_list_calls_finish (voice, res, &error);
|
||||
if (!calls)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
if (!calls) {
|
||||
if (error) {
|
||||
g_warning ("Error listing calls on MMModemVoice `%s'"
|
||||
" after call-added signal: %s",
|
||||
data->self->name, error->message);
|
||||
CALLS_ERROR (data->self, error);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
g_warning ("No calls on MMModemVoice `%s'"
|
||||
" after call-added signal",
|
||||
data->self->name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
GList *node;
|
||||
MMCall *call;
|
||||
gboolean found = FALSE;
|
||||
|
||||
for (node = calls; node; node = node->next)
|
||||
{
|
||||
for (node = calls; node; node = node->next) {
|
||||
call = MM_CALL (node->data);
|
||||
|
||||
if (g_strcmp0 (mm_call_get_path (call), data->path) == 0)
|
||||
{
|
||||
if (g_strcmp0 (mm_call_get_path (call), data->path) == 0) {
|
||||
add_call (data->self, call);
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
if (!found) {
|
||||
g_warning ("Could not find new call `%s' in call list"
|
||||
" on MMModemVoice `%s' after call-added signal",
|
||||
data->path, data->self->name);
|
||||
@@ -547,8 +537,7 @@ call_added_cb (MMModemVoice *voice,
|
||||
{
|
||||
struct CallsMMOriginCallAddedData *data;
|
||||
|
||||
if (g_hash_table_contains (self->calls, path))
|
||||
{
|
||||
if (g_hash_table_contains (self->calls, path)) {
|
||||
g_warning ("Received call-added signal for"
|
||||
" existing call object path `%s'", path);
|
||||
return;
|
||||
@@ -582,8 +571,7 @@ call_deleted_cb (MMModemVoice *voice,
|
||||
|
||||
g_free (key);
|
||||
|
||||
if (!call)
|
||||
{
|
||||
if (!call) {
|
||||
g_warning ("Could not find removed call `%s'", path);
|
||||
return;
|
||||
}
|
||||
@@ -591,8 +579,7 @@ call_deleted_cb (MMModemVoice *voice,
|
||||
reason = g_string_new ("Call removed");
|
||||
|
||||
mm_reason = calls_mm_call_get_disconnect_reason (CALLS_MM_CALL (call));
|
||||
if (mm_reason)
|
||||
{
|
||||
if (mm_reason) {
|
||||
g_string_assign (reason, mm_reason);
|
||||
}
|
||||
|
||||
@@ -611,13 +598,12 @@ list_calls_cb (MMModemVoice *voice,
|
||||
CallsMMOrigin *self)
|
||||
{
|
||||
GList *calls, *node;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
calls = mm_modem_voice_list_calls_finish (voice, res, &error);
|
||||
if (!calls)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
if (!calls) {
|
||||
if (error) {
|
||||
g_warning ("Error listing calls on MMModemVoice `%s': %s",
|
||||
self->name, error->message);
|
||||
CALLS_ERROR (self, error);
|
||||
@@ -625,8 +611,7 @@ list_calls_cb (MMModemVoice *voice,
|
||||
return;
|
||||
}
|
||||
|
||||
for (node = calls; node; node = node->next)
|
||||
{
|
||||
for (node = calls; node; node = node->next) {
|
||||
add_call (self, MM_CALL (node->data));
|
||||
}
|
||||
|
||||
@@ -648,7 +633,7 @@ set_property (GObject *object,
|
||||
break;
|
||||
|
||||
case PROP_MODEM:
|
||||
g_set_object (&self->mm_obj, g_value_get_object(value));
|
||||
g_set_object (&self->mm_obj, g_value_get_object (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -676,7 +661,7 @@ get_property (GObject *object,
|
||||
break;
|
||||
|
||||
case PROP_CALLS:
|
||||
g_value_set_pointer(value, g_hash_table_get_values (self->calls));
|
||||
g_value_set_pointer (value, g_hash_table_get_values (self->calls));
|
||||
break;
|
||||
|
||||
case PROP_COUNTRY_CODE:
|
||||
@@ -741,28 +726,26 @@ ussd_properties_changed_cb (CallsMMOrigin *self,
|
||||
/* XXX: We check for user state only because the NetworkRequest
|
||||
* dbus property change isn't regularly emitted */
|
||||
if (state == CALLS_USSD_STATE_USER_RESPONSE ||
|
||||
(value = g_variant_lookup_value (properties, "NetworkRequest", NULL)))
|
||||
{
|
||||
(value = g_variant_lookup_value (properties, "NetworkRequest", NULL))) {
|
||||
response = mm_modem_3gpp_ussd_get_network_request (self->ussd);
|
||||
|
||||
if (response && *response && response != self->last_ussd_request)
|
||||
g_signal_emit_by_name (self, "ussd-added", response);
|
||||
|
||||
if (response && *response)
|
||||
self->last_ussd_request = (char *)response;
|
||||
self->last_ussd_request = (char *) response;
|
||||
g_clear_pointer (&value, g_variant_unref);
|
||||
}
|
||||
|
||||
if (state != CALLS_USSD_STATE_USER_RESPONSE &&
|
||||
(value = g_variant_lookup_value (properties, "NetworkNotification", NULL)))
|
||||
{
|
||||
(value = g_variant_lookup_value (properties, "NetworkNotification", NULL))) {
|
||||
response = mm_modem_3gpp_ussd_get_network_notification (self->ussd);
|
||||
|
||||
if (response && *response && response != self->last_ussd_response)
|
||||
g_signal_emit_by_name (self, "ussd-added", response);
|
||||
|
||||
if (response && *response)
|
||||
self->last_ussd_response = (char *)response;
|
||||
self->last_ussd_response = (char *) response;
|
||||
g_clear_pointer (&value, g_variant_unref);
|
||||
}
|
||||
}
|
||||
@@ -962,4 +945,3 @@ calls_mm_origin_matches (CallsMMOrigin *self,
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -39,8 +39,7 @@ static const char * const supported_protocols[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
struct _CallsMMProvider
|
||||
{
|
||||
struct _CallsMMProvider {
|
||||
CallsProvider parent_instance;
|
||||
|
||||
/* The status property */
|
||||
@@ -56,7 +55,7 @@ struct _CallsMMProvider
|
||||
static void calls_mm_provider_message_source_interface_init (CallsMessageSourceInterface *iface);
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE_EXTENDED
|
||||
(CallsMMProvider, calls_mm_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
(CallsMMProvider, calls_mm_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
G_IMPLEMENT_INTERFACE_DYNAMIC (CALLS_TYPE_MESSAGE_SOURCE,
|
||||
calls_mm_provider_message_source_interface_init))
|
||||
|
||||
@@ -66,9 +65,7 @@ set_status (CallsMMProvider *self,
|
||||
const gchar *new_status)
|
||||
{
|
||||
if (strcmp (self->status, new_status) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_free (self->status);
|
||||
self->status = g_strdup (new_status);
|
||||
@@ -81,16 +78,11 @@ update_status (CallsMMProvider *self)
|
||||
{
|
||||
const gchar *s;
|
||||
|
||||
if (!self->mm)
|
||||
{
|
||||
if (!self->mm) {
|
||||
s = _("ModemManager unavailable");
|
||||
}
|
||||
else if (g_list_model_get_n_items (G_LIST_MODEL (self->origins)) == 0)
|
||||
{
|
||||
} else if (g_list_model_get_n_items (G_LIST_MODEL (self->origins)) == 0) {
|
||||
s = _("No voice-capable modem available");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
s = _("Normal");
|
||||
}
|
||||
|
||||
@@ -111,9 +103,8 @@ mm_provider_contains (CallsMMProvider *self,
|
||||
model = G_LIST_MODEL (self->origins);
|
||||
n_items = g_list_model_get_n_items (model);
|
||||
|
||||
for (guint i = 0; i < n_items; i++)
|
||||
{
|
||||
g_autoptr(CallsMMOrigin) origin = NULL;
|
||||
for (guint i = 0; i < n_items; i++) {
|
||||
g_autoptr (CallsMMOrigin) origin = NULL;
|
||||
|
||||
origin = g_list_model_get_item (model, i);
|
||||
|
||||
@@ -129,6 +120,7 @@ add_origin (CallsMMProvider *self,
|
||||
GDBusObject *object)
|
||||
{
|
||||
MMObject *mm_obj;
|
||||
|
||||
g_autoptr (CallsMMOrigin) origin = NULL;
|
||||
g_autoptr (MMModem3gpp) modem_3gpp = NULL;
|
||||
const gchar *path;
|
||||
@@ -136,8 +128,7 @@ add_origin (CallsMMProvider *self,
|
||||
|
||||
mm_obj = MM_OBJECT (object);
|
||||
path = g_dbus_object_get_object_path (object);
|
||||
if (mm_provider_contains (self, mm_obj))
|
||||
{
|
||||
if (mm_provider_contains (self, mm_obj)) {
|
||||
g_warning ("New voice interface on existing"
|
||||
" origin with path `%s'", path);
|
||||
return;
|
||||
@@ -172,8 +163,7 @@ interface_added_cb (CallsMMProvider *self,
|
||||
g_dbus_object_get_object_path (object));
|
||||
|
||||
if (g_strcmp0 (info->name,
|
||||
"org.freedesktop.ModemManager1.Modem.Voice") == 0)
|
||||
{
|
||||
"org.freedesktop.ModemManager1.Modem.Voice") == 0) {
|
||||
add_origin (self, object);
|
||||
}
|
||||
}
|
||||
@@ -195,8 +185,7 @@ remove_modem_object (CallsMMProvider *self,
|
||||
|
||||
origin = g_list_model_get_item (model, i);
|
||||
|
||||
if (calls_mm_origin_matches (origin, MM_OBJECT (object)))
|
||||
{
|
||||
if (calls_mm_origin_matches (origin, MM_OBJECT (object))) {
|
||||
g_list_store_remove (self->origins, i);
|
||||
update_status (self);
|
||||
|
||||
@@ -221,8 +210,7 @@ interface_removed_cb (CallsMMProvider *self,
|
||||
info->name, path);
|
||||
|
||||
if (g_strcmp0 (info->name,
|
||||
"org.freedesktop.ModemManager1.Modem.Voice") == 0)
|
||||
{
|
||||
"org.freedesktop.ModemManager1.Modem.Voice") == 0) {
|
||||
remove_modem_object (self, path, object);
|
||||
}
|
||||
}
|
||||
@@ -234,8 +222,7 @@ add_mm_object (CallsMMProvider *self, GDBusObject *object)
|
||||
GList *ifaces, *node;
|
||||
|
||||
ifaces = g_dbus_object_get_interfaces (object);
|
||||
for (node = ifaces; node; node = node->next)
|
||||
{
|
||||
for (node = ifaces; node; node = node->next) {
|
||||
interface_added_cb (self, object,
|
||||
G_DBUS_INTERFACE (node->data));
|
||||
}
|
||||
@@ -250,8 +237,7 @@ add_mm_objects (CallsMMProvider *self)
|
||||
GList *objects, *node;
|
||||
|
||||
objects = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (self->mm));
|
||||
for (node = objects; node; node = node->next)
|
||||
{
|
||||
for (node = objects; node; node = node->next) {
|
||||
add_mm_object (self, G_DBUS_OBJECT (node->data));
|
||||
}
|
||||
|
||||
@@ -291,11 +277,10 @@ mm_manager_new_cb (GDBusConnection *connection,
|
||||
GError *error = NULL;
|
||||
|
||||
self->mm = mm_manager_new_finish (res, &error);
|
||||
if (!self->mm)
|
||||
{
|
||||
if (!self->mm) {
|
||||
g_error ("Error creating ModemManager Manager: %s",
|
||||
error->message);
|
||||
g_assert_not_reached();
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
|
||||
@@ -366,7 +351,7 @@ calls_mm_provider_get_origins (CallsProvider *provider)
|
||||
return G_LIST_MODEL (self->origins);
|
||||
}
|
||||
|
||||
static const char * const *
|
||||
static const char *const *
|
||||
calls_mm_provider_get_protocols (CallsProvider *provider)
|
||||
{
|
||||
return supported_protocols;
|
||||
@@ -387,8 +372,8 @@ constructed (GObject *object)
|
||||
g_bus_watch_name (G_BUS_TYPE_SYSTEM,
|
||||
MM_DBUS_SERVICE,
|
||||
G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
|
||||
(GBusNameAppearedCallback)mm_appeared_cb,
|
||||
(GBusNameVanishedCallback)mm_vanished_cb,
|
||||
(GBusNameAppearedCallback) mm_appeared_cb,
|
||||
(GBusNameVanishedCallback) mm_vanished_cb,
|
||||
self, NULL);
|
||||
|
||||
g_debug ("Watching for ModemManager");
|
||||
@@ -402,8 +387,7 @@ dispose (GObject *object)
|
||||
{
|
||||
CallsMMProvider *self = CALLS_MM_PROVIDER (object);
|
||||
|
||||
if (self->watch_id)
|
||||
{
|
||||
if (self->watch_id) {
|
||||
g_bus_unwatch_name (self->watch_id);
|
||||
self->watch_id = 0;
|
||||
}
|
||||
|
@@ -16,8 +16,7 @@
|
||||
#include <glib.h>
|
||||
|
||||
|
||||
struct mcc_list
|
||||
{
|
||||
struct mcc_list {
|
||||
guint mcc;
|
||||
char code[3];
|
||||
};
|
||||
|
@@ -31,8 +31,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
||||
struct _CallsOfonoCall
|
||||
{
|
||||
struct _CallsOfonoCall {
|
||||
GObject parent_instance;
|
||||
GDBOVoiceCall *voice_call;
|
||||
gchar *disconnect_reason;
|
||||
@@ -55,7 +54,7 @@ enum {
|
||||
SIGNAL_TONE,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals [SIGNAL_LAST_SIGNAL];
|
||||
static guint signals[SIGNAL_LAST_SIGNAL];
|
||||
|
||||
static const char *
|
||||
calls_ofono_call_get_protocol (CallsCall *call)
|
||||
@@ -63,8 +62,7 @@ calls_ofono_call_get_protocol (CallsCall *call)
|
||||
return "tel";
|
||||
}
|
||||
|
||||
struct CallsCallOperationData
|
||||
{
|
||||
struct CallsCallOperationData {
|
||||
const gchar *desc;
|
||||
CallsOfonoCall *self;
|
||||
gboolean (*finish_func) (GDBOVoiceCall *, GAsyncResult *, GError **);
|
||||
@@ -76,9 +74,10 @@ operation_cb (GDBOVoiceCall *voice_call,
|
||||
GAsyncResult *res,
|
||||
struct CallsCallOperationData *data)
|
||||
{
|
||||
gboolean ok;
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
gboolean ok;
|
||||
|
||||
ok = data->finish_func (voice_call, res, &error);
|
||||
if (!ok) {
|
||||
g_warning ("Error %s oFono voice call to `%s': %s",
|
||||
@@ -133,6 +132,7 @@ static void
|
||||
calls_ofono_call_send_dtmf_tone (CallsCall *call, gchar key)
|
||||
{
|
||||
CallsOfonoCall *self = CALLS_OFONO_CALL (call);
|
||||
|
||||
if (calls_call_get_state (call) != CALLS_CALL_STATE_ACTIVE) {
|
||||
g_warning ("Tone start requested for non-active call to `%s'",
|
||||
calls_call_get_id (call));
|
||||
|
@@ -32,8 +32,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
||||
struct _CallsOfonoOrigin
|
||||
{
|
||||
struct _CallsOfonoOrigin {
|
||||
GObject parent_instance;
|
||||
GDBusConnection *connection;
|
||||
GDBOModem *modem;
|
||||
@@ -71,12 +70,12 @@ dial_cb (GDBOVoiceCallManager *voice,
|
||||
CallsOfonoOrigin *self)
|
||||
{
|
||||
gboolean ok;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
ok = gdbo_voice_call_manager_call_dial_finish
|
||||
(voice, NULL, res, &error);
|
||||
if (!ok)
|
||||
{
|
||||
if (!ok) {
|
||||
g_warning ("Error dialing number on modem `%s': %s",
|
||||
self->name, error->message);
|
||||
CALLS_ERROR (self, error);
|
||||
@@ -178,7 +177,7 @@ get_property (GObject *object,
|
||||
break;
|
||||
|
||||
case PROP_CALLS:
|
||||
g_value_set_pointer(value, g_hash_table_get_values (self->calls));
|
||||
g_value_set_pointer (value, g_hash_table_get_values (self->calls));
|
||||
break;
|
||||
|
||||
case PROP_COUNTRY_CODE:
|
||||
@@ -199,14 +198,13 @@ remove_call (CallsOfonoOrigin *self,
|
||||
{
|
||||
const gchar *path = calls_ofono_call_get_object_path (call);
|
||||
|
||||
g_signal_emit_by_name (CALLS_ORIGIN(self), "call-removed",
|
||||
CALLS_CALL(call), reason);
|
||||
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-removed",
|
||||
CALLS_CALL (call), reason);
|
||||
g_hash_table_remove (self->calls, path);
|
||||
}
|
||||
|
||||
|
||||
struct CallsRemoveCallsData
|
||||
{
|
||||
struct CallsRemoveCallsData {
|
||||
CallsOrigin *origin;
|
||||
const gchar *reason;
|
||||
};
|
||||
@@ -217,7 +215,7 @@ remove_calls_cb (const gchar *path,
|
||||
struct CallsRemoveCallsData *data)
|
||||
{
|
||||
g_signal_emit_by_name (data->origin, "call-removed",
|
||||
CALLS_CALL(call), data->reason);
|
||||
CALLS_CALL (call), data->reason);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -232,8 +230,7 @@ remove_calls (CallsOfonoOrigin *self, const gchar *reason)
|
||||
}
|
||||
|
||||
|
||||
struct CallsVoiceCallProxyNewData
|
||||
{
|
||||
struct CallsVoiceCallProxyNewData {
|
||||
CallsOfonoOrigin *self;
|
||||
GVariant *properties;
|
||||
};
|
||||
@@ -250,20 +247,17 @@ send_tones_cb (GDBOVoiceCallManager *voice,
|
||||
/* Deal with old tones */
|
||||
ok = gdbo_voice_call_manager_call_send_tones_finish
|
||||
(voice, res, &error);
|
||||
if (!ok)
|
||||
{
|
||||
if (!ok) {
|
||||
g_warning ("Error sending DTMF tones to network on modem `%s': %s",
|
||||
self->name, error->message);
|
||||
CALLS_EMIT_MESSAGE (self, error->message, GTK_MESSAGE_WARNING);
|
||||
}
|
||||
|
||||
/* Possibly send new tones */
|
||||
if (self->tone_queue)
|
||||
{
|
||||
if (self->tone_queue) {
|
||||
g_debug ("Sending queued DTMF tones `%s'", self->tone_queue->str);
|
||||
|
||||
gdbo_voice_call_manager_call_send_tones
|
||||
(voice,
|
||||
gdbo_voice_call_manager_call_send_tones (voice,
|
||||
self->tone_queue->str,
|
||||
NULL,
|
||||
(GAsyncReadyCallback) send_tones_cb,
|
||||
@@ -271,9 +265,7 @@ send_tones_cb (GDBOVoiceCallManager *voice,
|
||||
|
||||
g_string_free (self->tone_queue, TRUE);
|
||||
self->tone_queue = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
self->sending_tones = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -285,23 +277,16 @@ tone_cb (CallsOfonoOrigin *self,
|
||||
{
|
||||
const gchar key_str[2] = { key, '\0' };
|
||||
|
||||
if (self->sending_tones)
|
||||
{
|
||||
if (self->tone_queue)
|
||||
{
|
||||
if (self->sending_tones) {
|
||||
if (self->tone_queue) {
|
||||
g_string_append_c (self->tone_queue, key);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
self->tone_queue = g_string_new (key_str);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
g_debug ("Sending immediate DTMF tone `%c'", key);
|
||||
|
||||
gdbo_voice_call_manager_call_send_tones
|
||||
(self->voice,
|
||||
gdbo_voice_call_manager_call_send_tones (self->voice,
|
||||
key_str,
|
||||
NULL,
|
||||
(GAsyncReadyCallback) send_tones_cb,
|
||||
@@ -318,13 +303,13 @@ voice_call_proxy_new_cb (GDBusConnection *connection,
|
||||
{
|
||||
CallsOfonoOrigin *self = data->self;
|
||||
GDBOVoiceCall *voice_call;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
const gchar *path;
|
||||
CallsOfonoCall *call;
|
||||
|
||||
voice_call = gdbo_voice_call_proxy_new_finish (res, &error);
|
||||
if (!voice_call)
|
||||
{
|
||||
if (!voice_call) {
|
||||
g_variant_unref (data->properties);
|
||||
g_free (data);
|
||||
g_warning ("Error creating oFono VoiceCall proxy: %s",
|
||||
@@ -338,10 +323,10 @@ voice_call_proxy_new_cb (GDBusConnection *connection,
|
||||
G_CALLBACK (tone_cb), self);
|
||||
|
||||
path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (voice_call));
|
||||
g_hash_table_insert (self->calls, g_strdup(path), call);
|
||||
g_hash_table_insert (self->calls, g_strdup (path), call);
|
||||
|
||||
g_signal_emit_by_name (CALLS_ORIGIN(self), "call-added",
|
||||
CALLS_CALL(call));
|
||||
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added",
|
||||
CALLS_CALL (call));
|
||||
|
||||
g_debug ("Call `%s' added", path);
|
||||
}
|
||||
@@ -357,8 +342,7 @@ call_added_cb (GDBOVoiceCallManager *voice,
|
||||
|
||||
g_debug ("Adding call `%s'", path);
|
||||
|
||||
if (g_hash_table_lookup (self->calls, path))
|
||||
{
|
||||
if (g_hash_table_lookup (self->calls, path)) {
|
||||
g_warning ("Call `%s' already exists", path);
|
||||
return;
|
||||
}
|
||||
@@ -393,8 +377,7 @@ call_removed_cb (GDBOVoiceCallManager *voice,
|
||||
g_debug ("Removing call `%s'", path);
|
||||
|
||||
ofono_call = g_hash_table_lookup (self->calls, path);
|
||||
if (!ofono_call)
|
||||
{
|
||||
if (!ofono_call) {
|
||||
g_warning ("Could not find removed call `%s'", path);
|
||||
return;
|
||||
}
|
||||
@@ -402,8 +385,7 @@ call_removed_cb (GDBOVoiceCallManager *voice,
|
||||
reason = g_string_new ("Call removed");
|
||||
|
||||
ofono_reason = calls_ofono_call_get_disconnect_reason (ofono_call);
|
||||
if (ofono_reason)
|
||||
{
|
||||
if (ofono_reason) {
|
||||
/* The oFono reason is either "local", "remote" or "network".
|
||||
* We just capitalise that to create a nice reason string.
|
||||
*/
|
||||
@@ -426,6 +408,7 @@ get_calls_cb (GDBOVoiceCallManager *voice,
|
||||
{
|
||||
gboolean ok;
|
||||
GVariant *calls_with_properties = NULL;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
GVariantIter *iter = NULL;
|
||||
const gchar *path;
|
||||
@@ -433,8 +416,7 @@ get_calls_cb (GDBOVoiceCallManager *voice,
|
||||
|
||||
ok = gdbo_voice_call_manager_call_get_calls_finish
|
||||
(voice, &calls_with_properties, res, &error);
|
||||
if (!ok)
|
||||
{
|
||||
if (!ok) {
|
||||
g_warning ("Error getting calls from oFono"
|
||||
" VoiceCallManager `%s': %s",
|
||||
self->name, error->message);
|
||||
@@ -471,8 +453,7 @@ voice_new_cb (GDBusConnection *connection,
|
||||
|
||||
self->voice = gdbo_voice_call_manager_proxy_new_finish
|
||||
(res, &error);
|
||||
if (!self->voice)
|
||||
{
|
||||
if (!self->voice) {
|
||||
g_warning ("Error creating oFono"
|
||||
" VoiceCallManager `%s' proxy: %s",
|
||||
self->name, error->message);
|
||||
@@ -510,9 +491,7 @@ constructed (GObject *object)
|
||||
name = g_object_get_data (G_OBJECT (self->modem),
|
||||
"calls-modem-name");
|
||||
if (name)
|
||||
{
|
||||
self->name = g_strdup (name);
|
||||
}
|
||||
|
||||
gdbo_voice_call_manager_proxy_new
|
||||
(self->connection,
|
||||
@@ -520,7 +499,7 @@ constructed (GObject *object)
|
||||
g_dbus_proxy_get_name (modem_proxy),
|
||||
g_dbus_proxy_get_object_path (modem_proxy),
|
||||
NULL,
|
||||
(GAsyncReadyCallback)voice_new_cb,
|
||||
(GAsyncReadyCallback) voice_new_cb,
|
||||
self);
|
||||
|
||||
G_OBJECT_CLASS (calls_ofono_origin_parent_class)->constructed (object);
|
||||
@@ -545,8 +524,7 @@ finalize (GObject *object)
|
||||
{
|
||||
CallsOfonoOrigin *self = CALLS_OFONO_ORIGIN (object);
|
||||
|
||||
if (self->tone_queue)
|
||||
{
|
||||
if (self->tone_queue) {
|
||||
g_string_free (self->tone_queue, TRUE);
|
||||
}
|
||||
g_free (self->name);
|
||||
|
@@ -41,8 +41,7 @@ static const char * const supported_protocols[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
struct _CallsOfonoProvider
|
||||
{
|
||||
struct _CallsOfonoProvider {
|
||||
CallsProvider parent_instance;
|
||||
|
||||
/* The status property */
|
||||
@@ -64,7 +63,7 @@ static void calls_ofono_provider_message_source_interface_init (CallsMessageSour
|
||||
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE_EXTENDED
|
||||
(CallsOfonoProvider, calls_ofono_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
(CallsOfonoProvider, calls_ofono_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
G_IMPLEMENT_INTERFACE_DYNAMIC (CALLS_TYPE_MESSAGE_SOURCE,
|
||||
calls_ofono_provider_message_source_interface_init))
|
||||
|
||||
@@ -73,8 +72,7 @@ static void
|
||||
set_status (CallsOfonoProvider *self,
|
||||
const gchar *new_status)
|
||||
{
|
||||
if (strcmp (self->status, new_status) == 0)
|
||||
{
|
||||
if (strcmp (self->status, new_status) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -92,16 +90,11 @@ update_status (CallsOfonoProvider *self)
|
||||
|
||||
model = G_LIST_MODEL (self->origins);
|
||||
|
||||
if (!self->connection)
|
||||
{
|
||||
if (!self->connection) {
|
||||
s = _("DBus unavailable");
|
||||
}
|
||||
else if (g_list_model_get_n_items (model) == 0)
|
||||
{
|
||||
} else if (g_list_model_get_n_items (model) == 0) {
|
||||
s = _("No voice-capable modem available");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
s = _("Normal");
|
||||
}
|
||||
|
||||
@@ -122,14 +115,12 @@ ofono_find_origin_index (CallsOfonoProvider *self,
|
||||
model = G_LIST_MODEL (self->origins);
|
||||
n_items = g_list_model_get_n_items (model);
|
||||
|
||||
for (guint i = 0; i < n_items; i++)
|
||||
{
|
||||
g_autoptr(CallsOfonoOrigin) origin = NULL;
|
||||
for (guint i = 0; i < n_items; i++) {
|
||||
g_autoptr (CallsOfonoOrigin) origin = NULL;
|
||||
|
||||
origin = g_list_model_get_item (model, i);
|
||||
|
||||
if (calls_ofono_origin_matches (origin, path))
|
||||
{
|
||||
if (calls_ofono_origin_matches (origin, path)) {
|
||||
if (index)
|
||||
*index = i;
|
||||
|
||||
@@ -148,10 +139,10 @@ object_array_includes (GVariantIter *iter,
|
||||
{
|
||||
const gchar *str;
|
||||
gboolean found = FALSE;
|
||||
|
||||
while (g_variant_iter_loop (iter, "&s", &str))
|
||||
{
|
||||
if (g_strcmp0 (str, needle) == 0)
|
||||
{
|
||||
if (g_strcmp0 (str, needle) == 0) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -176,23 +167,19 @@ modem_check_ifaces (CallsOfonoProvider *self,
|
||||
|
||||
g_variant_get (ifaces, "as", &iter);
|
||||
|
||||
voice = object_array_includes
|
||||
(iter, "org.ofono.VoiceCallManager");
|
||||
voice = object_array_includes (iter, "org.ofono.VoiceCallManager");
|
||||
|
||||
path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (modem));
|
||||
|
||||
has_origin = ofono_find_origin_index (self, path, &index);
|
||||
if (voice && !has_origin)
|
||||
{
|
||||
g_autoptr(CallsOfonoOrigin) origin = NULL;
|
||||
if (voice && !has_origin) {
|
||||
g_autoptr (CallsOfonoOrigin) origin = NULL;
|
||||
|
||||
g_debug ("Adding oFono Origin with path `%s'", path);
|
||||
|
||||
origin = calls_ofono_origin_new (modem);
|
||||
g_list_store_append (self->origins, origin);
|
||||
}
|
||||
else if (!voice && has_origin)
|
||||
{
|
||||
} else if (!voice && has_origin) {
|
||||
g_list_store_remove (self->origins, index);
|
||||
}
|
||||
}
|
||||
@@ -209,22 +196,19 @@ modem_property_changed_cb (GDBOModem *modem,
|
||||
g_debug ("Modem property `%s' changed", name);
|
||||
|
||||
if (g_strcmp0 (name, "Interfaces") != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
modem_name = g_object_get_data (G_OBJECT (modem),
|
||||
"calls-modem-name");
|
||||
|
||||
/* PropertyChanged gives us a variant gvariant containing a string array,
|
||||
but modem_check_ifaces expects the inner string array gvariant */
|
||||
value = g_variant_get_variant(value);
|
||||
value = g_variant_get_variant (value);
|
||||
modem_check_ifaces (self, modem, modem_name, value);
|
||||
}
|
||||
|
||||
|
||||
struct CallsModemProxyNewData
|
||||
{
|
||||
struct CallsModemProxyNewData {
|
||||
CallsOfonoProvider *self;
|
||||
gchar *name;
|
||||
GVariant *ifaces;
|
||||
@@ -241,8 +225,7 @@ modem_proxy_new_cb (GDBusConnection *connection,
|
||||
const gchar *path;
|
||||
|
||||
modem = gdbo_modem_proxy_new_finish (res, &error);
|
||||
if (!modem)
|
||||
{
|
||||
if (!modem) {
|
||||
g_variant_unref (data->ifaces);
|
||||
g_free (data->name);
|
||||
g_free (data);
|
||||
@@ -263,11 +246,10 @@ modem_proxy_new_cb (GDBusConnection *connection,
|
||||
|
||||
path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (modem));
|
||||
|
||||
g_hash_table_insert (data->self->modems, g_strdup(path), modem);
|
||||
g_hash_table_insert (data->self->modems, g_strdup (path), modem);
|
||||
|
||||
|
||||
if (data->ifaces)
|
||||
{
|
||||
if (data->ifaces) {
|
||||
modem_check_ifaces (data->self, modem,
|
||||
data->name, data->ifaces);
|
||||
g_variant_unref (data->ifaces);
|
||||
@@ -302,7 +284,7 @@ modem_properties_get_name (GVariant *properties)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char * const *
|
||||
static const char *const *
|
||||
calls_ofono_provider_get_protocols (CallsProvider *provider)
|
||||
{
|
||||
return supported_protocols;
|
||||
@@ -324,8 +306,7 @@ modem_added_cb (GDBOManager *manager,
|
||||
|
||||
g_debug ("Adding modem `%s'", path);
|
||||
|
||||
if (g_hash_table_lookup (self->modems, path))
|
||||
{
|
||||
if (g_hash_table_lookup (self->modems, path)) {
|
||||
g_warning ("Modem `%s' already exists", path);
|
||||
return;
|
||||
}
|
||||
@@ -336,8 +317,7 @@ modem_added_cb (GDBOManager *manager,
|
||||
|
||||
data->ifaces = g_variant_lookup_value
|
||||
(properties, "Interfaces", G_VARIANT_TYPE_ARRAY);
|
||||
if (data->ifaces)
|
||||
{
|
||||
if (data->ifaces) {
|
||||
g_variant_ref (data->ifaces);
|
||||
}
|
||||
|
||||
@@ -377,17 +357,17 @@ get_modems_cb (GDBOManager *manager,
|
||||
GAsyncResult *res,
|
||||
CallsOfonoProvider *self)
|
||||
{
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
gboolean ok;
|
||||
GVariant *modems;
|
||||
GVariantIter *modems_iter = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
const gchar *path;
|
||||
GVariant *properties;
|
||||
|
||||
ok = gdbo_manager_call_get_modems_finish (manager, &modems,
|
||||
res, &error);
|
||||
if (!ok)
|
||||
{
|
||||
if (!ok) {
|
||||
g_warning ("Error getting modems from oFono Manager: %s",
|
||||
error->message);
|
||||
CALLS_ERROR (self, error);
|
||||
@@ -442,8 +422,7 @@ ofono_appeared_cb (GDBusConnection *connection,
|
||||
{
|
||||
g_autoptr (GError) error = NULL;
|
||||
self->connection = connection;
|
||||
if (!self->connection)
|
||||
{
|
||||
if (!self->connection) {
|
||||
g_error ("Error creating D-Bus connection: %s",
|
||||
error->message);
|
||||
}
|
||||
@@ -455,8 +434,7 @@ ofono_appeared_cb (GDBusConnection *connection,
|
||||
"/",
|
||||
NULL,
|
||||
&error);
|
||||
if (!self->manager)
|
||||
{
|
||||
if (!self->manager) {
|
||||
g_error ("Error creating ModemManager object manager proxy: %s",
|
||||
error->message);
|
||||
}
|
||||
|
@@ -97,10 +97,10 @@ is_form_filled (CallsSipAccountWidget *self)
|
||||
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
|
||||
|
||||
return
|
||||
g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (self->host)), "") != 0 &&
|
||||
g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (self->user)), "") != 0 &&
|
||||
g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (self->password)), "") != 0 &&
|
||||
g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (self->port)), "") != 0;
|
||||
g_strcmp0 (gtk_entry_get_text (self->host), "") != 0 &&
|
||||
g_strcmp0 (gtk_entry_get_text (self->user), "") != 0 &&
|
||||
g_strcmp0 (gtk_entry_get_text (self->password), "") != 0 &&
|
||||
g_strcmp0 (gtk_entry_get_text (self->port), "") != 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ on_user_changed (CallsSipAccountWidget *self)
|
||||
static void
|
||||
set_password_visibility (CallsSipAccountWidget *self, gboolean visible)
|
||||
{
|
||||
const char* icon_name;
|
||||
const char *icon_name;
|
||||
|
||||
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
|
||||
g_assert (GTK_IS_ENTRY (self->password));
|
||||
@@ -138,7 +138,7 @@ set_password_visibility (CallsSipAccountWidget *self, gboolean visible)
|
||||
|
||||
|
||||
static void
|
||||
on_password_visibility_changed(CallsSipAccountWidget *self,
|
||||
on_password_visibility_changed (CallsSipAccountWidget *self,
|
||||
GtkEntryIconPosition icon_pos,
|
||||
GdkEvent *event,
|
||||
GtkEntry *entry)
|
||||
@@ -173,7 +173,7 @@ on_port_entry_insert_text (CallsSipAccountWidget *self,
|
||||
if (!new_text || !*new_text || self->port_self_change)
|
||||
return;
|
||||
|
||||
pos = (int *)position;
|
||||
pos = (int *) position;
|
||||
g_object_set_data (G_OBJECT (entry), "old-pos", GINT_TO_POINTER (*pos));
|
||||
|
||||
if (new_text_length == -1)
|
||||
@@ -215,7 +215,7 @@ get_port (CallsSipAccountWidget *self)
|
||||
int port = 0;
|
||||
|
||||
text = gtk_entry_get_text (self->port);
|
||||
port = (int)g_ascii_strtod (text, NULL);
|
||||
port = (int) g_ascii_strtod (text, NULL);
|
||||
|
||||
return port;
|
||||
}
|
||||
@@ -270,6 +270,7 @@ find_protocol (CallsSipAccountWidget *self,
|
||||
guint *index)
|
||||
{
|
||||
guint len;
|
||||
|
||||
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
|
||||
|
||||
len = g_list_model_get_n_items (G_LIST_MODEL (self->protocols_store));
|
||||
|
@@ -56,8 +56,7 @@ enum {
|
||||
};
|
||||
static GParamSpec *props[PROP_LAST_PROP];
|
||||
|
||||
struct _CallsSipCall
|
||||
{
|
||||
struct _CallsSipCall {
|
||||
GObject parent_instance;
|
||||
|
||||
CallsSipMediaManager *manager;
|
||||
|
@@ -48,8 +48,7 @@
|
||||
* #CallsSipMediaPipeline objects that are ready to be used.
|
||||
*/
|
||||
|
||||
typedef struct _CallsSipMediaManager
|
||||
{
|
||||
typedef struct _CallsSipMediaManager {
|
||||
GObject parent;
|
||||
|
||||
int address_family;
|
||||
@@ -95,6 +94,7 @@ static void
|
||||
on_notify_preferred_audio_codecs (CallsSipMediaManager *self)
|
||||
{
|
||||
GList *supported_codecs;
|
||||
|
||||
g_auto (GStrv) settings_codec_preference = NULL;
|
||||
|
||||
g_assert (CALLS_IS_SIP_MEDIA_MANAGER (self));
|
||||
@@ -173,7 +173,7 @@ calls_sip_media_manager_class_init (CallsSipMediaManagerClass *klass)
|
||||
static void
|
||||
calls_sip_media_manager_init (CallsSipMediaManager *self)
|
||||
{
|
||||
if (!gst_is_initialized())
|
||||
if (!gst_is_initialized ())
|
||||
gst_init (NULL, NULL);
|
||||
|
||||
self->settings = calls_settings_new ();
|
||||
@@ -228,6 +228,7 @@ calls_sip_media_manager_get_capabilities (CallsSipMediaManager *self,
|
||||
GList *supported_codecs)
|
||||
{
|
||||
char *payload_type = use_srtp ? "SAVP" : "AVP";
|
||||
|
||||
g_autoptr (GString) media_line = NULL;
|
||||
g_autoptr (GString) attribute_lines = NULL;
|
||||
GList *node;
|
||||
@@ -262,7 +263,7 @@ calls_sip_media_manager_get_capabilities (CallsSipMediaManager *self,
|
||||
|
||||
g_string_append_printf (attribute_lines, "a=rtcp:%d\r\n", rtcp_port);
|
||||
|
||||
done:
|
||||
done:
|
||||
if (own_ip && *own_ip)
|
||||
address_family_string = get_address_family_string (self, own_ip);
|
||||
|
||||
|
@@ -38,21 +38,21 @@ G_DECLARE_FINAL_TYPE (CallsSipMediaManager, calls_sip_media_manager, CALLS, SIP_
|
||||
|
||||
|
||||
CallsSipMediaManager* calls_sip_media_manager_default (void);
|
||||
gchar* calls_sip_media_manager_get_capabilities (CallsSipMediaManager *self,
|
||||
gchar *calls_sip_media_manager_get_capabilities (CallsSipMediaManager *self,
|
||||
const char *own_ip,
|
||||
gint rtp_port,
|
||||
gint rtcp_port,
|
||||
gboolean use_srtp,
|
||||
GList *supported_codecs);
|
||||
gchar* calls_sip_media_manager_static_capabilities (CallsSipMediaManager *self,
|
||||
gchar *calls_sip_media_manager_static_capabilities (CallsSipMediaManager *self,
|
||||
const char *own_ip,
|
||||
gint rtp_port,
|
||||
gint rtcp_port,
|
||||
gboolean use_srtp);
|
||||
gboolean calls_sip_media_manager_supports_media (CallsSipMediaManager *self,
|
||||
const char *media_type);
|
||||
GList * calls_sip_media_manager_codec_candidates (CallsSipMediaManager *self);
|
||||
GList * calls_sip_media_manager_get_codecs_from_sdp (CallsSipMediaManager *self,
|
||||
GList *calls_sip_media_manager_codec_candidates (CallsSipMediaManager *self);
|
||||
GList *calls_sip_media_manager_get_codecs_from_sdp (CallsSipMediaManager *self,
|
||||
sdp_media_t *sdp_media);
|
||||
CallsSipMediaPipeline *calls_sip_media_manager_get_pipeline (CallsSipMediaManager *self);
|
||||
|
||||
|
@@ -150,7 +150,7 @@ struct _CallsSipMediaPipeline {
|
||||
guint bus_watch_id;
|
||||
};
|
||||
|
||||
#if GLIB_CHECK_VERSION(2, 70, 0)
|
||||
#if GLIB_CHECK_VERSION (2, 70, 0)
|
||||
G_DEFINE_FINAL_TYPE (CallsSipMediaPipeline, calls_sip_media_pipeline, G_TYPE_OBJECT)
|
||||
#else
|
||||
G_DEFINE_TYPE (CallsSipMediaPipeline, calls_sip_media_pipeline, G_TYPE_OBJECT)
|
||||
@@ -584,7 +584,7 @@ pipeline_link_elements (CallsSipMediaPipeline *self,
|
||||
gst_object_unref (sinkpad);
|
||||
|
||||
srcpad = gst_element_get_static_pad (self->rtcp_src, "src");
|
||||
#if GST_CHECK_VERSION (1, 20 , 0)
|
||||
#if GST_CHECK_VERSION (1, 20, 0)
|
||||
sinkpad = gst_element_request_pad_simple (self->rtpbin, "recv_rtcp_sink_0");
|
||||
#else
|
||||
sinkpad = gst_element_get_request_pad (self->rtpbin, "recv_rtcp_sink_0");
|
||||
@@ -966,8 +966,7 @@ diagnose_ports_in_use (CallsSipMediaPipeline *self)
|
||||
if (same_socket) {
|
||||
g_debug ("Diagnosing bidirectional socket...");
|
||||
diagnose_used_ports_in_socket (socket_in);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
g_debug ("Diagnosing server socket...");
|
||||
diagnose_used_ports_in_socket (socket_in);
|
||||
g_debug ("Diagnosing client socket...");
|
||||
|
@@ -82,8 +82,7 @@ static GParamSpec *props[PROP_LAST_PROP];
|
||||
|
||||
static gboolean set_contact_header = FALSE;
|
||||
|
||||
struct _CallsSipOrigin
|
||||
{
|
||||
struct _CallsSipOrigin {
|
||||
GObject parent_instance;
|
||||
|
||||
CallsSipContext *ctx;
|
||||
@@ -160,7 +159,7 @@ change_state (CallsSipOrigin *self,
|
||||
static void
|
||||
remove_call (CallsSipOrigin *self,
|
||||
CallsCall *call,
|
||||
const gchar *reason)
|
||||
const char *reason)
|
||||
{
|
||||
CallsOrigin *origin;
|
||||
CallsSipCall *sip_call;
|
||||
@@ -188,7 +187,7 @@ remove_call (CallsSipOrigin *self,
|
||||
|
||||
static void
|
||||
remove_calls (CallsSipOrigin *self,
|
||||
const gchar *reason)
|
||||
const char *reason)
|
||||
{
|
||||
CallsCall *call;
|
||||
GList *next;
|
||||
@@ -229,18 +228,19 @@ on_call_state_changed (CallsSipCall *call,
|
||||
|
||||
static void
|
||||
add_call (CallsSipOrigin *self,
|
||||
const gchar *address,
|
||||
const char *address,
|
||||
gboolean inbound,
|
||||
nua_handle_t *handle)
|
||||
{
|
||||
CallsSipCall *sip_call;
|
||||
CallsCall *call;
|
||||
CallsSipMediaPipeline *pipeline;
|
||||
g_autofree gchar *local_sdp = NULL;
|
||||
g_auto (GStrv) address_split = NULL;
|
||||
const char *call_address = address;
|
||||
gint rtp_port, rtcp_port;
|
||||
|
||||
g_auto (GStrv) address_split = NULL;
|
||||
g_autofree char *local_sdp = NULL;
|
||||
|
||||
pipeline = calls_sip_media_manager_get_pipeline (self->media_manager);
|
||||
rtp_port = calls_sip_media_pipeline_get_rtp_port (pipeline);
|
||||
rtcp_port = calls_sip_media_pipeline_get_rtcp_port (pipeline);
|
||||
@@ -299,7 +299,7 @@ add_call (CallsSipOrigin *self,
|
||||
|
||||
static void
|
||||
dial (CallsOrigin *origin,
|
||||
const gchar *address)
|
||||
const char *address)
|
||||
{
|
||||
CallsSipOrigin *self;
|
||||
nua_handle_t *nh;
|
||||
@@ -354,7 +354,7 @@ dial (CallsOrigin *origin,
|
||||
|
||||
static void
|
||||
create_inbound (CallsSipOrigin *self,
|
||||
const gchar *address,
|
||||
const char *address,
|
||||
nua_handle_t *handle)
|
||||
{
|
||||
g_assert (CALLS_IS_SIP_ORIGIN (self));
|
||||
@@ -375,9 +375,9 @@ sip_authenticate (CallsSipOrigin *self,
|
||||
nua_handle_t *nh,
|
||||
sip_t const *sip)
|
||||
{
|
||||
const gchar *scheme = NULL;
|
||||
const gchar *realm = NULL;
|
||||
g_autofree gchar *auth = NULL;
|
||||
const char *scheme = NULL;
|
||||
const char *realm = NULL;
|
||||
g_autofree char *auth = NULL;
|
||||
sip_www_authenticate_t *www_auth = sip->sip_www_authenticate;
|
||||
sip_proxy_authenticate_t *proxy_auth = sip->sip_proxy_authenticate;
|
||||
|
||||
@@ -446,7 +446,7 @@ sip_r_register (int status,
|
||||
change_state (origin,
|
||||
CALLS_ACCOUNT_STATE_ONLINE,
|
||||
CALLS_ACCOUNT_STATE_REASON_CONNECTED);
|
||||
nua_get_params (nua, TAG_ANY (), TAG_END());
|
||||
nua_get_params (nua, TAG_ANY (), TAG_END ());
|
||||
|
||||
if (sip->sip_contact && sip->sip_contact->m_url && sip->sip_contact->m_url->url_host) {
|
||||
g_free (origin->own_ip);
|
||||
@@ -591,7 +591,7 @@ sip_i_state (int status,
|
||||
rtcp_port = rtp_port + 1;
|
||||
|
||||
calls_sip_call_setup_remote_media_connection (call,
|
||||
media_ip ? : session_ip,
|
||||
media_ip ?: session_ip,
|
||||
rtp_port,
|
||||
rtcp_port);
|
||||
}
|
||||
@@ -675,7 +675,7 @@ sip_callback (nua_event_t event,
|
||||
{
|
||||
CallsSipOrigin *origin = CALLS_SIP_ORIGIN (magic);
|
||||
CallsSipHandles *op = origin->oper;
|
||||
g_autofree gchar * from = NULL;
|
||||
g_autofree char *from = NULL;
|
||||
|
||||
switch (event) {
|
||||
case nua_i_invite:
|
||||
@@ -807,8 +807,7 @@ sip_callback (nua_event_t event,
|
||||
if (status == 200) {
|
||||
origin->is_nua_shutdown = TRUE;
|
||||
origin->is_shutdown_success = TRUE;
|
||||
}
|
||||
else if (status == 500) {
|
||||
} else if (status == 500) {
|
||||
origin->is_nua_shutdown = TRUE;
|
||||
origin->is_shutdown_success = FALSE;
|
||||
}
|
||||
@@ -827,7 +826,7 @@ sip_callback (nua_event_t event,
|
||||
status,
|
||||
phrase);
|
||||
g_warning ("printing tags");
|
||||
tl_print(stdout, "", tags);
|
||||
tl_print (stdout, "", tags);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1168,6 +1167,7 @@ supports_protocol (CallsOrigin *origin,
|
||||
const char *protocol)
|
||||
{
|
||||
CallsSipOrigin *self;
|
||||
|
||||
g_assert (protocol);
|
||||
g_assert (CALLS_IS_SIP_ORIGIN (origin));
|
||||
|
||||
@@ -1360,6 +1360,7 @@ static void
|
||||
calls_sip_origin_constructed (GObject *object)
|
||||
{
|
||||
CallsSipOrigin *self = CALLS_SIP_ORIGIN (object);
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
int major = 0;
|
||||
int minor = 0;
|
||||
|
@@ -65,8 +65,7 @@ enum {
|
||||
};
|
||||
static GParamSpec *props[PROP_LAST_PROP];
|
||||
|
||||
struct _CallsSipProvider
|
||||
{
|
||||
struct _CallsSipProvider {
|
||||
CallsProvider parent_instance;
|
||||
|
||||
GListStore *origins;
|
||||
@@ -86,7 +85,7 @@ static void calls_sip_provider_account_provider_interface_init (CallsAccountProv
|
||||
#ifdef FOR_TESTING
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE
|
||||
(CallsSipProvider, calls_sip_provider, CALLS_TYPE_PROVIDER,
|
||||
(CallsSipProvider, calls_sip_provider, CALLS_TYPE_PROVIDER,
|
||||
G_IMPLEMENT_INTERFACE (CALLS_TYPE_MESSAGE_SOURCE,
|
||||
calls_sip_provider_message_source_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (CALLS_TYPE_ACCOUNT_PROVIDER,
|
||||
@@ -95,7 +94,7 @@ G_DEFINE_TYPE_WITH_CODE
|
||||
#else
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE_EXTENDED
|
||||
(CallsSipProvider, calls_sip_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
(CallsSipProvider, calls_sip_provider, CALLS_TYPE_PROVIDER, 0,
|
||||
G_IMPLEMENT_INTERFACE_DYNAMIC (CALLS_TYPE_MESSAGE_SOURCE,
|
||||
calls_sip_provider_message_source_interface_init)
|
||||
G_IMPLEMENT_INTERFACE_DYNAMIC (CALLS_TYPE_ACCOUNT_PROVIDER,
|
||||
@@ -115,6 +114,7 @@ on_origin_pw_looked_up (GObject *source,
|
||||
gpointer user_data)
|
||||
{
|
||||
SipOriginLoadData *data;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autofree char *id = NULL;
|
||||
g_autofree char *name = NULL;
|
||||
@@ -367,7 +367,7 @@ calls_sip_provider_get_origins (CallsProvider *provider)
|
||||
return G_LIST_MODEL (self->origins);
|
||||
}
|
||||
|
||||
static const char * const *
|
||||
static const char *const *
|
||||
calls_sip_provider_get_protocols (CallsProvider *provider)
|
||||
{
|
||||
return supported_protocols;
|
||||
@@ -397,7 +397,7 @@ calls_sip_provider_deinit_sip (CallsSipProvider *self)
|
||||
}
|
||||
g_clear_pointer (&self->ctx, g_free);
|
||||
|
||||
bail:
|
||||
bail:
|
||||
self->sip_state = SIP_ENGINE_NULL;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SIP_STATE]);
|
||||
}
|
||||
@@ -448,7 +448,7 @@ calls_sip_provider_init_sofia (CallsSipProvider *self,
|
||||
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SIP_STATE]);
|
||||
return TRUE;
|
||||
|
||||
err:
|
||||
err:
|
||||
self->sip_state = SIP_ENGINE_ERROR;
|
||||
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SIP_STATE]);
|
||||
return FALSE;
|
||||
@@ -479,6 +479,7 @@ static void
|
||||
calls_sip_provider_constructed (GObject *object)
|
||||
{
|
||||
CallsSipProvider *self = CALLS_SIP_PROVIDER (object);
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
const gchar *env_sip_test;
|
||||
|
||||
@@ -500,7 +501,7 @@ calls_sip_provider_constructed (GObject *object)
|
||||
g_warning ("Could not initialize sofia stack: %s", error->message);
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
|
||||
G_OBJECT_CLASS (calls_sip_provider_parent_class)->constructed (object);
|
||||
}
|
||||
|
@@ -28,14 +28,12 @@
|
||||
#include <sofia-sip/nua.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
su_home_t home[1];
|
||||
su_root_t *root;
|
||||
} CallsSipContext;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
nua_handle_t *register_handle;
|
||||
nua_handle_t *call_handle;
|
||||
CallsSipContext *context;
|
||||
@@ -49,13 +47,12 @@ typedef struct
|
||||
* @SIP_ENGINE_ERROR: Unrecoverable/Unhandled sofia-sip error
|
||||
* @SIP_ENGINE_READY: Ready for operation
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
SIP_ENGINE_NULL = 0,
|
||||
SIP_ENGINE_INITIALIZING,
|
||||
SIP_ENGINE_ERROR,
|
||||
SIP_ENGINE_READY,
|
||||
} SipEngineState;
|
||||
} SipEngineState;
|
||||
|
||||
|
||||
gboolean check_sips (const char *addr);
|
||||
|
@@ -46,7 +46,8 @@ static MediaCodecInfo gst_codecs[] = {
|
||||
* Returns: %TRUE if codec is available on your system, %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
media_codec_available_in_gst (MediaCodecInfo *codec) {
|
||||
media_codec_available_in_gst (MediaCodecInfo *codec)
|
||||
{
|
||||
gboolean available = FALSE;
|
||||
GstRegistry *registry = gst_registry_get ();
|
||||
GstPlugin *plugin = NULL;
|
||||
|
@@ -45,7 +45,7 @@ typedef struct {
|
||||
|
||||
|
||||
gboolean media_codec_available_in_gst (MediaCodecInfo *codec);
|
||||
MediaCodecInfo* media_codec_by_name (const char *name);
|
||||
MediaCodecInfo* media_codec_by_payload_id (uint payload_id);
|
||||
gchar* media_codec_get_gst_capabilities (MediaCodecInfo *codec);
|
||||
GList* media_codecs_get_candidates (void);
|
||||
MediaCodecInfo *media_codec_by_name (const char *name);
|
||||
MediaCodecInfo *media_codec_by_payload_id (uint payload_id);
|
||||
gchar *media_codec_get_gst_capabilities (MediaCodecInfo *codec);
|
||||
GList *media_codecs_get_candidates (void);
|
||||
|
@@ -35,8 +35,7 @@ G_BEGIN_DECLS
|
||||
|
||||
G_DECLARE_INTERFACE (CallsAccountProvider, calls_account_provider, CALLS, ACCOUNT_PROVIDER, CallsProvider)
|
||||
|
||||
struct _CallsAccountProviderInterface
|
||||
{
|
||||
struct _CallsAccountProviderInterface {
|
||||
GTypeInterface parent_iface;
|
||||
|
||||
GtkWidget *(*get_account_widget) (CallsAccountProvider *self);
|
||||
|
@@ -44,7 +44,7 @@ enum {
|
||||
SIGNAL_STATE_CHANGED,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals [SIGNAL_LAST_SIGNAL];
|
||||
static guint signals[SIGNAL_LAST_SIGNAL];
|
||||
|
||||
|
||||
static gboolean
|
||||
@@ -92,7 +92,8 @@ calls_account_state_reason_is_error (CallsAccountStateReason reason)
|
||||
static void
|
||||
calls_account_default_init (CallsAccountInterface *iface)
|
||||
{
|
||||
g_object_interface_install_property (iface,
|
||||
g_object_interface_install_property (
|
||||
iface,
|
||||
g_param_spec_enum ("account-state",
|
||||
"Account state",
|
||||
"The state of the account",
|
||||
@@ -102,7 +103,8 @@ calls_account_default_init (CallsAccountInterface *iface)
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
g_object_interface_install_property (iface,
|
||||
g_object_interface_install_property (
|
||||
iface,
|
||||
g_param_spec_string ("address",
|
||||
"Address",
|
||||
"The address of this account",
|
||||
|
@@ -91,8 +91,7 @@ typedef enum {
|
||||
} CallsAccountStateReason;
|
||||
|
||||
|
||||
struct _CallsAccountInterface
|
||||
{
|
||||
struct _CallsAccountInterface {
|
||||
GTypeInterface parent_iface;
|
||||
|
||||
void (*go_online) (CallsAccount *self,
|
||||
|
@@ -57,8 +57,7 @@
|
||||
|
||||
#define DEFAULT_PROVIDER_PLUGIN "mm"
|
||||
|
||||
struct _CallsApplication
|
||||
{
|
||||
struct _CallsApplication {
|
||||
GtkApplication parent_instance;
|
||||
|
||||
gboolean daemon;
|
||||
@@ -165,6 +164,7 @@ set_default_providers_action (GSimpleAction *action,
|
||||
{
|
||||
CallsManager *manager = calls_manager_get_default ();
|
||||
CallsSettings *settings = calls_manager_get_settings (manager);
|
||||
|
||||
g_auto (GStrv) plugins = NULL;
|
||||
/**
|
||||
* Only add default providers when there are none added yet,
|
||||
@@ -368,6 +368,7 @@ show_accounts (GSimpleAction *action,
|
||||
gpointer user_data)
|
||||
{
|
||||
CallsApplication *app = CALLS_APPLICATION (g_application_get_default ());
|
||||
|
||||
calls_main_window_show_accounts_overview (app->main_window);
|
||||
}
|
||||
|
||||
@@ -413,7 +414,7 @@ startup (GApplication *application)
|
||||
{
|
||||
g_autoptr (GtkCssProvider) provider = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
#if HDY_CHECK_VERSION(1, 5, 0)
|
||||
#if HDY_CHECK_VERSION (1, 5, 0)
|
||||
HdyStyleManager *style_manager;
|
||||
#endif
|
||||
|
||||
@@ -421,7 +422,7 @@ startup (GApplication *application)
|
||||
|
||||
hdy_init ();
|
||||
|
||||
#if HDY_CHECK_VERSION(1, 5, 0)
|
||||
#if HDY_CHECK_VERSION (1, 5, 0)
|
||||
style_manager = hdy_style_manager_get_default ();
|
||||
|
||||
hdy_style_manager_set_color_scheme (style_manager, HDY_COLOR_SCHEME_PREFER_LIGHT);
|
||||
@@ -462,8 +463,9 @@ calls_application_command_line (GApplication *application,
|
||||
CallsApplication *self = CALLS_APPLICATION (application);
|
||||
GVariantDict *options;
|
||||
const char *arg;
|
||||
|
||||
g_autoptr (GVariant) providers = NULL;
|
||||
g_auto(GStrv) arguments = NULL;
|
||||
g_auto (GStrv) arguments = NULL;
|
||||
gint argc;
|
||||
|
||||
options = g_application_command_line_get_options_dict (command_line);
|
||||
@@ -642,7 +644,7 @@ app_open (GApplication *application,
|
||||
static void
|
||||
finalize (GObject *object)
|
||||
{
|
||||
CallsApplication *self = (CallsApplication *)object;
|
||||
CallsApplication *self = (CallsApplication *) object;
|
||||
|
||||
g_clear_object (&self->call_window);
|
||||
g_clear_object (&self->main_window);
|
||||
|
@@ -31,8 +31,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
||||
struct _CallsBestMatch
|
||||
{
|
||||
struct _CallsBestMatch {
|
||||
GObject parent_instance;
|
||||
|
||||
FolksSearchView *view;
|
||||
@@ -432,7 +431,7 @@ calls_best_match_get_primary_info (CallsBestMatch *self)
|
||||
if (self->phone_number)
|
||||
return self->phone_number;
|
||||
|
||||
anon:
|
||||
anon:
|
||||
return _("Anonymous caller");
|
||||
}
|
||||
|
||||
@@ -461,6 +460,6 @@ calls_best_match_get_secondary_info (CallsBestMatch *self)
|
||||
* https://gitlab.gnome.org/GNOME/calls/-/issues/358
|
||||
*/
|
||||
|
||||
anon:
|
||||
anon:
|
||||
return "";
|
||||
}
|
||||
|
@@ -37,8 +37,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
struct _CallsCallRecordRow
|
||||
{
|
||||
struct _CallsCallRecordRow {
|
||||
GtkListBoxRow parent_instance;
|
||||
|
||||
GtkWidget *avatar;
|
||||
@@ -79,6 +78,7 @@ nice_time (GDateTime *t,
|
||||
gboolean *final)
|
||||
{
|
||||
GDateTime *now = g_date_time_new_now_local ();
|
||||
|
||||
g_autoptr (GTimeZone) local_tz = g_time_zone_new_local ();
|
||||
g_autoptr (GDateTime) t_local_tz = g_date_time_to_timezone (t, local_tz);
|
||||
const gboolean today =
|
||||
@@ -119,6 +119,7 @@ update_time_text (CallsCallRecordRow *self,
|
||||
gboolean *final)
|
||||
{
|
||||
gchar *nice;
|
||||
|
||||
nice_time (end, &nice, final);
|
||||
gtk_label_set_text (self->time, nice);
|
||||
g_free (nice);
|
||||
@@ -161,8 +162,7 @@ setup_date_change_timeout (CallsCallRecordRow *self)
|
||||
|
||||
// Get the precise time now
|
||||
err = gettimeofday (&now, NULL);
|
||||
if (err == -1)
|
||||
{
|
||||
if (err == -1) {
|
||||
g_warning ("Error getting time to set date change timeout: %s",
|
||||
g_strerror (errno));
|
||||
return;
|
||||
@@ -180,7 +180,7 @@ setup_date_change_timeout (CallsCallRecordRow *self)
|
||||
// Add the timeout
|
||||
self->date_change_timeout =
|
||||
g_timeout_add (interval,
|
||||
(GSourceFunc)date_change_cb,
|
||||
(GSourceFunc) date_change_cb,
|
||||
self);
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ on_notify_can_add_contacts (CallsCallRecordRow *self)
|
||||
if (!calls_contacts_provider_get_can_add_contacts (contacts_provider))
|
||||
return;
|
||||
|
||||
g_signal_handlers_disconnect_by_data(contacts_provider, self);
|
||||
g_signal_handlers_disconnect_by_data (contacts_provider, self);
|
||||
|
||||
/* The record has a NULL id */
|
||||
if (!self->contact)
|
||||
@@ -562,6 +562,7 @@ delete_call_activated (GSimpleAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *self = GTK_WIDGET (data);
|
||||
|
||||
g_signal_emit_by_name (CALLS_CALL_RECORD_ROW (self)->record, "call-delete");
|
||||
}
|
||||
|
||||
@@ -613,6 +614,7 @@ static void
|
||||
calls_call_record_row_init (CallsCallRecordRow *self)
|
||||
{
|
||||
GAction *act;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
self->action_map = G_ACTION_MAP (g_simple_action_group_new ());
|
||||
|
@@ -38,7 +38,7 @@ G_DECLARE_FINAL_TYPE (CallsCallRecordRow, calls_call_record_row,
|
||||
CALLS, CALL_RECORD_ROW, GtkListBoxRow)
|
||||
|
||||
CallsCallRecordRow *calls_call_record_row_new (CallsCallRecord *record);
|
||||
CallsCallRecord * calls_call_record_row_get_record (CallsCallRecordRow *self);
|
||||
CallsCallRecord *calls_call_record_row_get_record (CallsCallRecordRow *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -27,8 +27,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
|
||||
struct _CallsCallRecord
|
||||
{
|
||||
struct _CallsCallRecord {
|
||||
GomResource parent_instance;
|
||||
guint id;
|
||||
char *target;
|
||||
@@ -40,7 +39,7 @@ struct _CallsCallRecord
|
||||
gboolean complete;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(CallsCallRecord, calls_call_record, GOM_TYPE_RESOURCE)
|
||||
G_DEFINE_TYPE (CallsCallRecord, calls_call_record, GOM_TYPE_RESOURCE)
|
||||
|
||||
|
||||
enum {
|
||||
@@ -60,7 +59,7 @@ enum {
|
||||
SIGNAL_CALL_DELETE,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals [SIGNAL_LAST_SIGNAL];
|
||||
static guint signals[SIGNAL_LAST_SIGNAL];
|
||||
|
||||
|
||||
static void
|
||||
@@ -117,9 +116,7 @@ set_date_time (GDateTime **stamp_ptr,
|
||||
g_clear_pointer (stamp_ptr, g_date_time_unref);
|
||||
|
||||
if (new_stamp)
|
||||
{
|
||||
*stamp_ptr = g_date_time_ref (new_stamp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -32,8 +32,7 @@
|
||||
#include <glib.h>
|
||||
|
||||
|
||||
struct _CallsCallSelectorItem
|
||||
{
|
||||
struct _CallsCallSelectorItem {
|
||||
GtkEventBox parent_instance;
|
||||
|
||||
CuiCallDisplay *display;
|
||||
@@ -184,5 +183,3 @@ calls_call_selector_item_get_display (CallsCallSelectorItem *item)
|
||||
g_return_val_if_fail (CALLS_IS_CALL_SELECTOR_ITEM (item), NULL);
|
||||
return item->display;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -40,8 +40,7 @@
|
||||
#include <handy.h>
|
||||
|
||||
|
||||
struct _CallsCallWindow
|
||||
{
|
||||
struct _CallsCallWindow {
|
||||
GtkApplicationWindow parent_instance;
|
||||
|
||||
GListStore *calls;
|
||||
@@ -280,6 +279,7 @@ calls_call_window_init (CallsCallWindow *self)
|
||||
{
|
||||
g_autoptr (GList) calls = NULL;
|
||||
GList *c;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
self->calls = g_list_store_new (CALLS_TYPE_CALL_SELECTOR_ITEM);
|
||||
@@ -350,4 +350,3 @@ calls_call_window_new (GtkApplication *application)
|
||||
"application", application,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -49,8 +49,7 @@ typedef enum {
|
||||
CALLS_CALL_TYPE_SIP_VOICE,
|
||||
} CallsCallType;
|
||||
|
||||
struct _CallsCallClass
|
||||
{
|
||||
struct _CallsCallClass {
|
||||
GObjectClass parent_iface;
|
||||
|
||||
const char *(*get_protocol) (CallsCall *self);
|
||||
@@ -83,4 +82,3 @@ gboolean calls_call_state_parse_nick (CallsCallState *state,
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -32,8 +32,7 @@
|
||||
#define HANDY_USE_UNSTABLE_API
|
||||
#include <handy.h>
|
||||
|
||||
struct _CallsContactsBox
|
||||
{
|
||||
struct _CallsContactsBox {
|
||||
GtkBin parent_instance;
|
||||
|
||||
GtkWidget *search_entry;
|
||||
@@ -51,6 +50,7 @@ search_changed_cb (CallsContactsBox *self,
|
||||
GtkEntry *entry)
|
||||
{
|
||||
const gchar *search_text;
|
||||
|
||||
search_text = gtk_entry_get_text (entry);
|
||||
|
||||
folks_simple_query_set_query_string (self->search_query, search_text);
|
||||
@@ -73,15 +73,12 @@ adjust_style (CallsContactsBox *self, GtkWidget *widget)
|
||||
{
|
||||
g_return_if_fail (CALLS_IS_CONTACTS_BOX (self));
|
||||
|
||||
if (gtk_widget_get_mapped (widget))
|
||||
{
|
||||
if (gtk_widget_get_mapped (widget)) {
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (self->contacts_frame), GTK_SHADOW_NONE);
|
||||
gtk_widget_set_vexpand (self->contacts_frame, TRUE);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (self->contacts_listbox),
|
||||
"no-background");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (self->contacts_frame), GTK_SHADOW_ETCHED_IN);
|
||||
gtk_widget_set_vexpand (self->contacts_frame, FALSE);
|
||||
gtk_style_context_remove_class (gtk_widget_get_style_context (self->contacts_listbox),
|
||||
@@ -93,8 +90,7 @@ static void
|
||||
header_cb (GtkListBoxRow *row,
|
||||
GtkListBoxRow *before)
|
||||
{
|
||||
if (!before)
|
||||
{
|
||||
if (!before) {
|
||||
gtk_list_box_row_set_header (row, NULL);
|
||||
return;
|
||||
}
|
||||
@@ -109,6 +105,7 @@ contacts_provider_added (CallsContactsBox *self,
|
||||
FolksIndividual *individual)
|
||||
{
|
||||
GtkWidget *row;
|
||||
|
||||
row = calls_contacts_row_new (individual);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (self->contacts_listbox), row);
|
||||
@@ -157,6 +154,7 @@ static void
|
||||
calls_contacts_box_init (CallsContactsBox *self)
|
||||
{
|
||||
CallsContactsProvider *contacts_provider;
|
||||
|
||||
g_autoptr (GeeCollection) individuals = NULL;
|
||||
gchar* query_fields[] = { "alias",
|
||||
"full-name",
|
||||
|
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CallsContactsBox, calls_contacts_box, CALLS, CONTACTS_BOX, GtkBin);
|
||||
|
||||
GtkWidget * calls_contacts_box_new (void);
|
||||
GtkWidget *calls_contacts_box_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -48,16 +48,14 @@
|
||||
*/
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
GeeIterator *iter;
|
||||
IdleCallback callback;
|
||||
gpointer user_data;
|
||||
} IdleData;
|
||||
|
||||
|
||||
struct _CallsContactsProvider
|
||||
{
|
||||
struct _CallsContactsProvider {
|
||||
GObject parent_instance;
|
||||
|
||||
FolksIndividualAggregator *folks_aggregator;
|
||||
@@ -221,6 +219,7 @@ on_contacts_appeared (GDBusConnection *connection,
|
||||
gpointer user_data)
|
||||
{
|
||||
CallsContactsProvider *self;
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
g_assert (CALLS_IS_CONTACTS_PROVIDER (user_data));
|
||||
@@ -481,6 +480,7 @@ calls_contacts_provider_consume_iter_on_idle (GeeIterator *iter,
|
||||
gpointer user_data)
|
||||
{
|
||||
IdleData *data = g_new (IdleData, 1);
|
||||
|
||||
data->iter = iter;
|
||||
data->user_data = user_data;
|
||||
data->callback = callback;
|
||||
|
@@ -16,8 +16,7 @@
|
||||
#include "calls-contacts-row.h"
|
||||
#include "calls-contacts-provider.h"
|
||||
|
||||
struct _CallsContactsRow
|
||||
{
|
||||
struct _CallsContactsRow {
|
||||
GtkListBoxRow parent_instance;
|
||||
|
||||
GtkWidget *avatar;
|
||||
@@ -63,6 +62,7 @@ static void
|
||||
phone_numbers_changed_cb (CallsContactsRow *self)
|
||||
{
|
||||
GeeIterator *phone_iter;
|
||||
|
||||
g_autoptr (GeeSet) phone_numbers;
|
||||
|
||||
while (gtk_grid_get_child_at (GTK_GRID (self->grid), 1, 1) != NULL) {
|
||||
|
@@ -102,12 +102,12 @@ on_handle_call_hangup (CallsDBusCallsCall *skeleton,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
(avatar_loadable_icon_transform_to_image_path) (GBinding *binding,
|
||||
(avatar_loadable_icon_transform_to_image_path) (GBinding *binding,
|
||||
const GValue *from_value,
|
||||
GValue *to_value,
|
||||
gpointer user_data)
|
||||
{
|
||||
GLoadableIcon *icon = G_LOADABLE_ICON (g_value_get_object(from_value));
|
||||
GLoadableIcon *icon = G_LOADABLE_ICON (g_value_get_object (from_value));
|
||||
|
||||
if (icon == NULL) {
|
||||
g_value_set_string (to_value, NULL);
|
||||
@@ -237,11 +237,11 @@ on_notify_update_hints (CallsUiCallData *call,
|
||||
static void
|
||||
call_added_cb (CallsDBusManager *self, CuiCall *call)
|
||||
{
|
||||
g_autofree char *path = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autoptr (CallsDBusObjectSkeleton) object = NULL;
|
||||
g_autoptr (CallsDBusCallsCall) iface = NULL;
|
||||
g_autoptr (CallsBestMatch) match = NULL;
|
||||
g_autofree char *path = NULL;
|
||||
|
||||
path = get_obj_path (self, self->iface_num++);
|
||||
object = calls_dbus_object_skeleton_new (path);
|
||||
|
@@ -31,8 +31,7 @@
|
||||
#include <glib-object.h>
|
||||
|
||||
|
||||
struct _CallsHistoryBox
|
||||
{
|
||||
struct _CallsHistoryBox {
|
||||
GtkStack parent_instance;
|
||||
|
||||
GtkListBox *history;
|
||||
@@ -100,7 +99,7 @@ delete_call_cb (CallsCallRecord *record,
|
||||
|
||||
g_list_store_remove ((GListStore *) self->model, position);
|
||||
|
||||
update(self);
|
||||
update (self);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +108,7 @@ create_row_cb (CallsCallRecord *record,
|
||||
CallsHistoryBox *self)
|
||||
{
|
||||
GtkWidget *row_widget;
|
||||
|
||||
row_widget = GTK_WIDGET (calls_call_record_row_new (record));
|
||||
|
||||
g_signal_connect (record,
|
||||
@@ -154,7 +154,7 @@ constructed (GObject *object)
|
||||
|
||||
gtk_list_box_bind_model (self->history,
|
||||
self->model,
|
||||
(GtkListBoxCreateWidgetFunc)create_row_cb,
|
||||
(GtkListBoxCreateWidgetFunc) create_row_cb,
|
||||
self,
|
||||
NULL);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ G_BEGIN_DECLS
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CallsHistoryBox, calls_history_box, CALLS, HISTORY_BOX, GtkStack);
|
||||
|
||||
CallsHistoryBox * calls_history_box_new (GListModel *model);
|
||||
CallsHistoryBox *calls_history_box_new (GListModel *model);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -26,8 +26,7 @@
|
||||
|
||||
#define DEFAULT_TIMEOUT_SECONDS 3
|
||||
|
||||
struct _CallsInAppNotification
|
||||
{
|
||||
struct _CallsInAppNotification {
|
||||
GtkRevealer parent_instance;
|
||||
|
||||
GtkLabel *label;
|
||||
@@ -159,7 +158,7 @@ calls_in_app_notification_show (CallsInAppNotification *self, const gchar *messa
|
||||
g_source_remove (self->timeout_id);
|
||||
|
||||
gtk_revealer_set_reveal_child (GTK_REVEALER (self), TRUE);
|
||||
self->timeout_id = g_timeout_add_seconds (self->timeout, (GSourceFunc)timeout_cb, self);
|
||||
self->timeout_id = g_timeout_add_seconds (self->timeout, (GSourceFunc) timeout_cb, self);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,5 +169,5 @@ calls_in_app_notification_hide (CallsInAppNotification *self)
|
||||
|
||||
g_clear_handle_id (&self->timeout_id, g_source_remove);
|
||||
|
||||
gtk_revealer_set_reveal_child (GTK_REVEALER(self), FALSE);
|
||||
gtk_revealer_set_reveal_child (GTK_REVEALER (self), FALSE);
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ get_log_level_prefix (GLogLevelFlags log_level,
|
||||
log_level = log_level & ~CALLS_LOG_DETAILED;
|
||||
|
||||
if (use_color) {
|
||||
switch ((int)log_level) { /* Same colors as used in GLib */
|
||||
switch ((int) log_level) { /* Same colors as used in GLib */
|
||||
case G_LOG_LEVEL_ERROR: return " \033[1;31mERROR\033[0m";
|
||||
case G_LOG_LEVEL_CRITICAL: return "\033[1;35mCRITICAL\033[0m";
|
||||
case G_LOG_LEVEL_WARNING: return " \033[1;33mWARNING\033[0m";
|
||||
@@ -74,7 +74,7 @@ get_log_level_prefix (GLogLevelFlags log_level,
|
||||
default: return " UNKNOWN";
|
||||
}
|
||||
} else {
|
||||
switch ((int)log_level) {
|
||||
switch ((int) log_level) {
|
||||
case G_LOG_LEVEL_ERROR: return " ERROR";
|
||||
case G_LOG_LEVEL_CRITICAL: return "CRITICAL";
|
||||
case G_LOG_LEVEL_WARNING: return " WARNING";
|
||||
@@ -95,7 +95,7 @@ calls_log_write (GLogLevelFlags log_level,
|
||||
gsize n_fields,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_autoptr(GString) log_str = NULL;
|
||||
g_autoptr (GString) log_str = NULL;
|
||||
FILE *stream;
|
||||
gboolean can_color;
|
||||
|
||||
@@ -123,7 +123,7 @@ calls_log_write (GLogLevelFlags log_level,
|
||||
strftime (buffer, sizeof (buffer), "%H:%M:%S", &tm_now);
|
||||
|
||||
g_string_append_printf (log_str, "%s.%04d ", buffer,
|
||||
(int)((now % G_USEC_PER_SEC) / 100));
|
||||
(int) ((now % G_USEC_PER_SEC) / 100));
|
||||
}
|
||||
|
||||
can_color = g_log_writer_supports_color (fileno (stream));
|
||||
@@ -173,7 +173,7 @@ calls_log_handler (GLogLevelFlags log_level,
|
||||
const char *log_message = NULL;
|
||||
|
||||
/* If domain is “all” show logs upto debug regardless of the verbosity */
|
||||
switch ((int)log_level) {
|
||||
switch ((int) log_level) {
|
||||
case G_LOG_LEVEL_MESSAGE:
|
||||
if (any_domain && domains)
|
||||
break;
|
||||
|
@@ -40,8 +40,7 @@
|
||||
#include <handy.h>
|
||||
|
||||
|
||||
struct _CallsMainWindow
|
||||
{
|
||||
struct _CallsMainWindow {
|
||||
HdyApplicationWindow parent_instance;
|
||||
|
||||
GListModel *record_store;
|
||||
@@ -106,8 +105,8 @@ about_action (GSimpleAction *action,
|
||||
NULL
|
||||
};
|
||||
|
||||
version = g_str_equal (VCS_TAG, "") ? PACKAGE_VERSION:
|
||||
PACKAGE_VERSION "-" VCS_TAG;
|
||||
version = g_str_equal (VCS_TAG, "") ?
|
||||
PACKAGE_VERSION : PACKAGE_VERSION "-" VCS_TAG;
|
||||
|
||||
/*
|
||||
* “program-name” defaults to g_get_application_name().
|
||||
@@ -128,7 +127,7 @@ about_action (GSimpleAction *action,
|
||||
}
|
||||
|
||||
|
||||
static const GActionEntry window_entries [] =
|
||||
static const GActionEntry window_entries[] =
|
||||
{
|
||||
{ "about", about_action },
|
||||
};
|
||||
@@ -216,23 +215,21 @@ window_ussd_respond_cb (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
CallsMainWindow *self = user_data;
|
||||
g_autofree char *response = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autofree char *response = NULL;
|
||||
CallsMainWindow *self = user_data;
|
||||
CallsUssd *ussd;
|
||||
|
||||
ussd = g_object_get_data (G_OBJECT (self->ussd_dialog), "ussd");
|
||||
response = calls_ussd_respond_finish (ussd, result, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (error) {
|
||||
gtk_dialog_response (self->ussd_dialog, GTK_RESPONSE_CLOSE);
|
||||
g_warning ("USSD Error: %s", error->message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (response && *response)
|
||||
{
|
||||
if (response && *response) {
|
||||
window_update_ussd_state (self, ussd);
|
||||
gtk_label_set_text (self->ussd_label, response);
|
||||
}
|
||||
@@ -263,16 +260,15 @@ main_window_ussd_send_cb (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
CallsMainWindow *self = user_data;
|
||||
g_autofree char *response = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autofree char *response = NULL;
|
||||
CallsMainWindow *self = user_data;
|
||||
CallsUssd *ussd;
|
||||
|
||||
response = calls_new_call_box_send_ussd_finish (self->new_call, result, &error);
|
||||
ussd = g_task_get_task_data (G_TASK (result));
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (error) {
|
||||
gtk_dialog_response (self->ussd_dialog, GTK_RESPONSE_CLOSE);
|
||||
g_warning ("USSD Error: %s", error->message);
|
||||
return;
|
||||
@@ -501,8 +497,7 @@ void
|
||||
calls_main_window_dial (CallsMainWindow *self,
|
||||
const gchar *target)
|
||||
{
|
||||
if (calls_number_is_ussd (target))
|
||||
{
|
||||
if (calls_number_is_ussd (target)) {
|
||||
gtk_widget_hide (GTK_WIDGET (self->ussd_cancel_button));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ussd_reply_button));
|
||||
gtk_stack_set_visible_child (self->ussd_stack, GTK_WIDGET (self->ussd_spinner));
|
||||
@@ -512,9 +507,7 @@ calls_main_window_dial (CallsMainWindow *self,
|
||||
main_window_ussd_send_cb, self);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (self->ussd_dialog));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
calls_new_call_box_dial (self->new_call, target);
|
||||
}
|
||||
}
|
||||
|
@@ -59,8 +59,7 @@ static const char * const protocols[] = {
|
||||
"sips"
|
||||
};
|
||||
|
||||
struct _CallsManager
|
||||
{
|
||||
struct _CallsManager {
|
||||
GObject parent_instance;
|
||||
|
||||
GHashTable *providers;
|
||||
@@ -106,7 +105,7 @@ enum {
|
||||
PROVIDERS_CHANGED,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals [SIGNAL_LAST_SIGNAL];
|
||||
static guint signals[SIGNAL_LAST_SIGNAL];
|
||||
|
||||
|
||||
static void
|
||||
@@ -224,7 +223,7 @@ on_message (CallsMessageSource *source,
|
||||
}
|
||||
|
||||
calls_message_source_emit_message (CALLS_MESSAGE_SOURCE (self),
|
||||
notification ? : message,
|
||||
notification ?: message,
|
||||
message_type);
|
||||
}
|
||||
|
||||
@@ -247,8 +246,7 @@ add_call (CallsManager *self, CallsCall *call, CallsOrigin *origin)
|
||||
}
|
||||
|
||||
|
||||
struct CallsRemoveData
|
||||
{
|
||||
struct CallsRemoveData {
|
||||
CallsManager *manager;
|
||||
CallsCall *call;
|
||||
};
|
||||
@@ -358,6 +356,7 @@ static void
|
||||
add_origin (CallsManager *self, CallsOrigin *origin)
|
||||
{
|
||||
g_autofree const char *name = NULL;
|
||||
|
||||
g_assert (CALLS_IS_MANAGER (self));
|
||||
g_assert (CALLS_IS_ORIGIN (origin));
|
||||
|
||||
@@ -379,8 +378,7 @@ add_origin (CallsManager *self, CallsOrigin *origin)
|
||||
g_signal_connect_swapped (origin, "call-added", G_CALLBACK (add_call), self);
|
||||
g_signal_connect_swapped (origin, "call-removed", G_CALLBACK (remove_call), self);
|
||||
|
||||
if (CALLS_IS_USSD (origin))
|
||||
{
|
||||
if (CALLS_IS_USSD (origin)) {
|
||||
g_signal_connect_swapped (origin, "ussd-added", G_CALLBACK (ussd_added_cb), self);
|
||||
g_signal_connect_swapped (origin, "ussd-cancelled", G_CALLBACK (ussd_cancelled_cb), self);
|
||||
g_signal_connect_swapped (origin, "ussd-state-changed", G_CALLBACK (ussd_state_changed_cb), self);
|
||||
@@ -464,9 +462,10 @@ static void
|
||||
remove_provider (CallsManager *self,
|
||||
const char *name)
|
||||
{
|
||||
g_autoptr (CallsProvider) provider = NULL;
|
||||
|
||||
GListModel *origins;
|
||||
guint n_items;
|
||||
g_autoptr (CallsProvider) provider = NULL;
|
||||
|
||||
g_assert (CALLS_IS_MANAGER (self));
|
||||
g_assert (name);
|
||||
@@ -488,7 +487,7 @@ remove_provider (CallsManager *self,
|
||||
n_items = g_list_model_get_n_items (origins);
|
||||
|
||||
for (guint i = 0; i < n_items; i++) {
|
||||
g_autoptr(CallsOrigin) origin = NULL;
|
||||
g_autoptr (CallsOrigin) origin = NULL;
|
||||
|
||||
origin = g_list_model_get_item (origins, i);
|
||||
remove_origin (self, origin);
|
||||
@@ -568,7 +567,7 @@ origin_items_changed_cb (GListModel *model,
|
||||
g_warning ("Managed origins are not in sync anymore!");
|
||||
}
|
||||
|
||||
skip_remove:
|
||||
skip_remove:
|
||||
for (i = 0; i < added; i++) {
|
||||
g_debug ("before adding: %d",
|
||||
g_list_model_get_n_items (G_LIST_MODEL (self->origins)));
|
||||
@@ -830,7 +829,7 @@ calls_manager_get_default (void)
|
||||
|
||||
if (instance == NULL) {
|
||||
instance = calls_manager_new ();
|
||||
g_object_add_weak_pointer (G_OBJECT (instance), (gpointer *)&instance);
|
||||
g_object_add_weak_pointer (G_OBJECT (instance), (gpointer *) &instance);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
@@ -980,8 +979,7 @@ calls_manager_has_active_call (CallsManager *self)
|
||||
|
||||
calls = calls_manager_get_calls (self);
|
||||
|
||||
for (node = calls; node; node = node->next)
|
||||
{
|
||||
for (node = calls; node; node = node->next) {
|
||||
call = node->data;
|
||||
if (calls_call_get_state (call) != CALLS_CALL_STATE_DISCONNECTED)
|
||||
return TRUE;
|
||||
|
@@ -40,7 +40,7 @@ enum {
|
||||
SIGNAL_MESSAGE,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals [SIGNAL_LAST_SIGNAL];
|
||||
static guint signals[SIGNAL_LAST_SIGNAL];
|
||||
|
||||
|
||||
static void
|
||||
|
@@ -32,8 +32,7 @@ G_BEGIN_DECLS
|
||||
|
||||
G_DECLARE_INTERFACE (CallsMessageSource, calls_message_source, CALLS, MESSAGE_SOURCE, GObject)
|
||||
|
||||
struct _CallsMessageSourceInterface
|
||||
{
|
||||
struct _CallsMessageSourceInterface {
|
||||
GTypeInterface parent_iface;
|
||||
};
|
||||
|
||||
|
@@ -40,8 +40,7 @@ enum {
|
||||
};
|
||||
static GParamSpec *props[PROP_LAST_PROP];
|
||||
|
||||
struct _CallsNewCallBox
|
||||
{
|
||||
struct _CallsNewCallBox {
|
||||
GtkBox parent_instance;
|
||||
|
||||
GtkListBox *origin_list_box;
|
||||
@@ -85,6 +84,7 @@ get_origin (CallsNewCallBox *self,
|
||||
{
|
||||
CallsManager *manager = calls_manager_get_default ();
|
||||
CallsSettings *settings = calls_manager_get_settings (manager);
|
||||
|
||||
g_autoptr (CallsOrigin) origin = NULL;
|
||||
GListModel *model;
|
||||
gboolean auto_use_def_origin =
|
||||
@@ -158,6 +158,7 @@ static void
|
||||
long_press_back_cb (CallsNewCallBox *self)
|
||||
{
|
||||
GtkEntry *entry = hdy_keypad_get_entry (self->keypad);
|
||||
|
||||
gtk_editable_delete_text (GTK_EDITABLE (entry), 0, -1);
|
||||
}
|
||||
|
||||
@@ -165,6 +166,7 @@ static void
|
||||
backspace_clicked_cb (CallsNewCallBox *self)
|
||||
{
|
||||
GtkEntry *entry = hdy_keypad_get_entry (self->keypad);
|
||||
|
||||
g_signal_emit_by_name (entry, "backspace", NULL);
|
||||
}
|
||||
|
||||
@@ -174,7 +176,8 @@ ussd_send_cb (GObject *object,
|
||||
gpointer user_data)
|
||||
{
|
||||
CallsNewCallBox *self;
|
||||
CallsUssd *ussd = (CallsUssd *)object;
|
||||
CallsUssd *ussd = (CallsUssd *) object;
|
||||
|
||||
g_autoptr (GTask) task = user_data;
|
||||
GError *error = NULL;
|
||||
char *response;
|
||||
@@ -232,6 +235,7 @@ dial_queued_cb (gchar *target,
|
||||
CallsNewCallBox *self)
|
||||
{
|
||||
CallsOrigin *origin = NULL;
|
||||
|
||||
g_debug ("Try dialing queued target `%s'", target);
|
||||
|
||||
origin = get_origin (self,
|
||||
@@ -239,9 +243,9 @@ dial_queued_cb (gchar *target,
|
||||
if (origin) {
|
||||
calls_origin_dial (origin, target);
|
||||
self->dial_queue = g_list_remove (self->dial_queue, target);
|
||||
}
|
||||
else
|
||||
} else {
|
||||
g_debug ("No suitable origin found");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,8 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALLS_NEW_CALL_BOX_H__
|
||||
#define CALLS_NEW_CALL_BOX_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -31,9 +30,9 @@ G_BEGIN_DECLS
|
||||
|
||||
#define CALLS_TYPE_NEW_CALL_BOX (calls_new_call_box_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CallsNewCallBox, calls_new_call_box, CALLS, NEW_CALL_BOX, GtkBox);
|
||||
G_DECLARE_FINAL_TYPE (CallsNewCallBox, calls_new_call_box, CALLS, NEW_CALL_BOX, GtkBox)
|
||||
|
||||
CallsNewCallBox * calls_new_call_box_new (void);
|
||||
CallsNewCallBox *calls_new_call_box_new (void);
|
||||
void calls_new_call_box_dial (CallsNewCallBox *self,
|
||||
const gchar *target);
|
||||
void calls_new_call_box_send_ussd_async (CallsNewCallBox *self,
|
||||
@@ -46,5 +45,3 @@ char *calls_new_call_box_send_ussd_finish (CallsNewCallBox *self
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* CALLS_NEW_CALL_BOX_H__ */
|
||||
|
@@ -35,8 +35,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
struct _CallsNotifier
|
||||
{
|
||||
struct _CallsNotifier {
|
||||
GObject parent_instance;
|
||||
|
||||
GListStore *unanswered;
|
||||
@@ -49,6 +48,7 @@ static void
|
||||
notify (CallsNotifier *self, CuiCall *call)
|
||||
{
|
||||
GApplication *app = g_application_get_default ();
|
||||
|
||||
g_autoptr (GNotification) notification = g_notification_new (_("Missed call"));
|
||||
g_autofree gchar *msg = NULL;
|
||||
g_autofree gchar *ref = NULL;
|
||||
@@ -58,7 +58,7 @@ notify (CallsNotifier *self, CuiCall *call)
|
||||
gboolean got_id;
|
||||
gboolean got_contact;
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,70,0)
|
||||
#if GLIB_CHECK_VERSION (2,70,0)
|
||||
g_notification_set_category (notification, "x-gnome.call.unanswered");
|
||||
#endif
|
||||
/* TODO: We need to update the notification when the contact name changes
|
||||
@@ -123,7 +123,7 @@ state_changed_cb (CallsNotifier *self,
|
||||
static void
|
||||
call_added_cb (CallsNotifier *self, CuiCall *call)
|
||||
{
|
||||
g_list_store_append(self->unanswered, call);
|
||||
g_list_store_append (self->unanswered, call);
|
||||
|
||||
g_signal_connect_swapped (call,
|
||||
"state-changed",
|
||||
|
@@ -40,7 +40,7 @@ enum {
|
||||
SIGNAL_CALL_REMOVED,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals [SIGNAL_LAST_SIGNAL];
|
||||
static guint signals[SIGNAL_LAST_SIGNAL];
|
||||
|
||||
static void
|
||||
calls_origin_default_init (CallsOriginInterface *iface)
|
||||
@@ -107,7 +107,7 @@ calls_origin_default_init (CallsOriginInterface *iface)
|
||||
* Returns (transfer full): A string containing the name. The string must be freed by
|
||||
* the caller.
|
||||
*/
|
||||
DEFINE_ORIGIN_GETTER(name, char *, NULL);
|
||||
DEFINE_ORIGIN_GETTER (name, char *, NULL);
|
||||
|
||||
/**
|
||||
* calls_origin_get_id:
|
||||
@@ -118,7 +118,7 @@ DEFINE_ORIGIN_GETTER(name, char *, NULL);
|
||||
* Returns (transfer full): A string containing the id. The string must be freed by
|
||||
* the caller.
|
||||
*/
|
||||
DEFINE_ORIGIN_GETTER(id, char *, NULL);
|
||||
DEFINE_ORIGIN_GETTER (id, char *, NULL);
|
||||
|
||||
/**
|
||||
* calls_origin_get_calls:
|
||||
@@ -129,7 +129,7 @@ DEFINE_ORIGIN_GETTER(id, char *, NULL);
|
||||
* Returns: (transfer container): A newly-allocated GList of objects implementing
|
||||
* #CallsCall or NULL if there was an error.
|
||||
*/
|
||||
DEFINE_ORIGIN_GETTER(calls, GList *, NULL);
|
||||
DEFINE_ORIGIN_GETTER (calls, GList *, NULL);
|
||||
|
||||
/**
|
||||
* calls_origin_foreach_call:
|
||||
@@ -140,7 +140,7 @@ DEFINE_ORIGIN_GETTER(calls, GList *, NULL);
|
||||
* Iterate over all current calls from this origin
|
||||
**/
|
||||
void
|
||||
calls_origin_foreach_call(CallsOrigin *self,
|
||||
calls_origin_foreach_call (CallsOrigin *self,
|
||||
CallsOriginForeachCallFunc callback,
|
||||
gpointer param)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ calls_origin_foreach_call(CallsOrigin *self,
|
||||
* there is an error, an appropriate #message signal will be emitted.
|
||||
*/
|
||||
void
|
||||
calls_origin_dial(CallsOrigin *self,
|
||||
calls_origin_dial (CallsOrigin *self,
|
||||
const char *number)
|
||||
{
|
||||
CallsOriginInterface *iface;
|
||||
@@ -175,7 +175,7 @@ calls_origin_dial(CallsOrigin *self,
|
||||
iface = CALLS_ORIGIN_GET_IFACE (self);
|
||||
g_return_if_fail (iface->dial != NULL);
|
||||
|
||||
return iface->dial(self, number);
|
||||
return iface->dial (self, number);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -22,8 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALLS_ORIGIN_H__
|
||||
#define CALLS_ORIGIN_H__
|
||||
#pragma once
|
||||
|
||||
#include "calls-call.h"
|
||||
#include "util.h"
|
||||
@@ -35,11 +34,10 @@ G_BEGIN_DECLS
|
||||
|
||||
#define CALLS_TYPE_ORIGIN (calls_origin_get_type ())
|
||||
|
||||
G_DECLARE_INTERFACE (CallsOrigin, calls_origin, CALLS, ORIGIN, GObject);
|
||||
G_DECLARE_INTERFACE (CallsOrigin, calls_origin, CALLS, ORIGIN, GObject)
|
||||
|
||||
|
||||
struct _CallsOriginInterface
|
||||
{
|
||||
struct _CallsOriginInterface {
|
||||
GTypeInterface parent_iface;
|
||||
|
||||
void (*dial) (CallsOrigin *self,
|
||||
@@ -50,9 +48,9 @@ struct _CallsOriginInterface
|
||||
|
||||
typedef void (*CallsOriginForeachCallFunc) (gpointer param, CallsCall* call, CallsOrigin* origin);
|
||||
|
||||
char * calls_origin_get_name (CallsOrigin *self);
|
||||
char * calls_origin_get_id (CallsOrigin *self);
|
||||
GList * calls_origin_get_calls (CallsOrigin *self);
|
||||
char *calls_origin_get_name (CallsOrigin *self);
|
||||
char *calls_origin_get_id (CallsOrigin *self);
|
||||
GList *calls_origin_get_calls (CallsOrigin *self);
|
||||
void calls_origin_foreach_call (CallsOrigin *self,
|
||||
CallsOriginForeachCallFunc callback,
|
||||
gpointer param);
|
||||
@@ -62,4 +60,3 @@ gboolean calls_origin_supports_protocol (CallsOrigin *self,
|
||||
const char *protocol);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* CALLS_ORIGIN_H__ */
|
||||
|
@@ -40,14 +40,13 @@ G_BEGIN_DECLS
|
||||
G_DECLARE_DERIVABLE_TYPE (CallsProvider, calls_provider, CALLS, PROVIDER, GObject)
|
||||
|
||||
|
||||
struct _CallsProviderClass
|
||||
{
|
||||
struct _CallsProviderClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
const char *(*get_name) (CallsProvider *self);
|
||||
const char *(*get_status) (CallsProvider *self);
|
||||
GListModel *(*get_origins) (CallsProvider *self);
|
||||
const char * const *(*get_protocols) (CallsProvider *self);
|
||||
const char *const *(*get_protocols) (CallsProvider *self);
|
||||
gboolean (*is_modem) (CallsProvider *self);
|
||||
gboolean (*is_operational) (CallsProvider *self);
|
||||
};
|
||||
@@ -57,7 +56,7 @@ const char *calls_provider_get_status (CallsProvider *self);
|
||||
GListModel *calls_provider_get_origins (CallsProvider *self);
|
||||
CallsProvider *calls_provider_load_plugin (const char *name);
|
||||
void calls_provider_unload_plugin (const char *name);
|
||||
const char * const *calls_provider_get_protocols (CallsProvider *self);
|
||||
const char *const *calls_provider_get_protocols (CallsProvider *self);
|
||||
gboolean calls_provider_is_modem (CallsProvider *self);
|
||||
gboolean calls_provider_is_operational (CallsProvider *self);
|
||||
|
||||
|
@@ -75,8 +75,7 @@ state_to_record_state (CuiCallState call_state)
|
||||
}
|
||||
|
||||
|
||||
struct _CallsRecordStore
|
||||
{
|
||||
struct _CallsRecordStore {
|
||||
GtkApplicationWindow parent_instance;
|
||||
|
||||
gchar *filename;
|
||||
@@ -138,8 +137,8 @@ load_calls_fetch_cb (GomResourceGroup *group,
|
||||
GAsyncResult *res,
|
||||
CallsRecordStore *self)
|
||||
{
|
||||
gboolean ok;
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
guint count, i;
|
||||
gpointer *records;
|
||||
|
||||
@@ -191,8 +190,8 @@ load_calls_find_cb (GomRepository *repository,
|
||||
GAsyncResult *res,
|
||||
CallsRecordStore *self)
|
||||
{
|
||||
GomResourceGroup *group;
|
||||
g_autoptr (GError) error = NULL;
|
||||
GomResourceGroup *group;
|
||||
guint count;
|
||||
|
||||
group = gom_repository_find_finish (repository,
|
||||
@@ -214,11 +213,10 @@ load_calls_find_cb (GomRepository *repository,
|
||||
|
||||
g_debug ("Found %u call records in database `%s', fetching",
|
||||
count, self->filename);
|
||||
gom_resource_group_fetch_async
|
||||
(group,
|
||||
gom_resource_group_fetch_async (group,
|
||||
0,
|
||||
count,
|
||||
(GAsyncReadyCallback)load_calls_fetch_cb,
|
||||
(GAsyncReadyCallback) load_calls_fetch_cb,
|
||||
self);
|
||||
}
|
||||
|
||||
@@ -243,7 +241,7 @@ load_calls (CallsRecordStore *self)
|
||||
CALLS_TYPE_CALL_RECORD,
|
||||
filter,
|
||||
sorting,
|
||||
(GAsyncReadyCallback)load_calls_find_cb,
|
||||
(GAsyncReadyCallback) load_calls_find_cb,
|
||||
self);
|
||||
|
||||
g_object_unref (G_OBJECT (filter));
|
||||
@@ -296,12 +294,12 @@ set_up_repo (CallsRecordStore *self)
|
||||
g_debug ("Attempting migration of call"
|
||||
" record database `%s'",
|
||||
self->filename);
|
||||
types = g_list_append (types, (gpointer)CALLS_TYPE_CALL_RECORD);
|
||||
types = g_list_append (types, (gpointer) CALLS_TYPE_CALL_RECORD);
|
||||
gom_repository_automatic_migrate_async
|
||||
(repo,
|
||||
RECORD_STORE_VERSION,
|
||||
types,
|
||||
(GAsyncReadyCallback)set_up_repo_migrate_cb,
|
||||
(GAsyncReadyCallback) set_up_repo_migrate_cb,
|
||||
self);
|
||||
|
||||
self->repository = repo;
|
||||
@@ -314,12 +312,11 @@ close_adapter (CallsRecordStore *self)
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
|
||||
if (!self->adapter)
|
||||
{
|
||||
if (!self->adapter) {
|
||||
return;
|
||||
}
|
||||
|
||||
ok = gom_adapter_close_sync(self->adapter, &error);
|
||||
ok = gom_adapter_close_sync (self->adapter, &error);
|
||||
if (!ok) {
|
||||
if (error)
|
||||
g_warning ("Error closing call record database `%s': %s",
|
||||
@@ -385,15 +382,14 @@ open_repo (CallsRecordStore *self)
|
||||
gom_adapter_open_async
|
||||
(self->adapter,
|
||||
uri,
|
||||
(GAsyncReadyCallback)open_repo_adapter_open_cb,
|
||||
(GAsyncReadyCallback) open_repo_adapter_open_cb,
|
||||
self);
|
||||
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
|
||||
struct CallsRecordCallData
|
||||
{
|
||||
struct CallsRecordCallData {
|
||||
CallsRecordStore *self;
|
||||
CallsUiCallData *call;
|
||||
};
|
||||
@@ -405,6 +401,7 @@ record_call_save_cb (GomResource *resource,
|
||||
struct CallsRecordCallData *data)
|
||||
{
|
||||
GObject * const call_obj = G_OBJECT (data->call);
|
||||
|
||||
g_autoptr (GError) error = NULL;
|
||||
gboolean ok;
|
||||
|
||||
@@ -469,7 +466,7 @@ record_call (CallsRecordStore *self,
|
||||
data->call = call;
|
||||
|
||||
gom_resource_save_async (GOM_RESOURCE (record),
|
||||
(GAsyncReadyCallback)record_call_save_cb,
|
||||
(GAsyncReadyCallback) record_call_save_cb,
|
||||
data);
|
||||
}
|
||||
|
||||
@@ -519,7 +516,7 @@ stamp_call (CallsCallRecord *record,
|
||||
g_date_time_unref (stamp);
|
||||
|
||||
gom_resource_save_async (GOM_RESOURCE (record),
|
||||
(GAsyncReadyCallback)update_cb,
|
||||
(GAsyncReadyCallback) update_cb,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -603,7 +600,7 @@ call_added_cb (CallsRecordStore *self,
|
||||
g_assert (g_object_get_data (call_obj, "calls-call-start") == NULL);
|
||||
start = g_date_time_new_now_utc ();
|
||||
g_object_set_data_full (call_obj, "calls-call-start",
|
||||
start, (GDestroyNotify)g_date_time_unref);
|
||||
start, (GDestroyNotify) g_date_time_unref);
|
||||
|
||||
if (!self->repository) {
|
||||
open_repo (self);
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#define LIBFEEDBACK_USE_UNSTABLE_API
|
||||
#include <libfeedback.h>
|
||||
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_IS_RINGING,
|
||||
@@ -64,7 +65,9 @@ struct _CallsRinger {
|
||||
gboolean is_quiet;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CallsRinger, calls_ringer, G_TYPE_OBJECT);
|
||||
|
||||
G_DEFINE_TYPE (CallsRinger, calls_ringer, G_TYPE_OBJECT)
|
||||
|
||||
|
||||
static const char *
|
||||
ring_state_to_string (CallsRingState state)
|
||||
@@ -83,6 +86,7 @@ ring_state_to_string (CallsRingState state)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
change_ring_state (CallsRinger *self,
|
||||
CallsRingState state)
|
||||
@@ -115,6 +119,7 @@ on_event_triggered (LfbEvent *event,
|
||||
CallsRinger *self)
|
||||
{
|
||||
g_autoptr (GError) err = NULL;
|
||||
|
||||
g_return_if_fail (LFB_IS_EVENT (event));
|
||||
g_return_if_fail (CALLS_IS_RINGER (self));
|
||||
|
||||
|
@@ -22,8 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALLS_RINGER_H__
|
||||
#define CALLS_RINGER_H__
|
||||
#pragma once
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
@@ -31,7 +30,7 @@ G_BEGIN_DECLS
|
||||
|
||||
#define CALLS_TYPE_RINGER (calls_ringer_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CallsRinger, calls_ringer, CALLS, RINGER, GObject);
|
||||
G_DECLARE_FINAL_TYPE (CallsRinger, calls_ringer, CALLS, RINGER, GObject)
|
||||
|
||||
|
||||
CallsRinger *calls_ringer_new (void);
|
||||
@@ -39,5 +38,3 @@ gboolean calls_ringer_get_is_ringing (CallsRinger *self);
|
||||
gboolean calls_ringer_get_ring_is_quiet (CallsRinger *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* CALLS_RINGER_H__ */
|
||||
|
@@ -33,4 +33,3 @@
|
||||
const SecretSchema *calls_secret_get_schema (void) G_GNUC_CONST;
|
||||
|
||||
#define CALLS_SECRET_SCHEMA calls_secret_get_schema ()
|
||||
|
||||
|
@@ -47,4 +47,3 @@ void calls_settings_set_preferred_audio_codecs (CallsSettings
|
||||
const char * const *codecs);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -55,8 +55,7 @@ enum {
|
||||
static GParamSpec *props[PROP_LAST_PROP];
|
||||
static guint signals[N_SIGNALS];
|
||||
|
||||
struct _CallsUiCallData
|
||||
{
|
||||
struct _CallsUiCallData {
|
||||
GObject parent_instance;
|
||||
|
||||
CallsCall *call;
|
||||
@@ -282,6 +281,7 @@ static void
|
||||
on_notify_state (CallsUiCallData *self)
|
||||
{
|
||||
CallsCallState state;
|
||||
|
||||
g_assert (CALLS_IS_UI_CALL_DATA (self));
|
||||
|
||||
state = calls_call_get_state (self->call);
|
||||
@@ -725,6 +725,7 @@ char *
|
||||
calls_ui_call_data_dup_origin_name (CallsUiCallData *self)
|
||||
{
|
||||
CallsOrigin *origin;
|
||||
|
||||
g_return_val_if_fail (CALLS_IS_UI_CALL_DATA (self), NULL);
|
||||
|
||||
origin = calls_manager_get_origin_by_id (calls_manager_get_default (),
|
||||
|
@@ -42,7 +42,7 @@ enum {
|
||||
N_SIGNALS
|
||||
};
|
||||
|
||||
static guint signals [N_SIGNALS];
|
||||
static guint signals[N_SIGNALS];
|
||||
|
||||
static void
|
||||
calls_ussd_default_init (CallsUssdInterface *iface)
|
||||
|
@@ -40,8 +40,7 @@ typedef enum
|
||||
CALLS_USSD_STATE_USER_RESPONSE
|
||||
} CallsUssdState;
|
||||
|
||||
struct _CallsUssdInterface
|
||||
{
|
||||
struct _CallsUssdInterface {
|
||||
GTypeInterface parent_iface;
|
||||
|
||||
CallsUssdState (*get_state) (CallsUssd *self);
|
||||
|
@@ -28,15 +28,13 @@
|
||||
void
|
||||
calls_object_unref (gpointer object)
|
||||
{
|
||||
if (object)
|
||||
{
|
||||
if (object) {
|
||||
g_object_unref (object);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
gpointer needle;
|
||||
guint needle_column;
|
||||
GtkTreeIter *iter;
|
||||
@@ -55,8 +53,7 @@ list_store_find_foreach_cb (GtkTreeModel *model,
|
||||
gtk_tree_model_get (model, iter, find_data->needle_column,
|
||||
&value, -1);
|
||||
|
||||
if (value == find_data->needle)
|
||||
{
|
||||
if (value == find_data->needle) {
|
||||
*find_data->iter = *iter;
|
||||
return (find_data->found = TRUE);
|
||||
}
|
||||
|
@@ -116,14 +116,14 @@ void calls_object_unref (gpointer object);
|
||||
|
||||
/** Find a particular pointer value in a GtkListStore */
|
||||
gboolean
|
||||
calls_list_store_find (GtkListStore *store,
|
||||
calls_list_store_find (GtkListStore *store,
|
||||
gpointer needle,
|
||||
gint needle_column,
|
||||
GtkTreeIter *iter);
|
||||
|
||||
/** Append a single character to a GtkEntry's contents */
|
||||
void
|
||||
calls_entry_append (GtkEntry *entry,
|
||||
calls_entry_append (GtkEntry *entry,
|
||||
gchar character);
|
||||
|
||||
|
||||
@@ -139,12 +139,11 @@ gboolean calls_find_in_store (GListModel *list,
|
||||
gpointer item,
|
||||
guint *position);
|
||||
|
||||
const char* get_protocol_from_address (const char *target);
|
||||
const char* get_protocol_from_address_with_fallback (const char *target);
|
||||
const char *get_protocol_from_address (const char *target);
|
||||
const char *get_protocol_from_address_with_fallback (const char *target);
|
||||
|
||||
gboolean dtmf_tone_key_is_valid (char key);
|
||||
const char *get_call_icon_symbolic_name (gboolean inbound,
|
||||
gboolean missed);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Reference in New Issue
Block a user