-
Notifications
You must be signed in to change notification settings - Fork 815
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
[stable-3.2] Temporary! Windows. VFS. Block Virtual Files for partition root sync folders. #3359
Merged
Merged
Changes from all commits
Commits
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
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.
why are you doing a hand made implementation of that instead of using Qt API ?
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.
@mgallien
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.
That was specific to the case of VFS, implicit hydration of a file linked by a .lnk file and the current behavior of QFileInfo that consider that
.lnk
are not real file and jump to the linked file.So we had this scenario:
.lnk
fileIn the case of Windows drives, we will have nothing of that. We are safe.
Yes but we add a few more branches in the code adding complexity that we will have to maintain by ourselves. Including some code that is specific to one platform and cannot really be tested when testing other platforms.
I am talking about that QDir::drives(). Did you try to use it ?
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.
@mgallien that's exactly what I've tried. The problem with that method is, it always returns "C" even if I am calling it for a directory that is in "D". How can you explain such behavior? Maybe the documentation is not clear?
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.
@mgallien This method returns all drive letters available in the system. What I need instead is, to check if the path I choose is any drive letter without a subfolder. Let's say I choose "d:/subfolder" - then it is not a drive letter (not a drive partition root). Now, if I choose just "d:/" or "d:", or "d:" - then - it is a drive letter (or a drive partition root). More detailed explanation and a screenshot below:
So, let's say, I choose "d:" as my sync root. This is perfectly fine, and, this will work. However, this does not compare exactly with ["C:/", "D:/"], I'd still have to compare if any of ["C:/, "D:/"] starts with my "d:". Then, I could also choose "d:\" as my local sync dir (which is perfectly fine under Windows as it is using a backslash instead of slash by default). In that case, I am having even more problems, I still have to convert backslash to a slash before comparing it against ["C:/", "D:/"].
Now, I am not interested in checking whether the partition I choose is a valid partition on the current system. For example, I don't want to check if "b:/" is incorrect by trying to find it in ["C:/", "D:/"].
Last but not least, imagine, a system has many partitions ["C:/", "D:/", "E:/", "F:/", G:/", ...]
if using this API and a method and looping through a list of partitions trying to find if any of those equal to my sync folder that I choose to be say "S:/", I will have to loop every time, through entire list of partitions.
My goal is to just compare if my path equals to a pattern "AlphaBeticCharacter" + ":" + "slash or backslash or no slash at all".
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.
@mgallien yes, I've now noticed, dir() is a static method. Then again, there is no way to "just check if a path is a drive partition root" via Qt API. This method does not provide me this information. I still have to compare strings.