-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Show file tree in Add torrent dialog when there is single file inside folder #4805
Show file tree in Add torrent dialog when there is single file inside folder #4805
Conversation
Maybe some other modules need to apply the same fix. If so, point me to them. |
Just tested, it works as expected. Thank you. |
This feature already implemented as part of #4784. |
@glassez You are right. But add dialog seems to be buggy at the moment in your implementation. It doesn't show free space on drive and default save path is empty until mode is switched. |
Ok. |
@@ -355,6 +355,13 @@ bool Utils::Fs::sameFileNames(const QString &first, const QString &second) | |||
#endif | |||
} | |||
|
|||
bool Utils::Fs::isFileInFolder(const QString &file_path) |
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.
My fix is just in a few lines
In this case, please spare the world from some more unnecessary lines of code. This function should not be here. Besides, it can be done easier: m_torrentInfo.filePath(0).contains('/')
in addnewtorrentdialog.cpp
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 '/' always a separator in torrent file paths? May it be for example '' in Windows or something like that?
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.
All public class methods returns paths with '/' as separator (unless there is implementation bug).
Rebased and included suggestions. |
@glassez your PR is pretty close to merging. Does it do the same thing as this PR? If yes, I'll close it. |
Almost. This PR will become meaningless after my PR be merged. |
Closing PR because it is useless now |
Torrents containing a single file inside folder were considered as containing just a file and didn't let to rename folder. File tree didn't show because it doesn't make any sense for just a single file without any folders. Now it is fixed:
Previously, extra folder Loco_Roco_2_EUR was created in save path and couldn't be renamed in the dialog, only afterwards.