Various small fixes

This commit is contained in:
crschnick 2024-10-06 23:38:50 +00:00
parent b7b3acf168
commit 99d867965b
7 changed files with 12 additions and 16 deletions

View file

@ -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;
} }

View file

@ -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;
} }

View file

@ -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();

View file

@ -1,8 +0,0 @@
package io.xpipe.app.storage;
public class DataNames {
public static String cleanName(String name) {
return name.replaceAll("[\\\\/:*?\"<>|]", "_");
}
}

View file

@ -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));
} }
} }
} }

View file

@ -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) {

View file

@ -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);