-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
playlist export: update with newly selected extension, don't just append #11332
Conversation
Actually, it feels like we're now pretty close to reimplementing QFileDialog::getSaveFileName and would "just" need to hook up to the filterSelected signal to get good UX inside the dialog (= immediately replace/append the selected extension) ... |
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.
Even though I cannot confirm the issue, I don't see a regression form this PR.
As a test I have called a "playlist.pls" and the proposed export name was "playlist.pls.m3u"
I think this is the expected behavior.
There is another pending issue, that there is no proposed extension in the crate case and the crate export is actually not working.
src/util/file.cpp
Outdated
const QRegularExpression kExtractExtensionRegex(R"(\(\*\.(.*)\)$)"); | ||
// lazy match doesn't work here "(\(\*\.(.*?)\))" | ||
const QRegExp kFileFilterRegex(R"(\(\*\.(.[^\)]*)\))"); |
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.
The difference between the kExtractExtensionRegex and kFileFilterRegex is not easy to discover.
Can you add an example string, that should be matched?
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.
Sure, will do.
The crate export as Playlist works on the 2.3 branch. The extension is added silently. The export is broken in the 2.4 branch. |
If you name a file |
This is still ready to go. |
It still works without a regression on Ubuntu Focal 20.4 |
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.
Thank you. LGTM
Fixes #11327
Quick fix, adds include QRegExp so we can use
QRegExp::indexIn
.I bet there are a million other ways do achieve the same, so feel free to optimize this.