[gnome-software] trivial: Never allow a lot of search results to block the UI



commit d4a69852e73fa5babf714cabccd87063e8cd772b
Author: Richard Hughes <richard hughsie com>
Date:   Sat Jan 3 13:45:14 2015 +0000

    trivial: Never allow a lot of search results to block the UI

 src/gs-plugin-loader.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index f793e86..0aa0742 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -1642,6 +1642,13 @@ gs_plugin_loader_search_thread_cb (GTask *task,
                                         "no search results to show");
                goto out;
        }
+       if (g_list_length (state->list) > 500) {
+               g_task_return_new_error (task,
+                                        GS_PLUGIN_LOADER_ERROR,
+                                        GS_PLUGIN_LOADER_ERROR_NO_RESULTS,
+                                        "To many search results returned");
+               goto out;
+       }
 
        /* success */
        g_task_return_pointer (task, gs_plugin_list_copy (state->list), (GDestroyNotify) gs_plugin_list_free);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]