forked from Mirrors/flatpak-builder
lib: xdg_app_installation_fetch_remote_size_sync
parent
839c5ca885
commit
78601a42ce
|
@ -263,6 +263,25 @@ main (int argc, char *argv[])
|
|||
xdg_app_ref_get_branch (XDG_APP_REF(ref)),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(ref)),
|
||||
xdg_app_remote_ref_get_remote_name (ref));
|
||||
|
||||
if (j == 0)
|
||||
{
|
||||
guint64 download_size;
|
||||
guint64 installed_size;
|
||||
if (!xdg_app_installation_fetch_remote_size_sync (installation,
|
||||
xdg_app_remote_get_name (remote),
|
||||
xdg_app_ref_get_commit (XDG_APP_REF(ref)),
|
||||
&download_size,
|
||||
&installed_size,
|
||||
NULL, &error))
|
||||
{
|
||||
g_print ("error fetching sizes: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
g_print ("Download size: %"G_GUINT64_FORMAT" Installed size: %"G_GUINT64_FORMAT"\n",
|
||||
download_size, installed_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -974,6 +974,26 @@ xdg_app_installation_uninstall (XdgAppInstallation *self,
|
|||
}
|
||||
|
||||
|
||||
gboolean
|
||||
xdg_app_installation_fetch_remote_size_sync (XdgAppInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *commit,
|
||||
guint64 *download_size,
|
||||
guint64 *installed_size,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
|
||||
|
||||
return xdg_app_dir_fetch_sizes (priv->dir, remote_name, commit,
|
||||
download_size,
|
||||
NULL,
|
||||
NULL,
|
||||
installed_size,
|
||||
cancellable,
|
||||
error);
|
||||
}
|
||||
|
||||
GBytes *
|
||||
xdg_app_installation_fetch_remote_metadata_sync (XdgAppInstallation *self,
|
||||
const char *remote_name,
|
||||
|
|
|
@ -139,6 +139,13 @@ XDG_APP_EXTERN gboolean xdg_app_installation_uninstall
|
|||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
XDG_APP_EXTERN gboolean xdg_app_installation_fetch_remote_size_sync (XdgAppInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *commit,
|
||||
guint64 *download_size,
|
||||
guint64 *installed_size,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
XDG_APP_EXTERN GBytes * xdg_app_installation_fetch_remote_metadata_sync (XdgAppInstallation *self,
|
||||
const char *remote_name,
|
||||
const char *commit,
|
||||
|
|
Loading…
Reference in New Issue