Skip to content

Commit ffda0fb

Browse files
committed
alpm: Use 'pk_backend_job_details_full()' so download size is reported properly
This is needed for download size reporting to work in PK clients which use the 'download-size' property (introduced in 3741c68) in 'get-details' response. 'download-size' property is available only when the PK backend uses 'pk_backend_job_details_full()', not otherwise. Part of: PackageKit#781
1 parent bde6ca0 commit ffda0fb

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

backends/alpm/pk-alpm-packages.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ pk_backend_get_details_thread (PkBackendJob *job, GVariant* params, gpointer p)
228228
GString *licenses;
229229
PkGroupEnum group;
230230
const gchar *desc, *url;
231-
gulong size;
232231

233232
if (pk_backend_job_is_cancelled (job))
234233
break;
@@ -254,14 +253,9 @@ pk_backend_get_details_thread (PkBackendJob *job, GVariant* params, gpointer p)
254253
desc = alpm_pkg_get_desc (pkg);
255254
url = alpm_pkg_get_url (pkg);
256255

257-
if (alpm_pkg_get_origin (pkg) == ALPM_PKG_FROM_LOCALDB) {
258-
size = alpm_pkg_get_isize (pkg);
259-
} else {
260-
size = alpm_pkg_download_size (pkg);
261-
}
262-
263-
pk_backend_job_details (job, *packages, NULL, licenses->str, group,
264-
desc, url, size);
256+
pk_backend_job_details_full (job, *packages, NULL, licenses->str, group,
257+
desc, url, alpm_pkg_get_isize (pkg),
258+
alpm_pkg_download_size (pkg));
265259
g_string_free (licenses, TRUE);
266260
}
267261

0 commit comments

Comments
 (0)