mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-30 04:15:52 +00:00
Small fixes
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user