Skip to content

Commit

Permalink
Do not choke on large files when showing them in the 'other logs' page.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterix committed Sep 20, 2014
1 parent de2bb0c commit 382e167
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions gui/pages/OtherLogsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void OtherLogsPage::populateSelectLogBox()
else
{
const int index = ui->selectLogBox->findText(m_currentFile);
if(index != -1)
if (index != -1)
ui->selectLogBox->setCurrentIndex(index);
}
}
Expand Down Expand Up @@ -103,7 +103,16 @@ void OtherLogsPage::on_btnReload_clicked()
}
else
{
ui->text->setPlainText(QString::fromUtf8(file.readAll()));
if (file.size() < 10000000ll)
{
ui->text->setPlainText(QString::fromUtf8(file.readAll()));
}
else
{
ui->text->setPlainText(
tr("The file (%1) is too big. You may want to open it in a viewer optimized "
"for large files.").arg(file.fileName()));
}
}
}

Expand Down

0 comments on commit 382e167

Please sign in to comment.