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

warn on can't read file, fixes #860

This commit is contained in:
dubslow 2014-11-27 12:42:04 -05:00 committed by Dubslow
parent 79dd992d81
commit bc381a8459
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA

View File

@ -141,7 +141,10 @@ void ChatForm::onAttachClicked()
{ {
QFile file(path); QFile file(path);
if (!file.exists() || !file.open(QIODevice::ReadOnly)) if (!file.exists() || !file.open(QIODevice::ReadOnly))
{
QMessageBox::warning(this, tr("File not read"), tr("qTox wasn't able to open %1").arg(QFileInfo(path).fileName()));
continue; continue;
}
if (file.isSequential()) if (file.isSequential())
{ {
QMessageBox::critical(0, tr("Bad Idea"), tr("You're trying to send a special (sequential) file, that's not going to work!")); QMessageBox::critical(0, tr("Bad Idea"), tr("You're trying to send a special (sequential) file, that's not going to work!"));