Commit graph

27 commits

Author SHA1 Message Date
Robert Ancell
bc648d9c92 printers: Replace PpDevicesList with standard GPtrArray 2020-07-20 14:14:44 +12:00
Philip Chimento
389ee0dfe5 printers: Use CUPS httpConnect2() if available
In CUPS 1.7 httpConnect() and httpConnectEncrypt() were deprecated and
replaced with httpConnect2(). This checks if httpConnect2() is available
and if so, replaces the uses of the deprecated functions.

In the CUPS source code, httpConnect() and httpConnectEncrypt() are now
wrappers around httpConnect2(), so we make sure to use the same
arguments as in the CUPS source code so the two code paths are sure to
be identical:
2c030c7a06/cups/http.c (L412)
2c030c7a06/cups/http.c (L477)
2019-09-16 14:09:40 -07:00
Robert Ancell
e9b9966e7d printers: Use g_autoptr with strings 2019-02-05 10:26:15 +13:00
Robert Ancell
47cd15d911 printers: Use self variable to match coding style 2019-01-30 11:33:28 +13:00
Robert Ancell
13d72a79a7 printers: Replace ifdefs with #pragma once 2019-01-30 11:33:28 +13:00
Robert Ancell
4042cb5d33 printers: Replace GObject boilerplace with G_DECLARE_TYPE 2019-01-30 11:33:28 +13:00
Robert Ancell
dd9ddf4c9c printers: Remove goto
Not necessary since the use of g_autoptr
2018-11-28 11:48:49 +00:00
Robert Ancell
241121fa20 printers: Use g_autoptr 2018-11-28 11:48:49 +00:00
Robert Ancell
9e0b40b549 printers: Check error parameter is valid 2018-11-28 11:48:49 +00:00
Robert Ancell
bf463f2662 printers: Use consistent GTask return pattern 2018-11-28 11:48:49 +00:00
Robert Ancell
e436cf1f60 printers: Remove unused variable 2018-11-28 11:48:49 +00:00
Robert Ancell
172ab6ef6c printers: Fix incorrect g_task_run_in_thread reference usage
There is a reference held during this call so don't need to
explicitly unref inside the function.
2018-11-28 11:48:49 +00:00
Robert Ancell
4d20e682c2 printers: Remove unnecessary GSDData structure 2018-11-28 11:48:49 +00:00
Robert Ancell
323fee6d3b printers: Replace deprecated GSimpleAsyncResult with GTask 2018-11-28 11:48:49 +00:00
Robert Ancell
877445cbaf printers: Use g_autoptr for GError handling 2018-09-17 15:19:21 +00:00
Felipe Borges
e980b192d8 printers: Make PpSamba a derivated class of PpHost
https://bugzilla.gnome.org/show_bug.cgi?id=760783
2016-11-16 15:53:42 +01:00
Felipe Borges
af9fd3e995 printers: Introduce the "authentication-required" signal in PpHost
This signal should be emitted by hosts and derivated classes when
it is required to authenticate hosts (ask for credentials).

https://bugzilla.gnome.org/show_bug.cgi?id=760783
2016-11-15 18:54:28 +01:00
Marek Kasik
60bf057bab printers: Merge device-class and is-network-device properties
'device-class' property of PpPrintDevice can contain "network"
or "direct" values. This information can be stored in already
present property 'is-network-device' as well.

https://bugzilla.gnome.org/show_bug.cgi?id=749830
2015-07-30 16:28:09 +02:00
Marek Kasik
7b21b22eef printers: Make PpPrintDevice a regular class
Create class PpPrintDevice with properties taken
from the original PpPrintDevice structure.

https://bugzilla.gnome.org/show_bug.cgi?id=749830
2015-07-30 16:28:06 +02:00
Marek Kasik
12c4777c06 printers: Don't crash for URIs with leading "//"
Initialize result of getting of LPD devices early to avoid crash.

https://bugzilla.gnome.org/show_bug.cgi?id=738165
2014-10-10 12:31:07 +02:00
Marek Kasik
7eded1afa5 printers: Add functions for searching for LPD printers
Add pp_host_get_lpd_devices_async() and
pp_host_get_lpd_devices_finish() functions to PpHost class.
pp_host_get_lpd_devices_async() starts searching for LPD printer
on given address.
The test consist in connection to the default port 515 (or the one
given by creator of PpHost) of the address and sending a print job
to it, which in turn returns a status (we test several standard
queue names).
We suppose that there is a LPD printer on the address if a buffer
with zero length is returned (rfc 1179 5.2).

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
89fe4eda12 printers: Allow to add AppSocket/HP JetDirect printers
Add pp_host_get_socket_devices_async() and
pp_host_get_socket_devices_finish() functions to PpHost class.
pp_host_get_socket_devices_async() starts searching for socket printer
on given address.
The test consist in connection to the default port 9100 (or the one
given by creator of PpHost) of the address.
We suppose that there is an AppSocket/HP JetDirect printer on the address
if the connection succeeds.

See these links for additional info:
http://en.wikipedia.org/wiki/JetDirect
http://www.cups.org/documentation.php/network.html

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
6576db1a16 printers: Make pp_devices_list_free() generally available
Move pp_devices_list_free() to pp-utils.h and optimize it
using g_list_free_full().

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Marek Kasik
a15c2f831a printers: Don't request port during creation of PpHost
This allows us to distinguish between situations when the port
was specified and when it was not.

https://bugzilla.gnome.org/show_bug.cgi?id=695564
2014-07-31 11:44:16 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Marek Kasik
1eb906515f printers: Use GPLv2+ for files created by Marek Kasik
This commit is related to the bug #683420.
2012-09-11 15:02:26 +02:00
Marek Kasik
142d2c65b4 printers: Add PpHost object for listing print devices
This commit adds PpHost object which represents a remote
host from which we want to get printers. It contains
asynchronous method for enumerating printers list from the host
using CUPS' SNMP backend and method for enumerating printers list
directly from the remote CUPS server running on the host. (#683229)
2012-09-04 14:09:05 +02:00