Skip to content

Commit 237c892

Browse files
author
emmanue1
committed
Avoid double opening a recent file
1 parent fa0a730 commit 237c892

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/src/main/java/org/jd/gui/controller/MainController.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,21 @@ protected void panelClosed() {
529529
public boolean openURI(URI uri) {
530530
if (uri != null) {
531531
boolean success = mainView.openUri(uri);
532-
UriLoader uriLoader = getUriLoader(uri);
533532

534-
if (uriLoader != null) {
535-
success |= uriLoader.load(this, uri);
533+
if (success == false) {
534+
UriLoader uriLoader = getUriLoader(uri);
535+
if (uriLoader != null) {
536+
success = uriLoader.load(this, uri);
537+
}
536538
}
537539

538540
if (success) {
539541
addURI(uri);
540542
}
543+
541544
return success;
542545
}
546+
543547
return false;
544548
}
545549

app/src/main/java/org/jd/gui/service/mainpanel/ContainerPanelFactoryProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected class ContainerPanel extends TreeTabbedPanel implements ContentIndexab
4747
protected Container.Entry entry;
4848

4949
public ContainerPanel(API api, Container container) {
50-
super(api, container.getRoot().getUri());
50+
super(api, container.getRoot().getParent().getUri());
5151

5252
this.entry = container.getRoot().getParent();
5353

0 commit comments

Comments
 (0)