From 75fbf192c447be4f8db2fa93cf08a31eb443f429 Mon Sep 17 00:00:00 2001 From: agilob Date: Sun, 10 May 2015 11:46:22 +0100 Subject: [PATCH] closes tux3/qtox#1561 --- src/chatlog/content/filetransferwidget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chatlog/content/filetransferwidget.cpp b/src/chatlog/content/filetransferwidget.cpp index d941ae13e..c64b5845a 100644 --- a/src/chatlog/content/filetransferwidget.cpp +++ b/src/chatlog/content/filetransferwidget.cpp @@ -121,7 +121,7 @@ void FileTransferWidget::autoAcceptTransfer(const QString &path) if (Nexus::tryRemoveFile(filepath)) Core::getInstance()->acceptFileRecvRequest(fileInfo.friendId, fileInfo.fileNum, filepath); else - qDebug() << "Warning: Cannot write to " << filepath; + qWarning() << "Warning: Cannot write to " << filepath; } void FileTransferWidget::acceptTransfer(const QString &filepath) @@ -488,15 +488,16 @@ void FileTransferWidget::handleButton(QPushButton *btn) void FileTransferWidget::showPreview(const QString &filename) { - static const QStringList previewExtensions = { "png", "jpeg", "jpg", "gif" }; + static const QStringList previewExtensions = { "png", "jpeg", "jpg", "gif", "PNG", "JPEG", "JPG", "GIF" }; if (previewExtensions.contains(QFileInfo(filename).suffix())) { const int size = qMax(ui->previewLabel->width(), ui->previewLabel->height()); + QPixmap pmap = QPixmap(filename).scaled(QSize(size, size), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); ui->previewLabel->setPixmap(pmap); ui->previewLabel->show(); - + ui->previewLabel->setCursor(Qt::PointingHandCursor); // Show mouseover preview, but make sure it's not larger than 50% of the screen width/height QRect desktopSize = QApplication::desktop()->screenGeometry(); QImage image = QImage(filename).scaled(0.5*desktopSize.width(), 0.5*desktopSize.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);