From a56efda17cc53935feb9f3fbe2d4673b42c09613 Mon Sep 17 00:00:00 2001 From: Gabriel Bolbotina Date: Tue, 31 Mar 2026 16:11:56 +0300 Subject: [PATCH 1/3] Removed filter controller from main --- app/qml/filters/MMFiltersPanel.qml | 1 - app/qml/main.qml | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/qml/filters/MMFiltersPanel.qml b/app/qml/filters/MMFiltersPanel.qml index 3532398e9..9596b1350 100644 --- a/app/qml/filters/MMFiltersPanel.qml +++ b/app/qml/filters/MMFiltersPanel.qml @@ -131,7 +131,6 @@ MMComponents.MMDrawer { layerId: model.layerId layerName: model.layerName - filterController: __activeProject.filterController vectorLayer: model.layer } } diff --git a/app/qml/main.qml b/app/qml/main.qml index 323bf4d75..aead3ad77 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -32,10 +32,7 @@ import "./filters" ApplicationWindow { id: window - // Global filter controller for managing map filters - MM.FilterController { - id: globalFilterController - } + readonly property var filterController: __activeProject.filterController visible: true x: __appwindowx @@ -155,7 +152,7 @@ ApplicationWindow { height: window.height - mapToolbar.height width: window.width - filterController: globalFilterController + filterController: window.filterController mapExtentOffset: { // offset depends on what panels are visible. @@ -524,8 +521,6 @@ ApplicationWindow { active: false sourceComponent: MMFiltersPanel { - filterController: globalFilterController - onClosed: { filtersDrawerLoader.active = false stateManager.state = "map" From 37175a4bc04f7d9997c768d92a143b9a77db4bf3 Mon Sep 17 00:00:00 2001 From: Gabriel Bolbotina Date: Tue, 31 Mar 2026 16:35:23 +0300 Subject: [PATCH 2/3] Removed property --- app/qml/main.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/qml/main.qml b/app/qml/main.qml index aead3ad77..20b69ddc3 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -32,8 +32,6 @@ import "./filters" ApplicationWindow { id: window - readonly property var filterController: __activeProject.filterController - visible: true x: __appwindowx y: __appwindowy @@ -152,7 +150,7 @@ ApplicationWindow { height: window.height - mapToolbar.height width: window.width - filterController: window.filterController + filterController: __activeProject.filterController mapExtentOffset: { // offset depends on what panels are visible. From 42d996389c1ae24e450ece5b97bfc6550774f7bb Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Tue, 31 Mar 2026 16:44:20 +0200 Subject: [PATCH 3/3] Refactore last bits of FilterController refs --- app/qml/filters/MMFiltersPanel.qml | 4 ++-- app/qml/layers/MMFeaturesListPage.qml | 6 +++--- app/qml/main.qml | 2 -- app/qml/map/MMMapController.qml | 9 +++------ 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/qml/filters/MMFiltersPanel.qml b/app/qml/filters/MMFiltersPanel.qml index 9596b1350..bcb81327d 100644 --- a/app/qml/filters/MMFiltersPanel.qml +++ b/app/qml/filters/MMFiltersPanel.qml @@ -79,8 +79,8 @@ MMComponents.MMDrawer { } onClicked: { - __activeProject.filterController.clearAllFilters() - filterController.applyFiltersToAllLayers() + __activeProject.filterController.clearAllFilters() + __activeProject.filterController.applyFiltersToAllLayers() root.filtersApplied = true // Refresh the UI to clear input fields internal.refreshLayers() diff --git a/app/qml/layers/MMFeaturesListPage.qml b/app/qml/layers/MMFeaturesListPage.qml index e5232c7d7..5a13ce34a 100644 --- a/app/qml/layers/MMFeaturesListPage.qml +++ b/app/qml/layers/MMFeaturesListPage.qml @@ -43,7 +43,7 @@ MMComponents.MMPage { height: filterRow.implicitHeight + 2 * __style.margin8 radius: __style.radius12 - visible: root.selectedLayer && globalFilterController.filteredLayerIds.indexOf(root.selectedLayer.id) >= 0 + visible: root.selectedLayer && __activeProject.filterController.filteredLayerIds.indexOf(root.selectedLayer.id) >= 0 color: __style.sandColor border.width: 1 * __dp @@ -79,8 +79,8 @@ MMComponents.MMPage { anchors.verticalCenter: parent.verticalCenter onClicked: { - globalFilterController.clearAllFilters() - globalFilterController.applyFiltersToAllLayers() + __activeProject.filterController.clearAllFilters() + __activeProject.filterController.applyFiltersToAllLayers() featuresModel.reloadFeatures() } } diff --git a/app/qml/main.qml b/app/qml/main.qml index 20b69ddc3..b09da1575 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -150,8 +150,6 @@ ApplicationWindow { height: window.height - mapToolbar.height width: window.width - filterController: __activeProject.filterController - mapExtentOffset: { // offset depends on what panels are visible. // we need to subtract mapToolbar's height from any visible panel diff --git a/app/qml/map/MMMapController.qml b/app/qml/map/MMMapController.qml index ef37784e5..e512bb7d2 100644 --- a/app/qml/map/MMMapController.qml +++ b/app/qml/map/MMMapController.qml @@ -46,9 +46,6 @@ Item { property MM.MapSketchingController sketchingController: sketchesLoader.item?.controller ?? null - // Filter controller for managing feature filters - property var filterController: null - signal featureIdentified( var pair ) signal featuresIdentified( var pairs ) signal nothingIdentified() @@ -595,9 +592,9 @@ Item { MMMapButton { id: filterIndicatorButton - visible: root.state === "view" && root.filterController && (root.filterController.hasActiveFilters || AppSettings.alwaysShowFilterButton) - iconSource: root.filterController && root.filterController.hasActiveFilters ? __style.filterFilledIcon : __style.filterIcon - bgndColor: root.filterController && root.filterController.hasActiveFilters ? __style.sandColor : __style.polarColor + visible: root.state === "view" && __activeProject.filterController && (__activeProject.filterController.hasActiveFilters || AppSettings.alwaysShowFilterButton) + iconSource: __activeProject.filterController && __activeProject.filterController.hasActiveFilters ? __style.filterFilledIcon : __style.filterIcon + bgndColor: __activeProject.filterController && __activeProject.filterController.hasActiveFilters ? __style.sandColor : __style.polarColor anchors { left: parent.left