mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-10-07 07:31:29 +00:00
Don't load file icon svgs
This commit is contained in:
1 parent
e916c44f06
commit
0442e4bb38
2 files changed
+5
-5
No files matched your search
@@ -11,7 +11,7 @@ public class FileIconManager {
|
||||
|
||||
public static synchronized void loadIfNecessary() {
|
||||
if (!loaded) {
|
||||
AppImages.loadDirectory(AppResources.XPIPE_MODULE, "browser_icons");
|
||||
AppImages.loadDirectory(AppResources.XPIPE_MODULE, "browser_icons", true, false);
|
||||
loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ public class AppImages {
|
||||
|
||||
TrackEvent.info("Loading images ...");
|
||||
for (var module : AppExtensionManager.getInstance().getContentModules()) {
|
||||
loadDirectory(module.getName(), "img");
|
||||
loadDirectory(module.getName(), "img", true, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadDirectory(String module, String dir) {
|
||||
public static void loadDirectory(String module, String dir, boolean loadImages, boolean loadSvgs) {
|
||||
AppResources.with(module, dir, basePath -> {
|
||||
if (!Files.exists(basePath)) {
|
||||
return;
|
||||
@@ -48,10 +48,10 @@ public class AppImages {
|
||||
var relativeFileName = FilenameUtils.separatorsToUnix(
|
||||
basePath.relativize(file).toString());
|
||||
try {
|
||||
if (FilenameUtils.getExtension(file.toString()).equals("svg")) {
|
||||
if (FilenameUtils.getExtension(file.toString()).equals("svg") && loadSvgs) {
|
||||
var s = Files.readString(file);
|
||||
svgImages.put(defaultPrefix + relativeFileName, s);
|
||||
} else {
|
||||
} else if (loadImages) {
|
||||
images.put(defaultPrefix + relativeFileName, loadImage(file));
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
|
||||
Reference in new issue
Block a user