From fd322c051258c089b41c83d5d86b2b2a6eec1913 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Wed, 14 Jul 2021 15:32:57 +0200 Subject: [PATCH] Fix having no "load more projects" available when using the search When the `_onGetProjectsFirstPageFinished` is reached, the pagination manager already contains the correct pagination metadata and links, so calling `clear()` there resets them giving the impression that there is no next page. This commit fixed that by calling the `clear()` function should when the search filter is applied, instead. CURA-8009 --- plugins/DigitalLibrary/src/DigitalFactoryController.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DigitalLibrary/src/DigitalFactoryController.py b/plugins/DigitalLibrary/src/DigitalFactoryController.py index 9c412a9747..0821cc6925 100644 --- a/plugins/DigitalLibrary/src/DigitalFactoryController.py +++ b/plugins/DigitalLibrary/src/DigitalFactoryController.py @@ -211,7 +211,6 @@ class DigitalFactoryController(QObject): :param df_projects: A list of all the Digital Factory Library projects linked to the user's account """ - self.clear() self.setHasMoreProjectsToLoad(self._api.hasMoreProjectsToLoad()) self._project_model.setProjects(df_projects) self.setRetrievingProjectsStatus(RetrievalStatus.Success) @@ -338,6 +337,7 @@ class DigitalFactoryController(QObject): Actually apply the current filter to search for projects with the user-defined search string. :return: """ + self.clear() self.projectFilterChanged.emit() self._api.getProjectsFirstPage(search_filter = self._project_filter, on_finished = self._onGetProjectsFirstPageFinished, failed = self._onGetProjectsFailed)