-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat: Allow filtering based on Store/root type #329
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5a85c06
Filter in UI, but not working yet.
kekonn d540ad9
Merge branch 'master' into feature/filter-root-type
kekonn 0eef017
Set filter to new badge onclick
kekonn 0d5ff35
Merge branch 'mtkennerly:master' into feature/filter-root-type
kekonn 5feea5c
Merge branch 'mtkennerly:master' into feature/filter-root-type
kekonn ba1d2e8
Filter in UI, but not working yet.
kekonn f881dcc
Set filter to new badge onclick
kekonn 1da5446
Merge remote-tracking branch 'origin/feature/filter-root-type' into f…
kekonn 88cac8b
Allow filtering based on store type
kekonn 050bffa
fix: Fix failing tests
kekonn 02dc9af
fix: Fix failing tests
kekonn 652998a
fix: fix Failing Windows tests
kekonn 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/tmp | ||
tests/root3/game5/data-symlink | ||
*~ | ||
.idea/ |
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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ use once_cell::sync::Lazy; | |
|
||
use crate::{ | ||
prelude::{AnyError, SKIP}, | ||
resource::manifest::Os, | ||
resource::manifest::{Os, Store}, | ||
}; | ||
|
||
#[cfg(target_os = "windows")] | ||
|
@@ -275,6 +275,38 @@ pub fn resolve(raw: impl Into<String>) -> Result<String, StrictPathError> { | |
Ok(path) | ||
} | ||
|
||
/// Stores metadata related to the path. | ||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)] | ||
pub struct PathMetadata { | ||
is_case_sensitive: bool, | ||
store: Option<Store>, | ||
} | ||
|
||
impl PathMetadata { | ||
pub fn new(is_case_sensitive: bool, store: Option<Store>) -> Self { | ||
PathMetadata { | ||
is_case_sensitive, | ||
store, | ||
} | ||
} | ||
|
||
pub fn is_case_sensitive(&self) -> bool { | ||
self.is_case_sensitive | ||
} | ||
|
||
#[allow(dead_code)] | ||
pub fn store(&self) -> Option<Store> { | ||
self.store | ||
} | ||
} | ||
|
||
impl std::hash::Hash for PathMetadata { | ||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) { | ||
self.is_case_sensitive.hash(state); | ||
self.store.hash(state); | ||
} | ||
} | ||
Comment on lines
+303
to
+308
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. We should be able to |
||
|
||
/// This is a wrapper around paths to make it more obvious when we're | ||
/// converting between different representations. This also handles | ||
/// things like `~`. | ||
|
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.
Instead of having methods for these, we can just make the fields
pub
.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.
is_case_sensitive
is from your code, just to be clear. But I have no issue doing that refactor.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.
Not sure what you mean; this is part of the new
PathMetadata
struct introduced in this PR. Previously, this was just a loose bool infn parse_paths
.