It should return empty string if there is no parent folder.
@ -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);
}
@ -70,7 +70,7 @@ window.qBittorrent.Filesystem = (function() {
const folderName = function(filepath) {
const slashIndex = filepath.lastIndexOf(PathSeparator);
if (slashIndex === -1)
return filepath;
return '';
return filepath.substring(0, slashIndex);
};