mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Various small fixes
This commit is contained in:
parent
b7b3acf168
commit
99d867965b
7 changed files with 12 additions and 16 deletions
|
@ -46,8 +46,7 @@ public interface BrowserAction {
|
||||||
default List<BrowserEntry> resolveFilesIfNeeded(List<BrowserEntry> selected) {
|
default List<BrowserEntry> resolveFilesIfNeeded(List<BrowserEntry> selected) {
|
||||||
return automaticallyResolveLinks()
|
return automaticallyResolveLinks()
|
||||||
? selected.stream()
|
? selected.stream()
|
||||||
.map(browserEntry ->
|
.map(browserEntry -> new BrowserEntry(browserEntry.getRawFileEntry().resolved(), browserEntry.getModel()))
|
||||||
new BrowserEntry(browserEntry.getRawFileEntry().resolved(), browserEntry.getModel()))
|
|
||||||
.toList()
|
.toList()
|
||||||
: selected;
|
: selected;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,10 @@ public class AppLayoutModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void reset() {
|
public static void reset() {
|
||||||
|
if (INSTANCE == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
AppCache.update("layoutState", INSTANCE.savedState);
|
AppCache.update("layoutState", INSTANCE.savedState);
|
||||||
INSTANCE = null;
|
INSTANCE = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,9 @@ public class LauncherCommand implements Callable<Integer> {
|
||||||
cmd.parseArgs(args);
|
cmd.parseArgs(args);
|
||||||
cmd.execute(args);
|
cmd.execute(args);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
var e = ErrorEvent.fromThrowable(t).term().build();
|
// Fix serialization issues with exception class
|
||||||
|
var converted = t instanceof CommandLine.UnmatchedArgumentException u ? new IllegalArgumentException(u.getMessage()) : t;
|
||||||
|
var e = ErrorEvent.fromThrowable(converted).term().build();
|
||||||
// Print error in case we launched from the command-line
|
// Print error in case we launched from the command-line
|
||||||
new LogErrorHandler().handle(e);
|
new LogErrorHandler().handle(e);
|
||||||
e.handle();
|
e.handle();
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
package io.xpipe.app.storage;
|
|
||||||
|
|
||||||
public class DataNames {
|
|
||||||
|
|
||||||
public static String cleanName(String name) {
|
|
||||||
return name.replaceAll("[\\\\/:*?\"<>|]", "_");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -76,9 +76,8 @@ public class TerminalLauncher {
|
||||||
type.launch(config);
|
type.launch(config);
|
||||||
latch.await();
|
latch.await();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
var modMsg = ex.getMessage() != null && ex.getMessage().contains("Unable to find application named") ? ex.getMessage() + " in installed Applications on this system" : ex;
|
var modMsg = ex.getMessage() != null && ex.getMessage().contains("Unable to find application named") ? ex.getMessage() + " in installed Applications on this system" : ex.getMessage();
|
||||||
throw ErrorEvent.expected(new IOException(
|
throw ErrorEvent.expected(new IOException("Unable to launch terminal " + type.toTranslatedString().getValue() + ": " + modMsg, ex));
|
||||||
"Unable to launch terminal " + type.toTranslatedString().getValue() + ": " + modMsg, ex));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,7 +268,7 @@ public abstract class BaseCompressAction implements BrowserAction, BranchAction
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void create(String fileName, OpenFileSystemModel model, List<BrowserEntry> entries) {
|
protected void create(String fileName, OpenFileSystemModel model, List<BrowserEntry> entries) {
|
||||||
var tar = CommandBuilder.of().add("tar", "-c", "-v").addIf(gz, "-z").add("-f").addFile(fileName);
|
var tar = CommandBuilder.of().add("tar", "-c").addIf(gz, "-z").add("-f").addFile(fileName);
|
||||||
var base = new FilePath(model.getCurrentDirectory().getPath());
|
var base = new FilePath(model.getCurrentDirectory().getPath());
|
||||||
|
|
||||||
if (directory) {
|
if (directory) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class BaseUntarAction implements ApplicationPathAction, LeafAction {
|
||||||
if (toDirectory) {
|
if (toDirectory) {
|
||||||
c.add("-C").addFile(target);
|
c.add("-C").addFile(target);
|
||||||
}
|
}
|
||||||
c.add("-xv").addIf(gz, "-z").add("-f");
|
c.add("-x").addIf(gz, "-z").add("-f");
|
||||||
c.addFile(entry.getRawFileEntry().getPath());
|
c.addFile(entry.getRawFileEntry().getPath());
|
||||||
if (toDirectory) {
|
if (toDirectory) {
|
||||||
model.getFileSystem().mkdirs(target);
|
model.getFileSystem().mkdirs(target);
|
||||||
|
|
Loading…
Reference in a new issue