From: Flavio Date: Fri, 18 Mar 2011 21:04:22 +0000 (+0100) Subject: Check for more invalid characters in download filename X-Git-Tag: 1.4.2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=48bd5300f9ddf7ccc25465dea17e1dd0a91beff6;p=minitube Check for more invalid characters in download filename --- diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 36ede9b..5363d1e 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -96,11 +96,20 @@ void DownloadManager::gotStreamUrl(QUrl url) { QString path = currentDownloadFolder(); // TODO ensure all chars are filename compatible - QString basename = video->title().simplified(); + QString basename = video->title(); basename.replace('(', '['); basename.replace(')', ']'); - basename.replace('/', '-'); - basename.replace('\\', '-'); + basename.replace('/', ' '); + basename.replace('\\', ' '); + basename.replace('<', ' '); + basename.replace('>', ' '); + basename.replace(':', ' '); + basename.replace('"', ' '); + basename.replace('|', ' '); + basename.replace('?', ' '); + basename.replace('*', ' '); + basename = basename.simplified(); + QString filename = path + "/" + basename + ".mp4"; Video *videoCopy = video->clone();