cli/polkit: avoid G_DECLARE_FINAL_TYPE() in nm-polkit-listener.h
G_DECLARE_FINAL_TYPE() is glib 2.44, while we currently still only require glib 2.40.
This commit is contained in:
@@ -60,18 +60,21 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
|||||||
|
|
||||||
struct _NMPolkitListener {
|
struct _NMPolkitListener {
|
||||||
GObject parent;
|
GObject parent;
|
||||||
|
|
||||||
GDBusConnection *dbus_connection;
|
GDBusConnection *dbus_connection;
|
||||||
char *name_owner;
|
char *name_owner;
|
||||||
guint pk_auth_agent_reg_id;
|
|
||||||
guint name_owner_changed_id;
|
|
||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
GMainContext *main_context;
|
GMainContext *main_context;
|
||||||
gboolean session_agent;
|
|
||||||
CList request_lst_head;
|
CList request_lst_head;
|
||||||
|
guint pk_auth_agent_reg_id;
|
||||||
|
guint name_owner_changed_id;
|
||||||
|
bool session_agent:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMPolkitListener, nm_polkit_listener, G_TYPE_OBJECT)
|
struct _NMPolkitListenerClass {
|
||||||
|
GObjectClass parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (NMPolkitListener, nm_polkit_listener, G_TYPE_OBJECT);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@@ -6,16 +6,24 @@
|
|||||||
#ifndef __NM_POLKIT_LISTENER_H__
|
#ifndef __NM_POLKIT_LISTENER_H__
|
||||||
#define __NM_POLKIT_LISTENER_H__
|
#define __NM_POLKIT_LISTENER_H__
|
||||||
|
|
||||||
#define NM_TYPE_POLKIT_LISTENER (nm_polkit_listener_get_type ())
|
|
||||||
G_DECLARE_FINAL_TYPE (NMPolkitListener, nm_polkit_listener, NM, POLKIT_LISTENER, GObject)
|
|
||||||
|
|
||||||
NMPolkitListener *nm_polkit_listener_new (GDBusConnection *dbus_connection, gboolean session_agent);
|
|
||||||
|
|
||||||
/* Signals */
|
|
||||||
#define NM_POLKIT_LISTENER_SIGNAL_REGISTERED "registered"
|
#define NM_POLKIT_LISTENER_SIGNAL_REGISTERED "registered"
|
||||||
#define NM_POLKIT_LISTENER_SIGNAL_REQUEST "secret-request"
|
#define NM_POLKIT_LISTENER_SIGNAL_REQUEST "secret-request"
|
||||||
#define NM_POLKIT_LISTENER_SIGNAL_AUTH_SUCCESS "auth-success"
|
#define NM_POLKIT_LISTENER_SIGNAL_AUTH_SUCCESS "auth-success"
|
||||||
#define NM_POLKIT_LISTENER_SIGNAL_AUTH_FAILURE "auth-failure"
|
#define NM_POLKIT_LISTENER_SIGNAL_AUTH_FAILURE "auth-failure"
|
||||||
#define NM_POLKIT_LISTENER_SIGNAL_ERROR "error"
|
#define NM_POLKIT_LISTENER_SIGNAL_ERROR "error"
|
||||||
|
|
||||||
|
typedef struct _NMPolkitListener NMPolkitListener;
|
||||||
|
typedef struct _NMPolkitListenerClass NMPolkitListenerClass;
|
||||||
|
|
||||||
|
#define NM_TYPE_POLKIT_LISTENER (nm_polkit_listener_get_type ())
|
||||||
|
#define NM_POLKIT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_POLKIT_LISTENER, NMPolkitListener))
|
||||||
|
#define NM_POLKIT_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_POLKIT_LISTENER, NMPolkitListenerClass))
|
||||||
|
#define NM_IS_POLKIT_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_POLKIT_LISTENER))
|
||||||
|
#define NM_IS_POLKIT_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_POLKIT_LISTENER))
|
||||||
|
#define NM_POLKIT_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_POLKIT_LISTENER, NMPolkitListenerClass))
|
||||||
|
|
||||||
|
GType nm_polkit_listener_get_type (void);
|
||||||
|
|
||||||
|
NMPolkitListener *nm_polkit_listener_new (GDBusConnection *dbus_connection, gboolean session_agent);
|
||||||
|
|
||||||
#endif /* __NM_POLKIT_LISTENER_H__ */
|
#endif /* __NM_POLKIT_LISTENER_H__ */
|
||||||
|
Reference in New Issue
Block a user