[vcs-log] disable speedsearch when there are not indexed roots

This commit is contained in:
Julia Beliaeva
2017-01-13 14:16:41 +03:00
parent 3e8d435815
commit fadb976118
@@ -131,7 +131,18 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider,
PopupHandler.installPopupHandler(this, VcsLogActionPlaces.POPUP_ACTION_GROUP, VcsLogActionPlaces.VCS_LOG_TABLE_PLACE);
ScrollingUtil.installActions(this, false);
new VcsLogSpeedSearch(this);
new VcsLogSpeedSearch(this) {
@Override
protected boolean isSpeedSearchEnabled() {
if (super.isSpeedSearchEnabled()) {
for (VirtualFile root : getModel().getVisiblePack().getLogProviders().keySet()) {
if (!myLogData.getIndex().isIndexed(root)) return false;
}
return true;
}
return false;
}
};
initColumnSize();
addComponentListener(new ComponentAdapter() {
@@ -146,7 +157,6 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider,
VcsLogGraphTable.Selection previousSelection = getSelection();
getModel().setVisiblePack(visiblePack);
previousSelection.restore(visiblePack.getVisibleGraph(), true, permGraphChanged);
for (VcsLogHighlighter highlighter : myHighlighters) {
highlighter.update(visiblePack, permGraphChanged);
}