mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-08 06:00:54 +00:00
sysprof: Add sysprof_session_filter_by_mark
This will be used to set a global marks filter in the session filter.
This commit is contained in:
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
|
#include "sysprof-mark-filter.h"
|
||||||
#include "sysprof-session-private.h"
|
#include "sysprof-session-private.h"
|
||||||
#include "sysprof-value-axis.h"
|
#include "sysprof-value-axis.h"
|
||||||
|
|
||||||
@ -488,6 +489,24 @@ sysprof_session_zoom_to_selection (SysprofSession *self)
|
|||||||
sysprof_session_update_axis (self);
|
sysprof_session_update_axis (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sysprof_session_filter_by_mark (SysprofSession *self,
|
||||||
|
SysprofMarkCatalog *catalog)
|
||||||
|
{
|
||||||
|
g_return_if_fail (SYSPROF_IS_SESSION (self));
|
||||||
|
g_return_if_fail (catalog == NULL || SYSPROF_IS_MARK_CATALOG (catalog));
|
||||||
|
|
||||||
|
while (g_list_model_get_n_items (G_LIST_MODEL (self->filter)) > 0)
|
||||||
|
gtk_multi_filter_remove (GTK_MULTI_FILTER (self->filter), 0);
|
||||||
|
|
||||||
|
if (catalog)
|
||||||
|
{
|
||||||
|
g_autoptr(SysprofMarkFilter) mark_filter = sysprof_mark_filter_new (self->document, catalog);
|
||||||
|
|
||||||
|
gtk_multi_filter_append (GTK_MULTI_FILTER (self->filter), GTK_FILTER (g_steal_pointer (&mark_filter)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_time_str (gint64 o)
|
get_time_str (gint64 o)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -44,5 +44,7 @@ SysprofAxis *sysprof_session_get_selected_time_axis (SysprofSession
|
|||||||
void sysprof_session_select_time (SysprofSession *self,
|
void sysprof_session_select_time (SysprofSession *self,
|
||||||
const SysprofTimeSpan *time_span);
|
const SysprofTimeSpan *time_span);
|
||||||
void sysprof_session_zoom_to_selection (SysprofSession *self);
|
void sysprof_session_zoom_to_selection (SysprofSession *self);
|
||||||
|
void sysprof_session_filter_by_mark (SysprofSession *self,
|
||||||
|
SysprofMarkCatalog *catalog);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
Reference in New Issue
Block a user