mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
printbackend: Add a list model getter
Now that we have a list model for printers, we can start using it.
This commit is contained in:
parent
a026677849
commit
fb587cb529
@ -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)
|
||||
{
|
||||
|
@ -149,6 +149,8 @@ GType gtk_print_backend_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GList *gtk_print_backend_get_printer_list (GtkPrintBackend *print_backend);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GListModel *gtk_print_backend_get_printers (GtkPrintBackend *print_backend);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gtk_print_backend_printer_list_is_done (GtkPrintBackend *print_backend);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkPrinter *gtk_print_backend_find_printer (GtkPrintBackend *print_backend,
|
||||
|
Loading…
Reference in New Issue
Block a user