summaryrefslogtreecommitdiff
path: root/src/previewimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/previewimage.cpp')
-rw-r--r--src/previewimage.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/previewimage.cpp b/src/previewimage.cpp
index 9cd1fdaa..af6e4361 100644
--- a/src/previewimage.cpp
+++ b/src/previewimage.cpp
@@ -90,5 +90,14 @@ void PreviewImage::mousePressEvent(QMouseEvent *event)
QString PreviewImage::guessNameFromUrl(QString url)
{
- return QUrl(url).toString( QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::StripTrailingSlash );
+ QString name = QUrl(url).toString( QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::StripTrailingSlash );
+
+ // TODO learn Regular Expressions :)
+ name.remove('/');
+ name.remove('&');
+ name.remove('.');
+ name.remove('-');
+ name.remove('_');
+
+ return name;
}