lib: xdg_app_installation_fetch_remote_size_sync

tingping/wmclass
Alexander Larsson 2016-01-14 16:44:00 +01:00
parent 839c5ca885
commit 78601a42ce
3 changed files with 46 additions and 0 deletions

View File

@ -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);
}
}
}

View File

@ -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,

View File

@ -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,