lib: Add cancellable to Installation constructors

tingping/wmclass
Alexander Larsson 2015-12-18 14:20:28 +01:00
parent fdc9b62988
commit 2f74965935
3 changed files with 19 additions and 11 deletions

View File

@ -25,7 +25,7 @@ main (int argc, char *argv[])
GError *error = NULL;
int i, j;
installation = xdg_app_installation_new_user (&error);
installation = xdg_app_installation_new_user (NULL, &error);
if (installation == NULL)
{
g_print ("error: %s\n", error->message);

View File

@ -105,6 +105,7 @@ xdg_app_installation_init (XdgAppInstallation *self)
static XdgAppInstallation *
xdg_app_installation_new_for_dir (XdgAppDir *dir,
GCancellable *cancellable,
GError **error)
{
XdgAppInstallation *self;
@ -125,21 +126,25 @@ xdg_app_installation_new_for_dir (XdgAppDir *dir,
}
XdgAppInstallation *
xdg_app_installation_new_system (GError **error)
xdg_app_installation_new_system (GCancellable *cancellable,
GError **error)
{
return xdg_app_installation_new_for_dir (xdg_app_dir_get_system (), error);
return xdg_app_installation_new_for_dir (xdg_app_dir_get_system (), cancellable, error);
}
XdgAppInstallation *
xdg_app_installation_new_user (GError **error)
xdg_app_installation_new_user (GCancellable *cancellable,
GError **error)
{
return xdg_app_installation_new_for_dir (xdg_app_dir_get_user (), error);
return xdg_app_installation_new_for_dir (xdg_app_dir_get_user (), cancellable, error);
}
XdgAppInstallation *
xdg_app_installation_new_for_path (GFile *path, gboolean user, GError **error)
xdg_app_installation_new_for_path (GFile *path, gboolean user,
GCancellable *cancellable,
GError **error)
{
return xdg_app_installation_new_for_dir (xdg_app_dir_new (path, user), error);
return xdg_app_installation_new_for_dir (xdg_app_dir_new (path, user), cancellable, error);
}
gboolean

View File

@ -56,10 +56,13 @@ typedef enum {
G_DEFINE_AUTOPTR_CLEANUP_FUNC(XdgAppInstallation, g_object_unref)
#endif
XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_system (GError **error);
XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_user (GError **error);
XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_system (GCancellable *cancellable,
GError **error);
XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_user (GCancellable *cancellable,
GError **error);
XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_for_path (GFile *path,
gboolean user,
GCancellable *cancellable,
GError **error);
typedef void (*XdgAppProgressCallback)(const char *status,
@ -72,8 +75,8 @@ XDG_APP_EXTERN gboolean xdg_app_installation_launch
const char *name,
const char *arch,
const char *branch,
const char *commit,
GCancellable *cancellable,
const char *commit,
GCancellable *cancellable,
GError **error);
XDG_APP_EXTERN GPtrArray *xdg_app_installation_list_installed_refs (XdgAppInstallation *self,
GCancellable *cancellable,