Small fixes

This commit is contained in:
crschnick
2026-09-17 14:41:06 +00:00
parent 15fda3ad96
commit 3cc6180f32
3 changed files with 7 additions and 13 deletions
@@ -489,7 +489,7 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab<File
.orElse(null)
== ShellDialects.CMD) {
var env = ProcModuleProvider.get().subShellEnvironment(getEntry().asNeeded(), ShellDialects.POWERSHELL);
var entry = DataStoreEntry.createNew(getName().getValue() + " (PowerShell)", env);
var entry = DataStoreEntry.createNew("PowerShell", env);
entry.setColor(DataStorage.get().getEffectiveColor(getEntry().get()));
entry.setCategoryUuid(getEntry().get().getCategoryUuid());
bm.openFileSystemAsync(entry.ref(), null, m -> FilePath.of(path), null);
@@ -369,6 +369,10 @@ public class StoreCategoryWrapper {
public void insertSiblingCategory(StoreCategoryWrapper selection, boolean after) {
var l = getParent().getShownChildren().getList();
var index = l.indexOf(this);
if (index == -1) {
return;
}
var min = index > 0 || after
? l.get(index - (after ? 0 : 1)).getCategory().getOrderIndex()
: l.getFirst().getCategory().getOrderIndex() - 1.0;
@@ -224,24 +224,14 @@ public final class FilePath {
}
var joined = String.join("/", split());
var prefix = hasWindowsUncPrefix() ? "//" : value.startsWith("/") ? "/" : "";
var prefix = value.startsWith("/") ? "/" : "";
var suffix = value.endsWith("/") || value.endsWith("\\") ? "/" : "";
return FilePath.of(prefix + joined + suffix);
}
public FilePath toWindows() {
var prefix = hasWindowsUncPrefix() ? "\\\\" : "";
var suffix = value.endsWith("/") || value.endsWith("\\") ? "\\" : "";
return FilePath.of(prefix + String.join("\\", split()) + suffix);
}
/**
* Returns whether this file path has a Universal Naming Convention (UNC) prefix.
*
* @return true if the file path has a UNC prefix, false otherwise
*/
private boolean hasWindowsUncPrefix() {
return value.startsWith("\\\\") && !split().isEmpty();
return FilePath.of(String.join("\\", split()) + suffix);
}
public boolean isRoot() {