Browse Source

bug fix

master
XiaXiang 8 years ago
parent
commit
9c6f0e254b
  1. 12
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java
  2. 6
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

12
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java

@ -27,10 +27,7 @@ import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLableReader;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* Created by XiaXiang on 2017/5/15.
@ -226,12 +223,15 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
if (ComparatorUtils.equals(key, searchText)) {
recentModelList = recentKVModelMap.get(searchText);
List<AlphaCellModel> resultModelList = new ArrayList<>(recentModelList);
int size = resultModelList.size();
for (AlphaCellModel model : resultModelList) {
Iterator<AlphaCellModel> modelIterator = resultModelList.iterator();
while (modelIterator.hasNext()) {
AlphaCellModel model = modelIterator.next();
if (model.getType() == CellType.ACTION && !((ActionModel) model).getAction().isEnabled()) {
resultModelList.remove(model);
}
}
int size = resultModelList.size();
if (size > MAX_SIZE) {
return resultModelList.subList(size - MAX_SIZE, size);
}

6
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

@ -17,6 +17,7 @@ import com.fr.json.JSONObject;
import com.fr.stable.CodeUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
@ -68,10 +69,13 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
} catch (JSONException e) {
FRLogger.getLogger().error("recommend search error! :" + e.getMessage());
}
for (AlphaCellModel model : recommendModelList) {
Iterator<AlphaCellModel> modelIterator = recommendModelList.iterator();
while (modelIterator.hasNext()) {
AlphaCellModel model = modelIterator.next();
if (model.getType() == CellType.ACTION && !((ActionModel) model).getAction().isEnabled()) {
recommendModelList.remove(model);
}
}
if (recommendModelList.size() > 0) {
modelList.add(new MoreModel(Inter.getLocText("FR-Designer_AlphaFine_Recommend"), false));

Loading…
Cancel
Save