Skip to content

Commit

Permalink
Merge pull request #630 from nextcloud/backport/619/stable-2.6
Browse files Browse the repository at this point in the history
[stable-2.6] Activity: preview object now has filename
  • Loading branch information
AndyScherzinger authored May 25, 2021
2 parents 84ee799 + 95a223e commit 1a3c037
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
11 changes: 1 addition & 10 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/analysis/lint-results.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: No errors or warnings</span>
<span class="mdl-layout-title">Lint Report: 3 warnings</span>
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ public class PreviewObject {
private Boolean mimeTypeIcon;
private String mimeType;
private String view;
private String filename;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

import java.io.IOException;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
* PreviewList Parser
*/
Expand Down Expand Up @@ -59,13 +61,20 @@ public PreviewObject read(JsonReader in) throws IOException {
return preview;
}

@SuppressFBWarnings(value = "SF_SWITCH_NO_DEFAULT",
justification = "default case is not found correctly")
private PreviewObject readObject(JsonReader in) throws IOException {
String tag;
PreviewObject preview = new PreviewObject();

do {
tag = in.nextName();

try {
tag = in.nextName();
} catch (IllegalStateException e) {
in.skipValue();
tag = "";
}

switch (tag) {
case "source":
preview.setSource(in.nextString());
Expand All @@ -91,6 +100,9 @@ private PreviewObject readObject(JsonReader in) throws IOException {
preview.setView(in.nextString());
break;

case "filename":
preview.setFilename(in.nextString());

default:
// do nothing
break;
Expand Down

0 comments on commit 1a3c037

Please sign in to comment.