libmalcontent: Rename flags types
If we have a flag type for getting and for setting every type of value which can be stored on an `MctManager`, that will lead to a load of flag types which all look identical. Refactor the types so we only have one shared flags type for getters, and one for setters. Add compatibility defines so that this doesn’t break API. It’s not an ABI break because the flag member values don’t change. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
282cf9c66b
commit
acf2738d56
|
@ -373,7 +373,7 @@ accounts_find_user_by_id (GDBusConnection *connection,
|
||||||
MctAppFilter *
|
MctAppFilter *
|
||||||
mct_manager_get_app_filter (MctManager *self,
|
mct_manager_get_app_filter (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctGetAppFilterFlags flags,
|
MctManagerGetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
@ -394,7 +394,7 @@ mct_manager_get_app_filter (MctManager *self,
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||||
|
|
||||||
object_path = accounts_find_user_by_id (self->connection, user_id,
|
object_path = accounts_find_user_by_id (self->connection, user_id,
|
||||||
(flags & MCT_GET_APP_FILTER_FLAGS_INTERACTIVE),
|
(flags & MCT_MANAGER_GET_VALUE_FLAGS_INTERACTIVE),
|
||||||
cancellable, error);
|
cancellable, error);
|
||||||
if (object_path == NULL)
|
if (object_path == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -407,7 +407,7 @@ mct_manager_get_app_filter (MctManager *self,
|
||||||
"GetAll",
|
"GetAll",
|
||||||
g_variant_new ("(s)", "com.endlessm.ParentalControls.AppFilter"),
|
g_variant_new ("(s)", "com.endlessm.ParentalControls.AppFilter"),
|
||||||
G_VARIANT_TYPE ("(a{sv})"),
|
G_VARIANT_TYPE ("(a{sv})"),
|
||||||
(flags & MCT_GET_APP_FILTER_FLAGS_INTERACTIVE)
|
(flags & MCT_MANAGER_GET_VALUE_FLAGS_INTERACTIVE)
|
||||||
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
||||||
: G_DBUS_CALL_FLAGS_NONE,
|
: G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout, ms */
|
-1, /* timeout, ms */
|
||||||
|
@ -505,7 +505,7 @@ static void get_app_filter_thread_cb (GTask *task,
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uid_t user_id;
|
uid_t user_id;
|
||||||
MctGetAppFilterFlags flags;
|
MctManagerGetValueFlags flags;
|
||||||
} GetAppFilterData;
|
} GetAppFilterData;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -536,7 +536,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (GetAppFilterData, get_app_filter_data_free)
|
||||||
void
|
void
|
||||||
mct_manager_get_app_filter_async (MctManager *self,
|
mct_manager_get_app_filter_async (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctGetAppFilterFlags flags,
|
MctManagerGetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
|
@ -623,7 +623,7 @@ gboolean
|
||||||
mct_manager_set_app_filter (MctManager *self,
|
mct_manager_set_app_filter (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctAppFilter *app_filter,
|
MctAppFilter *app_filter,
|
||||||
MctSetAppFilterFlags flags,
|
MctManagerSetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
@ -646,7 +646,7 @@ mct_manager_set_app_filter (MctManager *self,
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
object_path = accounts_find_user_by_id (self->connection, user_id,
|
object_path = accounts_find_user_by_id (self->connection, user_id,
|
||||||
(flags & MCT_SET_APP_FILTER_FLAGS_INTERACTIVE),
|
(flags & MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE),
|
||||||
cancellable, error);
|
cancellable, error);
|
||||||
if (object_path == NULL)
|
if (object_path == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -668,7 +668,7 @@ mct_manager_set_app_filter (MctManager *self,
|
||||||
"AppFilter",
|
"AppFilter",
|
||||||
g_steal_pointer (&app_filter_variant)),
|
g_steal_pointer (&app_filter_variant)),
|
||||||
G_VARIANT_TYPE ("()"),
|
G_VARIANT_TYPE ("()"),
|
||||||
(flags & MCT_SET_APP_FILTER_FLAGS_INTERACTIVE)
|
(flags & MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE)
|
||||||
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
||||||
: G_DBUS_CALL_FLAGS_NONE,
|
: G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout, ms */
|
-1, /* timeout, ms */
|
||||||
|
@ -691,7 +691,7 @@ mct_manager_set_app_filter (MctManager *self,
|
||||||
"OarsFilter",
|
"OarsFilter",
|
||||||
g_steal_pointer (&oars_filter_variant)),
|
g_steal_pointer (&oars_filter_variant)),
|
||||||
G_VARIANT_TYPE ("()"),
|
G_VARIANT_TYPE ("()"),
|
||||||
(flags & MCT_SET_APP_FILTER_FLAGS_INTERACTIVE)
|
(flags & MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE)
|
||||||
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
||||||
: G_DBUS_CALL_FLAGS_NONE,
|
: G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout, ms */
|
-1, /* timeout, ms */
|
||||||
|
@ -714,7 +714,7 @@ mct_manager_set_app_filter (MctManager *self,
|
||||||
"AllowUserInstallation",
|
"AllowUserInstallation",
|
||||||
g_steal_pointer (&allow_user_installation_variant)),
|
g_steal_pointer (&allow_user_installation_variant)),
|
||||||
G_VARIANT_TYPE ("()"),
|
G_VARIANT_TYPE ("()"),
|
||||||
(flags & MCT_SET_APP_FILTER_FLAGS_INTERACTIVE)
|
(flags & MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE)
|
||||||
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
||||||
: G_DBUS_CALL_FLAGS_NONE,
|
: G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout, ms */
|
-1, /* timeout, ms */
|
||||||
|
@ -737,7 +737,7 @@ mct_manager_set_app_filter (MctManager *self,
|
||||||
"AllowSystemInstallation",
|
"AllowSystemInstallation",
|
||||||
g_steal_pointer (&allow_system_installation_variant)),
|
g_steal_pointer (&allow_system_installation_variant)),
|
||||||
G_VARIANT_TYPE ("()"),
|
G_VARIANT_TYPE ("()"),
|
||||||
(flags & MCT_SET_APP_FILTER_FLAGS_INTERACTIVE)
|
(flags & MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE)
|
||||||
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
? G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION
|
||||||
: G_DBUS_CALL_FLAGS_NONE,
|
: G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1, /* timeout, ms */
|
-1, /* timeout, ms */
|
||||||
|
@ -761,7 +761,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
uid_t user_id;
|
uid_t user_id;
|
||||||
MctAppFilter *app_filter; /* (owned) */
|
MctAppFilter *app_filter; /* (owned) */
|
||||||
MctSetAppFilterFlags flags;
|
MctManagerSetValueFlags flags;
|
||||||
} SetAppFilterData;
|
} SetAppFilterData;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -795,7 +795,7 @@ void
|
||||||
mct_manager_set_app_filter_async (MctManager *self,
|
mct_manager_set_app_filter_async (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctAppFilter *app_filter,
|
MctAppFilter *app_filter,
|
||||||
MctSetAppFilterFlags flags,
|
MctManagerSetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
|
|
|
@ -30,38 +30,48 @@
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MctGetAppFilterFlags:
|
* MctManagerGetValueFlags:
|
||||||
* @MCT_GET_APP_FILTER_FLAGS_NONE: No flags set.
|
* @MCT_MANAGER_GET_VALUE_FLAGS_NONE: No flags set.
|
||||||
* @MCT_GET_APP_FILTER_FLAGS_INTERACTIVE: Allow interactive polkit dialogs when
|
* @MCT_MANAGER_GET_VALUE_FLAGS_INTERACTIVE: Allow interactive polkit dialogs
|
||||||
* requesting authorization.
|
* when requesting authorization.
|
||||||
*
|
*
|
||||||
* Flags to control the behaviour of mct_manager_get_app_filter() and
|
* Flags to control the behaviour of getter functions like
|
||||||
* mct_manager_get_app_filter_async().
|
* mct_manager_get_app_filter() and mct_manager_get_app_filter_async().
|
||||||
*
|
*
|
||||||
* Since: 0.3.0
|
* Since: 0.5.0
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE = 0,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE = 0,
|
||||||
MCT_GET_APP_FILTER_FLAGS_INTERACTIVE = (1 << 0),
|
MCT_MANAGER_GET_VALUE_FLAGS_INTERACTIVE = (1 << 0),
|
||||||
} MctGetAppFilterFlags;
|
} MctManagerGetValueFlags;
|
||||||
|
|
||||||
|
/* FIXME: Eventually deprecate these compatibility fallbacks. */
|
||||||
|
typedef MctManagerGetValueFlags MctGetAppFilterFlags;
|
||||||
|
#define MCT_GET_APP_FILTER_FLAGS_NONE MCT_MANAGER_GET_VALUE_FLAGS_NONE
|
||||||
|
#define MCT_GET_APP_FILTER_FLAGS_INTERACTIVE MCT_MANAGER_GET_VALUE_FLAGS_INTERACTIVE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MctSetAppFilterFlags:
|
* MctManagerSetValueFlags:
|
||||||
* @MCT_SET_APP_FILTER_FLAGS_NONE: No flags set.
|
* @MCT_MANAGER_SET_VALUE_FLAGS_NONE: No flags set.
|
||||||
* @MCT_SET_APP_FILTER_FLAGS_INTERACTIVE: Allow interactive polkit dialogs when
|
* @MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE: Allow interactive polkit dialogs
|
||||||
* requesting authorization.
|
* when requesting authorization.
|
||||||
*
|
*
|
||||||
* Flags to control the behaviour of mct_manager_set_app_filter() and
|
* Flags to control the behaviour of setter functions like
|
||||||
* mct_manager_set_app_filter_async().
|
* mct_manager_set_app_filter() and mct_manager_set_app_filter_async().
|
||||||
*
|
*
|
||||||
* Since: 0.3.0
|
* Since: 0.5.0
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
MCT_SET_APP_FILTER_FLAGS_NONE = 0,
|
MCT_MANAGER_SET_VALUE_FLAGS_NONE = 0,
|
||||||
MCT_SET_APP_FILTER_FLAGS_INTERACTIVE = (1 << 0),
|
MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE = (1 << 0),
|
||||||
} MctSetAppFilterFlags;
|
} MctManagerSetValueFlags;
|
||||||
|
|
||||||
|
/* FIXME: Eventually deprecate these compatibility fallbacks. */
|
||||||
|
typedef MctManagerSetValueFlags MctSetAppFilterFlags;
|
||||||
|
#define MCT_SET_APP_FILTER_FLAGS_NONE MCT_MANAGER_SET_VALUE_FLAGS_NONE
|
||||||
|
#define MCT_SET_APP_FILTER_FLAGS_INTERACTIVE MCT_MANAGER_SET_VALUE_FLAGS_INTERACTIVE
|
||||||
|
|
||||||
#define MCT_TYPE_MANAGER mct_manager_get_type ()
|
#define MCT_TYPE_MANAGER mct_manager_get_type ()
|
||||||
G_DECLARE_FINAL_TYPE (MctManager, mct_manager, MCT, MANAGER, GObject)
|
G_DECLARE_FINAL_TYPE (MctManager, mct_manager, MCT, MANAGER, GObject)
|
||||||
|
@ -70,12 +80,12 @@ MctManager *mct_manager_new (GDBusConnection *connection);
|
||||||
|
|
||||||
MctAppFilter *mct_manager_get_app_filter (MctManager *self,
|
MctAppFilter *mct_manager_get_app_filter (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctGetAppFilterFlags flags,
|
MctManagerGetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
GError **error);
|
||||||
void mct_manager_get_app_filter_async (MctManager *self,
|
void mct_manager_get_app_filter_async (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctGetAppFilterFlags flags,
|
MctManagerGetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
@ -86,13 +96,13 @@ MctAppFilter *mct_manager_get_app_filter_finish (MctManager *self,
|
||||||
gboolean mct_manager_set_app_filter (MctManager *self,
|
gboolean mct_manager_set_app_filter (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctAppFilter *app_filter,
|
MctAppFilter *app_filter,
|
||||||
MctSetAppFilterFlags flags,
|
MctManagerSetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
GError **error);
|
||||||
void mct_manager_set_app_filter_async (MctManager *self,
|
void mct_manager_set_app_filter_async (MctManager *self,
|
||||||
uid_t user_id,
|
uid_t user_id,
|
||||||
MctAppFilter *app_filter,
|
MctAppFilter *app_filter,
|
||||||
MctSetAppFilterFlags flags,
|
MctManagerSetValueFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
|
@ -594,7 +594,7 @@ test_app_filter_bus_get (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_get_app_filter_async (fixture->manager,
|
mct_manager_get_app_filter_async (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
while (result == NULL)
|
while (result == NULL)
|
||||||
|
@ -605,7 +605,7 @@ test_app_filter_bus_get (BusFixture *fixture,
|
||||||
{
|
{
|
||||||
app_filter = mct_manager_get_app_filter (fixture->manager,
|
app_filter = mct_manager_get_app_filter (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +650,7 @@ test_app_filter_bus_get_whitelist (BusFixture *fixture,
|
||||||
|
|
||||||
app_filter = mct_manager_get_app_filter (fixture->manager,
|
app_filter = mct_manager_get_app_filter (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
|
|
||||||
g_assert_no_error (local_error);
|
g_assert_no_error (local_error);
|
||||||
|
@ -705,7 +705,7 @@ test_app_filter_bus_get_all_oars_values (BusFixture *fixture,
|
||||||
|
|
||||||
app_filter = mct_manager_get_app_filter (fixture->manager,
|
app_filter = mct_manager_get_app_filter (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
|
|
||||||
g_assert_no_error (local_error);
|
g_assert_no_error (local_error);
|
||||||
|
@ -753,7 +753,7 @@ test_app_filter_bus_get_defaults (BusFixture *fixture,
|
||||||
|
|
||||||
app_filter = mct_manager_get_app_filter (fixture->manager,
|
app_filter = mct_manager_get_app_filter (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
|
|
||||||
g_assert_no_error (local_error);
|
g_assert_no_error (local_error);
|
||||||
|
@ -785,7 +785,7 @@ test_app_filter_bus_get_error_invalid_user (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_get_app_filter_async (fixture->manager,
|
mct_manager_get_app_filter_async (fixture->manager,
|
||||||
fixture->missing_uid,
|
fixture->missing_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
/* Handle the FindUserById() call and claim the user doesn’t exist. */
|
/* Handle the FindUserById() call and claim the user doesn’t exist. */
|
||||||
|
@ -831,7 +831,7 @@ test_app_filter_bus_get_error_permission_denied (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_get_app_filter_async (fixture->manager,
|
mct_manager_get_app_filter_async (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
/* Handle the FindUserById() call. */
|
/* Handle the FindUserById() call. */
|
||||||
|
@ -888,7 +888,7 @@ test_app_filter_bus_get_error_permission_denied_missing (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_get_app_filter_async (fixture->manager,
|
mct_manager_get_app_filter_async (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
/* Handle the FindUserById() call. */
|
/* Handle the FindUserById() call. */
|
||||||
|
@ -943,7 +943,7 @@ test_app_filter_bus_get_error_unknown (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_get_app_filter_async (fixture->manager,
|
mct_manager_get_app_filter_async (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
/* Handle the FindUserById() call and return a bogus error. */
|
/* Handle the FindUserById() call and return a bogus error. */
|
||||||
|
@ -991,7 +991,7 @@ test_app_filter_bus_get_error_disabled (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_get_app_filter_async (fixture->manager,
|
mct_manager_get_app_filter_async (fixture->manager,
|
||||||
fixture->valid_uid,
|
fixture->valid_uid,
|
||||||
MCT_GET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_GET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
/* Handle the FindUserById() call. */
|
/* Handle the FindUserById() call. */
|
||||||
|
@ -1184,7 +1184,7 @@ test_app_filter_bus_set (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_set_app_filter_async (fixture->manager,
|
mct_manager_set_app_filter_async (fixture->manager,
|
||||||
fixture->valid_uid, app_filter,
|
fixture->valid_uid, app_filter,
|
||||||
MCT_SET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_SET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
while (result == NULL)
|
while (result == NULL)
|
||||||
|
@ -1196,7 +1196,7 @@ test_app_filter_bus_set (BusFixture *fixture,
|
||||||
{
|
{
|
||||||
success = mct_manager_set_app_filter (fixture->manager,
|
success = mct_manager_set_app_filter (fixture->manager,
|
||||||
fixture->valid_uid, app_filter,
|
fixture->valid_uid, app_filter,
|
||||||
MCT_SET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_SET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1225,7 +1225,7 @@ test_app_filter_bus_set_error_invalid_user (BusFixture *fixture,
|
||||||
|
|
||||||
mct_manager_set_app_filter_async (fixture->manager,
|
mct_manager_set_app_filter_async (fixture->manager,
|
||||||
fixture->missing_uid, app_filter,
|
fixture->missing_uid, app_filter,
|
||||||
MCT_SET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_SET_VALUE_FLAGS_NONE, NULL,
|
||||||
async_result_cb, &result);
|
async_result_cb, &result);
|
||||||
|
|
||||||
/* Handle the FindUserById() call and claim the user doesn’t exist. */
|
/* Handle the FindUserById() call and claim the user doesn’t exist. */
|
||||||
|
@ -1282,7 +1282,7 @@ test_app_filter_bus_set_error_permission_denied (BusFixture *fixture,
|
||||||
|
|
||||||
success = mct_manager_set_app_filter (fixture->manager,
|
success = mct_manager_set_app_filter (fixture->manager,
|
||||||
fixture->valid_uid, app_filter,
|
fixture->valid_uid, app_filter,
|
||||||
MCT_SET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_SET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
|
|
||||||
g_assert_error (local_error,
|
g_assert_error (local_error,
|
||||||
|
@ -1320,7 +1320,7 @@ test_app_filter_bus_set_error_unknown (BusFixture *fixture,
|
||||||
|
|
||||||
success = mct_manager_set_app_filter (fixture->manager,
|
success = mct_manager_set_app_filter (fixture->manager,
|
||||||
fixture->valid_uid, app_filter,
|
fixture->valid_uid, app_filter,
|
||||||
MCT_SET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_SET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
|
|
||||||
g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR);
|
g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR);
|
||||||
|
@ -1363,7 +1363,7 @@ test_app_filter_bus_set_error_invalid_property (BusFixture *fixture,
|
||||||
|
|
||||||
success = mct_manager_set_app_filter (fixture->manager,
|
success = mct_manager_set_app_filter (fixture->manager,
|
||||||
fixture->valid_uid, app_filter,
|
fixture->valid_uid, app_filter,
|
||||||
MCT_SET_APP_FILTER_FLAGS_NONE, NULL,
|
MCT_MANAGER_SET_VALUE_FLAGS_NONE, NULL,
|
||||||
&local_error);
|
&local_error);
|
||||||
|
|
||||||
g_assert_error (local_error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
g_assert_error (local_error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
||||||
|
|
|
@ -38,9 +38,9 @@ def __get_app_filter(user_id, interactive):
|
||||||
If `interactive` is `True`, interactive polkit authorisation dialogues will
|
If `interactive` is `True`, interactive polkit authorisation dialogues will
|
||||||
be allowed. An exception will be raised on failure."""
|
be allowed. An exception will be raised on failure."""
|
||||||
if interactive:
|
if interactive:
|
||||||
flags = Malcontent.GetAppFilterFlags.INTERACTIVE
|
flags = Malcontent.ManagerGetValueFlags.INTERACTIVE
|
||||||
else:
|
else:
|
||||||
flags = Malcontent.GetAppFilterFlags.NONE
|
flags = Malcontent.ManagerGetValueFlags.NONE
|
||||||
|
|
||||||
connection = Gio.bus_get_sync(Gio.BusType.SYSTEM)
|
connection = Gio.bus_get_sync(Gio.BusType.SYSTEM)
|
||||||
manager = Malcontent.Manager.new(connection)
|
manager = Malcontent.Manager.new(connection)
|
||||||
|
@ -66,9 +66,9 @@ def __set_app_filter(user_id, app_filter, interactive):
|
||||||
If `interactive` is `True`, interactive polkit authorisation dialogues will
|
If `interactive` is `True`, interactive polkit authorisation dialogues will
|
||||||
be allowed. An exception will be raised on failure."""
|
be allowed. An exception will be raised on failure."""
|
||||||
if interactive:
|
if interactive:
|
||||||
flags = Malcontent.SetAppFilterFlags.INTERACTIVE
|
flags = Malcontent.ManagerSetValueFlags.INTERACTIVE
|
||||||
else:
|
else:
|
||||||
flags = Malcontent.SetAppFilterFlags.NONE
|
flags = Malcontent.ManagerSetValueFlags.NONE
|
||||||
|
|
||||||
connection = Gio.bus_get_sync(Gio.BusType.SYSTEM)
|
connection = Gio.bus_get_sync(Gio.BusType.SYSTEM)
|
||||||
manager = Malcontent.Manager.new(connection)
|
manager = Malcontent.Manager.new(connection)
|
||||||
|
|
Loading…
Reference in New Issue