Skip to content

Commit

Permalink
Actually test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alanocallaghan committed Oct 16, 2023
1 parent 6f45da1 commit f84c688
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/qupath/ext/wsinfer/ui/WSInferPrefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import javafx.beans.property.Property;
import javafx.beans.property.StringProperty;
import qupath.lib.gui.prefs.PathPrefs;
import qupath.lib.gui.UserDirectoryManager;

import java.io.File;
import java.nio.file.Paths;
import java.nio.file.Path;

/**
* Class to store preferences associated with WSInfer.
Expand All @@ -30,7 +32,7 @@ public class WSInferPrefs {

private static final StringProperty modelDirectoryProperty = PathPrefs.createPersistentPreference(
"wsinfer.model.dir",
Paths.get(getUserDir(),"wsinfer").toString()
Paths.get(getUserDir().toString(),"wsinfer").toString()
);

private static final StringProperty deviceProperty = PathPrefs.createPersistentPreference(
Expand Down Expand Up @@ -64,9 +66,9 @@ public static Property<Integer> numWorkersProperty() {
return numWorkersProperty;
}

private static String getUserDir() {
String userPath = UserDirectoryManager.getInstance().getUserPath();
private static Path getUserDir() {
Path userPath = UserDirectoryManager.getInstance().getUserPath();
Path cachePath = Paths.get(System.getProperty("user.dir"), ".cache", "QuPath");
return userPath == null || userPath.isEmpty() ? cachePath : userPath.toString();
return userPath == null || userPath.toString().isEmpty() ? cachePath : userPath;
}
}

0 comments on commit f84c688

Please sign in to comment.