-
Notifications
You must be signed in to change notification settings - Fork 347
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
29
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
ulmus-scott
force-pushed
the
filesystem_info
branch
from
February 16, 2022 23:07
7562b6d
to
0d179c8
Compare
6 tasks
ulmus-scott
force-pushed
the
filesystem_info
branch
from
February 22, 2022 07:46
0d179c8
to
dfd95e6
Compare
ulmus-scott
force-pushed
the
filesystem_info
branch
from
May 14, 2022 01:07
7aaae3a
to
fc1b414
Compare
ulmus-scott
force-pushed
the
filesystem_info
branch
from
November 14, 2022 01:26
fc1b414
to
9ea6c10
Compare
ulmus-scott
force-pushed
the
filesystem_info
branch
from
November 30, 2022 01:16
9ea6c10
to
01f1e39
Compare
stuarta
reviewed
Jan 4, 2023
ulmus-scott
force-pushed
the
filesystem_info
branch
from
November 16, 2024 22:08
01f1e39
to
3f7a3dc
Compare
FileSystemInfo::refresh() now uses QStorageInfo. FileSystemInfo::m_grpid is unused but part of the string lists. Most if not all of the commits should be squashed before applying. |
ulmus-scott
force-pushed
the
filesystem_info
branch
from
December 31, 2024 21:28
25bcbdf
to
648f15a
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.
On Windows, QStorageInfo::device() appears to return either DOS device paths or Universal Naming Convention (UNC) paths. A DOS device path can use a UNC path, which could escape the local system. See https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats For Unix-like systems, if the device file resides outside of /dev/, an alternate boolean expression is: device.startsWith("/") && (!device.startsWith("//") || device.startsWith("///")) POSIX states: A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash. https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11 I saw a somewhat similar test for if the storage is local at https://bugreports.qt.io/browse/QTBUG-83321
NB: if all hostnames are empty, which is already an error, the function will incorrectly not generate the totals.
The header guards in mythbackend/filetransfer.h conflicted with those of libmythprotoserver/sockethandler/filetransfer.h.
also remove unused EncoderLink::GetDiskSpace().
ulmus-scott
force-pushed
the
filesystem_info
branch
from
January 29, 2025 18:28
648f15a
to
19830fe
Compare
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