diff options
author | James Moger <james.moger@gitblit.com> | 2013-11-16 11:42:06 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-11-26 16:07:04 -0500 |
commit | 99d0d4fd66f3490b61c700065b7d16bc4e73f226 (patch) | |
tree | 0e5d8bd9e7b14905ab6ea71e8bf6253345415a70 /src/main/java/com/gitblit/wicket/panels/LogPanel.java | |
parent | a7a0b8ea01dca14602fdb49047d987c36461e861 (diff) | |
download | gitblit-99d0d4fd66f3490b61c700065b7d16bc4e73f226.tar.gz gitblit-99d0d4fd66f3490b61c700065b7d16bc4e73f226.zip |
Eliminate nearly all direct GitBlit singleton references in Wicket
This is the first step towards modularization and injection. All
direct references to the GitBlit singleton within the Wicket pages
and panels have been replaced to proxy methods in the GitBlitWebApp
singleton. There are still two Wicket classes which rely on the
GitBlit singleton; those require manual instantiation (servlet 3).
Change-Id: I0cdbbcf87959d590c446c99abb09c07c87c737bc
Diffstat (limited to 'src/main/java/com/gitblit/wicket/panels/LogPanel.java')
-rw-r--r-- | src/main/java/com/gitblit/wicket/panels/LogPanel.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/LogPanel.java b/src/main/java/com/gitblit/wicket/panels/LogPanel.java index eba0dd3b..7c91d22d 100644 --- a/src/main/java/com/gitblit/wicket/panels/LogPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/LogPanel.java @@ -34,7 +34,6 @@ import org.eclipse.jgit.revwalk.RevCommit; import com.gitblit.BranchGraphServlet;
import com.gitblit.Constants;
-import com.gitblit.GitBlit;
import com.gitblit.Keys;
import com.gitblit.models.RefModel;
import com.gitblit.utils.JGitUtils;
@@ -57,7 +56,7 @@ public class LogPanel extends BasePanel { Repository r, int limit, int pageOffset, boolean showRemoteRefs) {
super(wicketId);
boolean pageResults = limit <= 0;
- int itemsPerPage = GitBlit.getInteger(Keys.web.itemsPerPage, 50);
+ int itemsPerPage = app().settings().getInteger(Keys.web.itemsPerPage, 50);
if (itemsPerPage <= 1) {
itemsPerPage = 50;
}
@@ -77,7 +76,7 @@ public class LogPanel extends BasePanel { hasMore = commits.size() >= itemsPerPage;
final String baseUrl = WicketUtils.getGitblitURL(getRequest());
- final boolean showGraph = GitBlit.getBoolean(Keys.web.showBranchGraph, true);
+ final boolean showGraph = app().settings().getBoolean(Keys.web.showBranchGraph, true);
MarkupContainer graph = new WebMarkupContainer("graph");
add(graph);
@@ -101,7 +100,7 @@ public class LogPanel extends BasePanel { WicketUtils.newRepositoryParameter(repositoryName)));
}
- final int hashLen = GitBlit.getInteger(Keys.web.shortCommitIdLength, 6);
+ final int hashLen = app().settings().getInteger(Keys.web.shortCommitIdLength, 6);
ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);
DataView<RevCommit> logView = new DataView<RevCommit>("commit", dp) {
private static final long serialVersionUID = 1L;
|