diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index c41b3b6..bcc1dc1 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -6,6 +6,7 @@ import org.cryptomator.linux.autostart.FreedesktopAutoStartService; import org.cryptomator.linux.keychain.KDEWalletKeychainAccess; import org.cryptomator.linux.keychain.SecretServiceKeychainAccess; +import org.cryptomator.linux.quickaccess.DolphinPlaces; import org.cryptomator.linux.quickaccess.NautilusBookmarks; import org.cryptomator.linux.revealpath.DBusSendRevealPathService; import org.cryptomator.linux.tray.AppindicatorTrayMenuController; @@ -22,7 +23,8 @@ provides KeychainAccessProvider with SecretServiceKeychainAccess, KDEWalletKeychainAccess; provides RevealPathService with DBusSendRevealPathService; provides TrayMenuController with AppindicatorTrayMenuController; - provides QuickAccessService with NautilusBookmarks; + provides QuickAccessService with NautilusBookmarks, DolphinPlaces; opens org.cryptomator.linux.tray to org.cryptomator.integrations.api; + opens org.cryptomator.linux.quickaccess to org.cryptomator.integrations.api; } \ No newline at end of file diff --git a/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java b/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java index ca33244..74e268f 100644 --- a/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java +++ b/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java @@ -30,6 +30,7 @@ * Implemenation of the {@link QuickAccessService} for KDE desktop environments using Dolphin file browser. */ @DisplayName("KDE Dolphin Places") +@CheckAvailability @OperatingSystem(OperatingSystem.Value.LINUX) @Priority(90) public class DolphinPlaces implements QuickAccessService { @@ -39,13 +40,13 @@ public class DolphinPlaces implements QuickAccessService { private static final Path TMP_FILE = Path.of(System.getProperty("java.io.tmpdir"), "user-places.xbel.cryptomator.tmp"); private static final Lock MODIFY_LOCK = new ReentrantLock(); private static final String ENTRY_TEMPLATE = """ - + %s - + - + %s diff --git a/src/main/resources/META-INF/services/org.cryptomator.integrations.quickaccess.QuickAccessService b/src/main/resources/META-INF/services/org.cryptomator.integrations.quickaccess.QuickAccessService index cda718b..35c597f 100644 --- a/src/main/resources/META-INF/services/org.cryptomator.integrations.quickaccess.QuickAccessService +++ b/src/main/resources/META-INF/services/org.cryptomator.integrations.quickaccess.QuickAccessService @@ -1 +1,2 @@ -org.cryptomator.linux.quickaccess.NautilusBookmarks \ No newline at end of file +org.cryptomator.linux.quickaccess.NautilusBookmarks +org.cryptomator.linux.quickaccess.DolphinPlaces \ No newline at end of file diff --git a/src/test/java/org/cryptomator/linux/quickaccess/DolphinPlacesIT.java b/src/test/java/org/cryptomator/linux/quickaccess/DolphinPlacesIT.java index 50b325c..99242c6 100644 --- a/src/test/java/org/cryptomator/linux/quickaccess/DolphinPlacesIT.java +++ b/src/test/java/org/cryptomator/linux/quickaccess/DolphinPlacesIT.java @@ -1,6 +1,9 @@ package org.cryptomator.linux.quickaccess; +import org.cryptomator.integrations.common.IntegrationsLoader; +import org.cryptomator.integrations.quickaccess.QuickAccessService; import org.cryptomator.integrations.quickaccess.QuickAccessServiceException; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -11,6 +14,16 @@ public class DolphinPlacesIT { + @Test + @DisplayName("If dolphin is installed, isSupported returns true and service is contained in the service provider stream") + @Disabled + public void testSupport() { + Assertions.assertTrue(DolphinPlaces.isSupported()); + + var optionalService = IntegrationsLoader.loadAll(QuickAccessService.class).filter(s -> s.getClass().getName().equals("org.cryptomator.linux.quickaccess.DolphinPlaces")).findAny(); + Assertions.assertTrue(optionalService.isPresent()); + } + @Test @DisplayName("Adds for 20s an entry to the Dolphin sidebar") @Disabled diff --git a/src/test/java/org/cryptomator/linux/quickaccess/NautilusBookmarksIT.java b/src/test/java/org/cryptomator/linux/quickaccess/NautilusBookmarksIT.java index 10e4654..9bb00dc 100644 --- a/src/test/java/org/cryptomator/linux/quickaccess/NautilusBookmarksIT.java +++ b/src/test/java/org/cryptomator/linux/quickaccess/NautilusBookmarksIT.java @@ -1,6 +1,9 @@ package org.cryptomator.linux.quickaccess; +import org.cryptomator.integrations.common.IntegrationsLoader; +import org.cryptomator.integrations.quickaccess.QuickAccessService; import org.cryptomator.integrations.quickaccess.QuickAccessServiceException; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -11,6 +14,16 @@ public class NautilusBookmarksIT { + @Test + @DisplayName("If nautilus is installed, isSupported returns true and service is contained in the service provider stream") + @Disabled + public void testSupport() { + Assertions.assertTrue(NautilusBookmarks.isSupported()); + + var optionalService = IntegrationsLoader.loadAll(QuickAccessService.class).filter(s -> s.getClass().getName().equals("org.cryptomator.linux.quickaccess.NautilusBookmarks")).findAny(); + Assertions.assertTrue(optionalService.isPresent()); + } + @Test @DisplayName("Adds for 20s an entryto the Nautilus sidebar") @Disabled