-
Notifications
You must be signed in to change notification settings - Fork 344
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
rewrite FileSystemInfo #485
Open
ulmus-scott
wants to merge
22
commits into
MythTV:master
Choose a base branch
from
ulmus-scott:filesystem_info
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
7562b6d
to
0d179c8
Compare
6 tasks
0d179c8
to
dfd95e6
Compare
7aaae3a
to
fc1b414
Compare
fc1b414
to
9ea6c10
Compare
Also, for FileSystemInfo: combine PopulateDiskSpace() and PopulateFSProp() into refresh() with comment from getDiskSpace(). inline constructors and use compiler default copy assignment and copy constructor. Add a shorter constructor to replace getDiskSpace(). Add doxygen comments. Note: ZMServer::getDiskSpace() has been left as is, since zmserver is standard C++ only. i.e. does not use Qt.
Use for each loop. The removed if statement is misleading, since the first directory could be empty, and if all others are as well, it will be returned even though it is not usable.
I'm not sure what the existing comment was about, since MythTV never increases m_used.
instead of duplicating its code.
add type alias FileSystemInfoList FileServerHandler::QueryFileSystems(): * QDir ignores (or will resolve) redunant separators to the same directory, so removing a trailing "/" is unnecessary. * The comment is from MainServer::BackendQueryDiskSpace() which duplicated the code (or vice versa).
in MainServer::BackendQueryDiskSpace() The only difference with FileSystemInfo::Consolidate() was the use of GetfsID() instead of starting from 0 every time. I'm not sure why it wasn't removed when the class was created in 65e877a. The only change is that the m_fsid may not be the same for the same hostname and path on subsequent calls to BackendQueryDiskSpace(), which would be a wierd thing the rely on especially since this was the only function that did that.
in MainServer::BackendQueryDiskSpace()
QList is a terrible container. It is essentially a vector of pointers. Use QVector instead, which should be the default Qt container.
based on namespace or class.
for getDiskSpace() removal and FileSystemInfo changes.
9ea6c10
to
01f1e39
Compare
stuarta
reviewed
Jan 4, 2023
| @@ -95,6 +95,49 @@ bool FileSystemInfo::FromStringList(QStringList::const_iterator &it, | |||
| return true; | |||
| } | |||
|
|
|||
| bool FileSystemInfo::refresh() | |||
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.
Pretty sure the entire of this can be done with Qt's QStorageInfo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is inspired by #438 , in particular moving the various functions in mythcoreutil.h to more appropriately named files.
Checklist