mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Fix images with spaces or other non-HTML characters breaking the preview
This commit is contained in:
parent
75a0e8ac2e
commit
3c602ec0d6
|
@ -461,11 +461,11 @@ void FileTransferWidget::showPreview(const QString &filename)
|
|||
if (imageSize.width() > maxSize.width() || imageSize.height() > maxSize.height())
|
||||
{
|
||||
imageSize.scale(maxSize.width(), maxSize.height(), Qt::KeepAspectRatio);
|
||||
ui->previewLabel->setToolTip("<html><img src="+filename+" width="+QString::number(imageSize.width())+" height="+QString::number(imageSize.height())+"/></html>");
|
||||
ui->previewLabel->setToolTip("<html><img src="+QUrl::toPercentEncoding(filename)+" width="+QString::number(imageSize.width())+" height="+QString::number(imageSize.height())+"/></html>");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->previewLabel->setToolTip("<html><img src"+filename+"/></html>");
|
||||
ui->previewLabel->setToolTip("<html><img src"+QUrl::toPercentEncoding(filename)+"/></html>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user