diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-12-22 14:49:26 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-31 13:01:17 -0400 |
commit | fb587cb5297ed087da578bb98bb238ac704f885a (patch) | |
tree | eda0af48250610752b42471d2ca08f2f9e9e8d09 /gtk/gtkprintbackend.c | |
parent | a026677849b595ff3b3b0c12add476624c64a8ff (diff) | |
download | gtk+-fb587cb5297ed087da578bb98bb238ac704f885a.tar.gz |
printbackend: Add a list model getter
Now that we have a list model for printers,
we can start using it.
Diffstat (limited to 'gtk/gtkprintbackend.c')
-rw-r--r-- | gtk/gtkprintbackend.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtkprintbackend.c b/gtk/gtkprintbackend.c index a6f44c08ca..eadd4125d5 100644 --- a/gtk/gtkprintbackend.c +++ b/gtk/gtkprintbackend.c @@ -471,6 +471,19 @@ gtk_print_backend_get_printer_list (GtkPrintBackend *backend) return result; } +GListModel * +gtk_print_backend_get_printers (GtkPrintBackend *backend) +{ + if (!backend->priv->printer_list_requested) + { + if (GTK_PRINT_BACKEND_GET_CLASS (backend)->request_printer_list) + GTK_PRINT_BACKEND_GET_CLASS (backend)->request_printer_list (backend); + backend->priv->printer_list_requested = TRUE; + } + + return G_LIST_MODEL (backend->priv->printers); +} + gboolean gtk_print_backend_printer_list_is_done (GtkPrintBackend *backend) { |