]> source.dussan.org Git - gitblit.git/commitdiff
fixes #966 to prevent always searching all repos 1060/head
authorPaul Martin <paul@paulsputer.com>
Sat, 16 Apr 2016 15:41:45 +0000 (16:41 +0100)
committerPaul Martin <paul@paulsputer.com>
Sat, 16 Apr 2016 15:41:45 +0000 (16:41 +0100)
src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.java

index b2fd9037d98b44a94c43c36966cb0a98be35b5e6..1d81061e59aaa9c642f80a4d570528a19b7c586f 100644 (file)
@@ -66,6 +66,8 @@ public class LuceneSearchPage extends RootPage {
                // default values\r
                ArrayList<String> repositories = new ArrayList<String>();\r
                String query = "";\r
+               boolean allRepos = false;\r
+\r
                int page = 1;\r
                int pageSize = app().settings().getInteger(Keys.web.itemsPerPage, 50);\r
 \r
@@ -91,8 +93,9 @@ public class LuceneSearchPage extends RootPage {
                                List<String> list = StringUtils.getStringsFromValue(value);\r
                                repositories.addAll(list);\r
                        }\r
-
-                       if (params.containsKey("allrepos")) {\r
+\r
+                       allRepos = params.getAsBoolean("allrepos", false);
+                       if (allRepos) {\r
                                repositories.addAll(availableRepositories);\r
                        }\r
 \r
@@ -133,7 +136,7 @@ public class LuceneSearchPage extends RootPage {
                // search form\r
                final Model<String> queryModel = new Model<String>(query);\r
                final Model<ArrayList<String>> repositoriesModel = new Model<ArrayList<String>>(searchRepositories);\r
-               final Model<Boolean> allreposModel = new Model<Boolean>(params != null && params.containsKey("allrepos"));\r
+               final Model<Boolean> allreposModel = new Model<Boolean>(allRepos);\r
                SessionlessForm<Void> form = new SessionlessForm<Void>("searchForm", getClass()) {\r
 \r
                        private static final long serialVersionUID = 1L;\r