mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix some constant conditions concerning VirtualFile.getPresentableUrl
This commit is contained in:
@@ -87,12 +87,7 @@ class CacheUpdateRunner {
|
||||
int percent = (int)(processed.size() * 100 / total);
|
||||
indicator.setText("Indexing... " + percent + "%");
|
||||
if (ApplicationManager.getApplication().isInternal()) {
|
||||
if (virtualFile.isValid()) {
|
||||
indicator.setText2(virtualFile.getPresentableUrl());
|
||||
}
|
||||
else {
|
||||
indicator.setText2("");
|
||||
}
|
||||
indicator.setText2(virtualFile.getPresentableUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,12 +100,7 @@ public class DirectoryGroupingRule implements UsageGroupingRule {
|
||||
@NotNull
|
||||
public String getText(UsageView view) {
|
||||
String relativePath = VfsUtilCore.getRelativePath(myDir, myProject.getBaseDir(), File.separatorChar);
|
||||
if (relativePath != null) {
|
||||
return relativePath;
|
||||
}
|
||||
String url = myDir.getPresentableUrl();
|
||||
|
||||
return url != null ? url : "<invalid>";
|
||||
return relativePath != null ? relativePath : myDir.getPresentableUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -79,12 +79,6 @@ public class GitUtil {
|
||||
if (o2 == null) {
|
||||
return 1;
|
||||
}
|
||||
if (o1.getPresentableUrl() == null) {
|
||||
return -1;
|
||||
}
|
||||
if (o2.getPresentableUrl() == null) {
|
||||
return 1;
|
||||
}
|
||||
return o1.getPresentableUrl().compareTo(o2.getPresentableUrl());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -155,7 +155,7 @@ public class GitUIUtil {
|
||||
return new ListCellRendererWrapper<VirtualFile>() {
|
||||
@Override
|
||||
public void customize(final JList list, final VirtualFile file, final int index, final boolean selected, final boolean hasFocus) {
|
||||
setText(file == null || !file.isValid() ? "(invalid)" : file.getPresentableUrl());
|
||||
setText(file == null ? "(invalid)" : file.getPresentableUrl());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user