[gnome-software] sources dialog: Simplify saving results
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] sources dialog: Simplify saving results
- Date: Sat, 27 Jan 2018 15:47:27 +0000 (UTC)
commit 422057a5069459f1d15765f2d7fbba3772386fdc
Author: Kalev Lember <klember redhat com>
Date: Sat Jan 27 16:39:56 2018 +0100
sources dialog: Simplify saving results
We don't need to build a new list and can just keep what the plugin
loader returned.
src/gs-sources-dialog.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-sources-dialog.c b/src/gs-sources-dialog.c
index 31a19f40..e1ff674b 100644
--- a/src/gs-sources-dialog.c
+++ b/src/gs-sources-dialog.c
@@ -370,11 +370,9 @@ get_resolve_nonfree_sources_cb (GsPluginLoader *plugin_loader,
return;
}
- /* add each */
- for (guint i = 0; i < gs_app_list_length (list); i++) {
- GsApp *app = gs_app_list_index (list, i);
- gs_app_list_add (dialog->nonfree_source_list, app);
- }
+ /* save results for later */
+ g_clear_object (&dialog->nonfree_source_list);
+ dialog->nonfree_source_list = g_object_ref (list);
/* refresh widget */
if (dialog->nonfree_search_cnt == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]