libsysprof-ui: allow restricting remote proxy

This commit is contained in:
Christian Hergert
2019-05-19 22:36:20 -07:00
parent 6e7ef3d52d
commit c368da09de
9 changed files with 196 additions and 158 deletions

View File

@ -32,8 +32,9 @@
struct _SysprofProcessModel
{
GObject parent_instance;
guint reload_source;
GPtrArray *items;
guint reload_source;
guint no_proxy : 1;
};
static void list_model_iface_init (GListModelInterface *iface);
@ -181,6 +182,7 @@ sysprof_process_model_reload_worker (GTask *task,
gpointer task_data,
GCancellable *cancellable)
{
SysprofProcessModel *self = source_object;
SysprofHelpers *helpers = sysprof_helpers_get_default ();
g_autoptr(GPtrArray) ret = NULL;
g_autoptr(GVariant) info = NULL;
@ -190,7 +192,7 @@ sysprof_process_model_reload_worker (GTask *task,
ret = g_ptr_array_new_with_free_func (g_object_unref);
if (sysprof_helpers_get_process_info (helpers, "pid,cmdline,comm", NULL, &info, NULL))
if (sysprof_helpers_get_process_info (helpers, "pid,cmdline,comm", self->no_proxy, NULL, &info, NULL))
{
gsize n_children = g_variant_n_children (info);
@ -294,3 +296,12 @@ list_model_iface_init (GListModelInterface *iface)
iface->get_n_items = sysprof_process_model_get_n_items;
iface->get_item = sysprof_process_model_get_item;
}
void
sysprof_process_model_set_no_proxy (SysprofProcessModel *self,
gboolean no_proxy)
{
g_return_if_fail (SYSPROF_IS_PROCESS_MODEL (self));
self->no_proxy = !!no_proxy;
}