mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-06 04:40:37 +00:00
Performance fixes
This commit is contained in:
@@ -88,6 +88,7 @@ public class AppBaseMode extends AppOperationMode {
|
||||
}
|
||||
|
||||
var imagesLoaded = new CountDownLatch(1);
|
||||
var iconsInit = new CountDownLatch(1);
|
||||
var iconsLoaded = new CountDownLatch(1);
|
||||
var browserLoaded = new CountDownLatch(1);
|
||||
var shellLoaded = new CountDownLatch(1);
|
||||
@@ -126,7 +127,7 @@ public class AppBaseMode extends AppOperationMode {
|
||||
AppPrefs.initStorage();
|
||||
storageLoaded.countDown();
|
||||
AppMcpServer.init();
|
||||
iconsLoaded.await();
|
||||
iconsInit.await();
|
||||
StoreViewState.init();
|
||||
AppMainWindow.loadingText("loadingSettings");
|
||||
TrackEvent.info("Connection storage initialization thread completed");
|
||||
@@ -155,7 +156,9 @@ public class AppBaseMode extends AppOperationMode {
|
||||
imagesLoaded.countDown();
|
||||
SystemIconManager.init();
|
||||
syncPrefsLoaded.await();
|
||||
SystemIconManager.initAdditional();
|
||||
var additional = SystemIconManager.initAdditional();
|
||||
iconsInit.countDown();
|
||||
SystemIconManager.loadAdditional(additional);
|
||||
iconsLoaded.countDown();
|
||||
TrackEvent.info("Platform initialization thread completed");
|
||||
},
|
||||
|
||||
@@ -120,7 +120,8 @@ public class SystemIconManager {
|
||||
});
|
||||
}
|
||||
|
||||
public static void initAdditional() {
|
||||
public static List<SystemIconSource> initAdditional() {
|
||||
var l = new ArrayList<SystemIconSource>();
|
||||
for (var source : getEffectiveSources()) {
|
||||
if (!LOADED.containsKey(source)) {
|
||||
var data = SystemIconSourceData.of(source);
|
||||
@@ -129,15 +130,21 @@ public class SystemIconManager {
|
||||
var icon = new SystemIcon(source, systemIconSourceFile.getName());
|
||||
ICONS.add(icon);
|
||||
});
|
||||
|
||||
try {
|
||||
AppImages.loadRasterImages(SystemIconCache.getDirectory(source), "icons/" + source.getId());
|
||||
} catch (Exception e) {
|
||||
ErrorEventFactory.fromThrowable(e).handle();
|
||||
}
|
||||
l.add(source);
|
||||
}
|
||||
}
|
||||
sourceHash = calculateSourceHash();
|
||||
return l;
|
||||
}
|
||||
|
||||
public static void loadAdditional(List<SystemIconSource> additional) {
|
||||
for (var source : additional) {
|
||||
try {
|
||||
AppImages.loadRasterImages(SystemIconCache.getDirectory(source), "icons/" + source.getId());
|
||||
} catch (Exception e) {
|
||||
ErrorEventFactory.fromThrowable(e).handle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void reloadSources() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user