-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Code Quality: Refactored the code for Quick Access #16485
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
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2ebb917
Init
0x5bfa 35d445d
Update
0x5bfa ecdbcf4
Kinda broken, I kinda think I kinda have to kinda use kinda IProperty…
0x5bfa 841d07e
Update
0x5bfa 2429d4c
Merge branch 'main' into 5bfa/CQ-QuickAccessRefactor
0x5bfa 715768a
Update WindowsQuickAccessService.cs
0x5bfa 947cbce
Use real IsPinned
0x5bfa 77fdb7d
Merge branch 'main' into 5bfa/CQ-QuickAccessRefactor
0x5bfa ba61c81
Cleanup
yaira2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,24 @@ | ||
// Copyright (c) 2024 Files Community | ||
// Licensed under the MIT License. See the LICENSE. | ||
|
||
using System.Collections.Specialized; | ||
|
||
namespace Files.App.Data.Contracts | ||
{ | ||
public interface IQuickAccessService | ||
{ | ||
/// <summary> | ||
/// Gets the list of quick access items | ||
/// </summary> | ||
/// <returns></returns> | ||
Task<IEnumerable<ShellFileItem>> GetPinnedFoldersAsync(); | ||
|
||
/// <summary> | ||
/// Pins a folder to the quick access list | ||
/// </summary> | ||
/// <param name="folderPath">The folder to pin</param> | ||
/// <returns></returns> | ||
Task PinToSidebarAsync(string folderPath); | ||
|
||
/// <summary> | ||
/// Pins folders to the quick access list | ||
/// </summary> | ||
/// <param name="folderPaths">The array of folders to pin</param> | ||
/// <returns></returns> | ||
Task PinToSidebarAsync(string[] folderPaths); | ||
|
||
/// <summary> | ||
/// Unpins a folder from the quick access list | ||
/// </summary> | ||
/// <param name="folderPath">The folder to unpin</param> | ||
/// <returns></returns> | ||
Task UnpinFromSidebarAsync(string folderPath); | ||
|
||
/// <summary> | ||
/// Unpins folders from the quick access list | ||
/// </summary> | ||
/// <param name="folderPaths">The array of folders to unpin</param> | ||
/// <returns></returns> | ||
Task UnpinFromSidebarAsync(string[] folderPaths); | ||
|
||
/// <summary> | ||
/// Checks if a folder is pinned to the quick access list | ||
/// </summary> | ||
/// <param name="folderPath">The path of the folder</param> | ||
/// <returns>true if the item is pinned</returns> | ||
bool IsItemPinned(string folderPath); | ||
|
||
/// <summary> | ||
/// Saves a state of pinned folder items in the sidebar | ||
/// </summary> | ||
/// <param name="items">The array of items to save</param> | ||
/// <returns></returns> | ||
Task SaveAsync(string[] items); | ||
IReadOnlyList<INavigationControlItem> Folders { get; } | ||
|
||
event EventHandler<NotifyCollectionChangedEventArgs>? PinnedFoldersChanged; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this event limited to pinned folders, or does it also notify when recent folders are added to the list? |
||
|
||
Task InitializeAsync(); | ||
|
||
Task<bool> UpdatePinnedFoldersAsync(); | ||
|
||
bool IsPinned(string path); | ||
|
||
Task<bool> PinFolderAsync(string[] paths); | ||
|
||
Task<bool> UnpinFolderAsync(string[] paths); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please add comments