Skip to content

Commit

Permalink
Fix #9889.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Sep 8, 2017
1 parent 21143e3 commit 5bd63b7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
Expand Up @@ -1076,7 +1076,6 @@ public boolean acceptsPreviewPanelControl(QLPreviewPanel panel) {
*/
@Override
public void beginPreviewPanelControl(QLPreviewPanel panel) {
quicklook.willBeginQuickLook();
}

/**
Expand All @@ -1088,7 +1087,6 @@ public void beginPreviewPanelControl(QLPreviewPanel panel) {
*/
@Override
public void endPreviewPanelControl(QLPreviewPanel panel) {
quicklook.didEndQuickLook();
}

@Action
Expand Down
Expand Up @@ -74,26 +74,14 @@ public boolean isOpen() {
&& QLPreviewPanel.sharedPreviewPanel().isVisible();
}

@Override
public void willBeginQuickLook() {
final QLPreviewPanel panel = QLPreviewPanel.sharedPreviewPanel();
if(log.isDebugEnabled()) {
log.debug(String.format("Set datasource for panel %s", panel));
}
panel.setDataSource(model.id());
}

@Override
public void open() {
final QLPreviewPanel panel = QLPreviewPanel.sharedPreviewPanel();
if(log.isDebugEnabled()) {
log.debug(String.format("Order front panel %s", panel));
}
panel.makeKeyAndOrderFront(null);
if(null == panel.dataSource()) {
log.warn("Do not reload data yet because datasource is not yet setup. Focus has probably changed to another application since");
return;
}
panel.setDataSource(model.id());
if(log.isDebugEnabled()) {
log.debug(String.format("Reload data for panel %s", panel));
}
Expand All @@ -108,13 +96,9 @@ public void close() {
}
panel.setDataSource(null);
panel.orderOut(null);
}

@Override
public void didEndQuickLook() {
if(log.isDebugEnabled()) {
log.debug("Clear previews");
}
previews.clear();
}
}
}
Expand Up @@ -46,7 +46,4 @@ public interface QuickLook {
* Close QuickLook panel if any
*/
void close();

void willBeginQuickLook();
void didEndQuickLook();
}

0 comments on commit 5bd63b7

Please sign in to comment.