diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-09-21 00:05:01 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-09-21 00:05:48 +0200 |
commit | 382e167d646db75860ac21fabae5d3c1a7d4ddb6 (patch) | |
tree | e1105ee037720fa5da447efefc0c14b04051bc55 /gui | |
parent | de2bb0c6f3a184ffb1d2f6a9ebf1b8651958a62c (diff) | |
download | MultiMC-382e167d646db75860ac21fabae5d3c1a7d4ddb6.tar MultiMC-382e167d646db75860ac21fabae5d3c1a7d4ddb6.tar.gz MultiMC-382e167d646db75860ac21fabae5d3c1a7d4ddb6.tar.lz MultiMC-382e167d646db75860ac21fabae5d3c1a7d4ddb6.tar.xz MultiMC-382e167d646db75860ac21fabae5d3c1a7d4ddb6.zip |
Do not choke on large files when showing them in the 'other logs' page.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/pages/OtherLogsPage.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gui/pages/OtherLogsPage.cpp b/gui/pages/OtherLogsPage.cpp index 55c632fd..92028f3b 100644 --- a/gui/pages/OtherLogsPage.cpp +++ b/gui/pages/OtherLogsPage.cpp @@ -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); } } @@ -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())); + } } } |