mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Merge pull request #2268 from pmzqla/file-ext
Ignore .!qB when extracting file extensions
This commit is contained in:
commit
7e16094ac6
1 changed files with 3 additions and 2 deletions
|
@ -89,8 +89,9 @@ QString fsutils::fromNativePath(const QString &path) {
|
||||||
* Returns the file extension part of a file name.
|
* Returns the file extension part of a file name.
|
||||||
*/
|
*/
|
||||||
QString fsutils::fileExtension(const QString &filename) {
|
QString fsutils::fileExtension(const QString &filename) {
|
||||||
const int point_index = filename.lastIndexOf(".");
|
QString ext = QString(filename).remove(".!qB");
|
||||||
return (point_index >= 0) ? filename.mid(point_index + 1) : QString();
|
const int point_index = ext.lastIndexOf(".");
|
||||||
|
return (point_index >= 0) ? ext.mid(point_index + 1) : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString fsutils::fileName(const QString& file_path) {
|
QString fsutils::fileName(const QString& file_path) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue