mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Fix folder name extraction functions
It should return empty string if there is no parent folder.
This commit is contained in:
@@ -95,7 +95,7 @@ QString Utils::Fs::folderName(const QString &filePath)
|
||||
const QString path = toUniformPath(filePath);
|
||||
const int slashIndex = path.lastIndexOf('/');
|
||||
if (slashIndex == -1)
|
||||
return path;
|
||||
return {};
|
||||
return path.left(slashIndex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user