diff options
Diffstat (limited to 'gui/pages/OtherLogsPage.cpp')
-rw-r--r-- | gui/pages/OtherLogsPage.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/gui/pages/OtherLogsPage.cpp b/gui/pages/OtherLogsPage.cpp index f20b9fef..555075e3 100644 --- a/gui/pages/OtherLogsPage.cpp +++ b/gui/pages/OtherLogsPage.cpp @@ -29,7 +29,7 @@ OtherLogsPage::OtherLogsPage(BaseInstance *instance, QWidget *parent) { ui->setupUi(this); - m_watcher->setFileExpression(".*\\.log$"); + m_watcher->setFileExpression("(.*\\.log(\\.[0-9]*)?$)|(crash-.*\\.txt)"); m_watcher->setRootDir(QDir::current().absoluteFilePath(m_instance->minecraftRoot())); connect(m_watcher, &RecursiveFileSystemWatcher::filesChanged, this, @@ -55,7 +55,6 @@ void OtherLogsPage::populateSelectLogBox() { ui->selectLogBox->clear(); ui->selectLogBox->addItems(m_watcher->files()); - ui->selectLogBox->addItem(tr("Other"), true); if (m_currentFile.isNull()) { ui->selectLogBox->setCurrentIndex(-1); @@ -63,7 +62,8 @@ void OtherLogsPage::populateSelectLogBox() else { const int index = ui->selectLogBox->findText(m_currentFile); - ui->selectLogBox->setCurrentIndex(index); + if(index != -1) + ui->selectLogBox->setCurrentIndex(index); } } @@ -72,15 +72,7 @@ void OtherLogsPage::on_selectLogBox_currentIndexChanged(const int index) QString file; if (index != -1) { - if (ui->selectLogBox->itemData(index).isValid()) - { - file = QFileDialog::getOpenFileName( - this, tr("Open log file"), m_instance->minecraftRoot(), tr("*.log;;*.txt;;*")); - } - else - { - file = ui->selectLogBox->itemText(index); - } + file = ui->selectLogBox->itemText(index); } if (file.isEmpty() || !QFile::exists(m_instance->minecraftRoot() + "/" + file)) |