Skip to content

Commit

Permalink
Minor fixes in news2
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Oct 22, 2021
1 parent 69190a1 commit 0eeb551
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/main/java/org/luwrain/app/news2/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,20 @@ boolean openGroup(NewsGroup newGroup)

void loadGroups()
{
try {
final List<GroupWrapper> w = new LinkedList();
final NewsGroup[] g = storing.getGroups().load();
Arrays.sort(g);
int[] newCounts = storing.getArticles().countNewInGroups(g);
int[] markedCounts = storing.getArticles().countMarkedInGroups(g);
for(int i = 0;i < g.length;++i)
{
final int newCount = i < newCounts.length?newCounts[i]:0;
final int markedCount = i < markedCounts.length?markedCounts[i]:0;
if (showAllGroups || newCount > 0 || markedCount > 0)
w.add(new GroupWrapper(g[i], newCount));
}
this.groups.clear();
this.groups.addAll(w);
}
catch(PimException e)
final List<GroupWrapper> w = new LinkedList();
final NewsGroup[] g = storing.getGroups().load();
Arrays.sort(g);
int[] newCounts = storing.getArticles().countNewInGroups(g);
int[] markedCounts = storing.getArticles().countMarkedInGroups(g);
for(int i = 0;i < g.length;++i)
{
this.groups.clear();
crash(e);
final int newCount = i < newCounts.length?newCounts[i]:0;
final int markedCount = i < markedCounts.length?markedCounts[i]:0;
if (showAllGroups || newCount > 0 || markedCount > 0)
w.add(new GroupWrapper(g[i], newCount));
}
this.groups.clear();
this.groups.addAll(w);
}

void loadArticles()
Expand Down

0 comments on commit 0eeb551

Please sign in to comment.