-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Implementation of Quick Access API for GNOME Nautilus #77
Conversation
* reset version * use beta1 of integrations-api
WalkthroughThe updates focus on version upgrades in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- pom.xml (1 hunks)
- src/main/java/module-info.java (2 hunks)
- src/main/java/org/cryptomator/linux/quickaccess/NautilusBookmarks.java (1 hunks)
- src/main/resources/META-INF/services/org.cryptomator.integrations.quickaccess.QuickAccessService (1 hunks)
- src/test/java/org/cryptomator/linux/quickaccess/NautilusBookmarksIT.java (1 hunks)
Files skipped from review due to trivial changes (1)
- pom.xml
Additional comments not posted (5)
src/main/resources/META-INF/services/org.cryptomator.integrations.quickaccess.QuickAccessService (1)
1-1
: Correct service provider configuration.The file correctly specifies
NautilusSidebarService
as the implementation ofQuickAccessService
. This is essential for the Java ServiceLoader to properly locate and load the service implementation.src/test/java/org/cryptomator/linux/quickaccess/NautilusBookmarksIT.java (2)
15-15
: Correct typo in test description.The
@DisplayName
annotation contains a typo: "entryto" should be "entry to".- @DisplayName("Adds for 20s an entryto the Nautilus sidebar") + @DisplayName("Adds for 20s an entry to the Nautilus sidebar")
16-16
: Clarify reason for disabling the test.The test is marked as disabled. It would be helpful to include a comment explaining why it is disabled to aid other developers.
- @Disabled + @Disabled("Reason for disabling the test")src/main/java/module-info.java (1)
22-22
: Correct declaration of service provision.The module correctly declares
NautilusBookmarks
as a provider forQuickAccessService
. This ensures proper integration and visibility within the module system.src/main/java/org/cryptomator/linux/quickaccess/NautilusBookmarks.java (1)
22-93
: Review ofNautilusBookmarks
class.
Concurrency and File Handling:
- The use of locks (
BOOKMARKS_LOCK
) to manage concurrent access is appropriate.- File size checks before modifications help prevent errors due to file system limits.
Method Implementations:
- The
add
andremove
methods are well-implemented with proper exception handling and file operations.- The
isSupported
method's use of a process to check for Nautilus installation is a good approach, though error handling could be improved by logging or handling the exceptions rather than ignoring them.Potential Improvements:
- Consider logging errors in the
isSupported
method to aid in debugging.- Ensure that the
QuickAccessEntry
interface methods are adequately documented to explain their functionality and usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- pom.xml (1 hunks)
- src/main/java/org/cryptomator/linux/quickaccess/NautilusBookmarks.java (1 hunks)
Files skipped from review due to trivial changes (1)
- pom.xml
Additional comments not posted (3)
src/main/java/org/cryptomator/linux/quickaccess/NautilusBookmarks.java (3)
20-23
: Annotations look good!The annotations for priority, availability check, operating system specification, and display name are well-placed and appropriate.
26-29
: Constants are well-defined.The constants for maximum file size, bookmarks file path, temporary file path, and bookmarks lock are well-defined and appropriately named.
52-82
: Inner class implementation looks good!The inner class
NautilusQuickAccessEntry
correctly implements theQuickAccessEntry
interface and handles removal of entries with proper locking and exception handling.
This PR adds an implementation of the Quick Access API for GNOME Nautilus.
This implementation defines the quick access area as Nautilus bookmark section. The section allows a custom label for the bookmark.

To add a bookmark, a line to the file
~/.config/gtk-3.0/bookmarks
is added. The bookmark is removed by removing the aforementioned line again. To ensure data consistency, the file is never edited directly. Instead a copy is made and then with an atomic_move the original file overriden. Additionally, only one thread at a time can either add or remove a bookmark.