1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

FileTransferWidget: limit browse to pics and archives

This commit is contained in:
krepa098 2015-01-06 13:58:42 +01:00
parent 9793ebd094
commit e365b0eb2d

View File

@ -189,9 +189,14 @@ void FileTransferWidget::onFileTransferFinished(ToxFile file)
setupButtons();
hideWidgets();
ui->bottomButton->show();
ui->bottomButton->setIcon(QIcon(":/ui/fileTransferInstance/browse_path.png"));
ui->bottomButton->setObjectName("browse");
static const QStringList openExtensions = { "png", "jpeg", "jpg", "gif", "zip", "rar" };
if(openExtensions.contains(QFileInfo(file.fileName).suffix()))
{
ui->bottomButton->setIcon(QIcon(":/ui/fileTransferInstance/browse_path.png"));
ui->bottomButton->setObjectName("browse");
ui->bottomButton->show();
}
// preview
if(fileInfo.direction == ToxFile::RECEIVING)