libsysprof-gtk: set session time range from document

This will eventually get updated as selections are made, and various other
components can adapt to that change.
This commit is contained in:
Christian Hergert
2023-06-15 16:43:49 -07:00
parent d4da036f73
commit b718e3ac9e

View File

@ -46,6 +46,19 @@ G_DEFINE_FINAL_TYPE (SysprofSession, sysprof_session, G_TYPE_OBJECT)
static GParamSpec *properties [N_PROPS];
static void
sysprof_session_set_document (SysprofSession *self,
SysprofDocument *document)
{
g_assert (SYSPROF_IS_SESSION (self));
g_assert (SYSPROF_IS_DOCUMENT (document));
g_set_object (&self->document, document);
self->visible_time = *sysprof_document_get_time_span (document);
self->selected_time = self->visible_time;
}
static void
sysprof_session_dispose (GObject *object)
{
@ -99,7 +112,7 @@ sysprof_session_set_property (GObject *object,
switch (prop_id)
{
case PROP_DOCUMENT:
self->document = g_value_dup_object (value);
sysprof_session_set_document (self, g_value_get_object (value));
break;
default: