From e8c19cf08e019d587c8d6fc9d7899976ff3f2d53 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 20 Jun 2019 11:44:09 +0100 Subject: [PATCH] git: cleanup: move the saveFilterValues closer to the getFilterValues Although saveFilterValues doesn't operate any data specific for the range, it is much readable to keep logic of both methods close to each other. GitOrigin-RevId: 2249a1d6c50daf93fc4ac4652c3d372f3f0a3177 --- plugins/git4idea/src/git4idea/update/GitUpdateInfoAsLog.kt | 6 ++++++ .../git4idea/update/GitUpdateProjectInfoLogProperties.java | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateInfoAsLog.kt b/plugins/git4idea/src/git4idea/update/GitUpdateInfoAsLog.kt index c84ce3320867..73aa4c533cc7 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateInfoAsLog.kt +++ b/plugins/git4idea/src/git4idea/update/GitUpdateInfoAsLog.kt @@ -136,6 +136,12 @@ class GitUpdateInfoAsLog(private val project: Project, } } + override fun saveFilterValues(filterName: String, values: List?) { + if (filterName !== RANGE_FILTER.name && filterName !== BRANCH_FILTER.name && filterName !== REVISION_FILTER.name) { + mainProperties.saveFilterValues(filterName, values) + } + } + fun havePresetFilters(): Boolean { val filters = mainProperties.state.FILTERS return if (filters[RANGE_FILTER.name] != null) filters.size > 1 else filters.isNotEmpty() diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateProjectInfoLogProperties.java b/plugins/git4idea/src/git4idea/update/GitUpdateProjectInfoLogProperties.java index f4a79ba0a7c3..678fcda29895 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateProjectInfoLogProperties.java +++ b/plugins/git4idea/src/git4idea/update/GitUpdateProjectInfoLogProperties.java @@ -54,11 +54,4 @@ public class GitUpdateProjectInfoLogProperties extends VcsLogUiPropertiesImpl values) { VcsLogProjectTabsProperties.addRecentGroup(commonState.RECENT_FILTERS, filterName, values); } - - @Override - public void saveFilterValues(@NotNull String filterName, @Nullable List values) { - if (filterName != RANGE_FILTER.getName() && filterName != BRANCH_FILTER.getName() && filterName != REVISION_FILTER.getName()) { - super.saveFilterValues(filterName, values); - } - } } \ No newline at end of file