mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: add listmodel of traceables
It can be handy to iterate through the traceables and we already have a bitset index for that. Use the new bitset index listmodel to provide that filtered list externally without having to inflate every object in the underlying listmodel, as GtkFilterListModel would have to do.
This commit is contained in:
@ -25,6 +25,8 @@
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#include "sysprof-document-private.h"
|
||||
|
||||
#include "sysprof-document-bitset-index-private.h"
|
||||
#include "sysprof-document-file-chunk.h"
|
||||
#include "sysprof-document-frame-private.h"
|
||||
#include "sysprof-document-symbols-private.h"
|
||||
@ -495,3 +497,20 @@ _sysprof_document_traceables (SysprofDocument *self)
|
||||
|
||||
return self->traceables;
|
||||
}
|
||||
|
||||
/**
|
||||
* sysprof_document_list_traceables:
|
||||
* @self: a #SysprofDocument
|
||||
*
|
||||
* Gets a #GListModel containing #SysprofDocumentTraceable found within
|
||||
* the #SysprofDocument.
|
||||
*
|
||||
* Returns: (transfer full): a #GListModel
|
||||
*/
|
||||
GListModel *
|
||||
sysprof_document_list_traceables (SysprofDocument *self)
|
||||
{
|
||||
g_return_val_if_fail (SYSPROF_IS_DOCUMENT (self), NULL);
|
||||
|
||||
return _sysprof_document_bitset_index_new (G_LIST_MODEL (self), self->traceables);
|
||||
}
|
||||
|
||||
@ -60,5 +60,7 @@ SYSPROF_AVAILABLE_IN_ALL
|
||||
GBytes *sysprof_document_lookup_file_finish (SysprofDocument *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
GListModel *sysprof_document_list_traceables (SysprofDocument *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user