From 791221e923586bb717396ecf18bd13e57034df99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 27 Jan 2015 22:31:07 +0100 Subject: NOISSUE Refactors and moving of things --- gui/pages/OtherLogsPage.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gui/pages/OtherLogsPage.cpp') diff --git a/gui/pages/OtherLogsPage.cpp b/gui/pages/OtherLogsPage.cpp index f12ff8a3..c9b0aa51 100644 --- a/gui/pages/OtherLogsPage.cpp +++ b/gui/pages/OtherLogsPage.cpp @@ -21,17 +21,17 @@ #include "gui/GuiUtil.h" #include "logic/RecursiveFileSystemWatcher.h" -#include "logic/BaseInstance.h" +#include -OtherLogsPage::OtherLogsPage(BaseInstance *instance, QWidget *parent) - : QWidget(parent), ui(new Ui::OtherLogsPage), m_instance(instance), +OtherLogsPage::OtherLogsPage(QString path, QWidget *parent) + : QWidget(parent), ui(new Ui::OtherLogsPage), m_path(path), m_watcher(new RecursiveFileSystemWatcher(this)) { ui->setupUi(this); ui->tabWidget->tabBar()->hide(); m_watcher->setFileExpression("(.*\\.log(\\.[0-9]*)?$)|(crash-.*\\.txt)"); - m_watcher->setRootDir(QDir::current().absoluteFilePath(m_instance->minecraftRoot())); + m_watcher->setRootDir(QDir::current().absoluteFilePath(m_path)); connect(m_watcher, &RecursiveFileSystemWatcher::filesChanged, this, &OtherLogsPage::populateSelectLogBox); @@ -76,7 +76,7 @@ void OtherLogsPage::on_selectLogBox_currentIndexChanged(const int index) file = ui->selectLogBox->itemText(index); } - if (file.isEmpty() || !QFile::exists(m_instance->minecraftRoot() + "/" + file)) + if (file.isEmpty() || !QFile::exists(PathCombine(m_path, file))) { m_currentFile = QString(); ui->text->clear(); @@ -92,7 +92,7 @@ void OtherLogsPage::on_selectLogBox_currentIndexChanged(const int index) void OtherLogsPage::on_btnReload_clicked() { - QFile file(m_instance->minecraftRoot() + "/" + m_currentFile); + QFile file(PathCombine(m_path, m_currentFile)); if (!file.open(QFile::ReadOnly)) { setControlsEnabled(false); @@ -132,7 +132,7 @@ void OtherLogsPage::on_btnDelete_clicked() { return; } - QFile file(m_instance->minecraftRoot() + "/" + m_currentFile); + QFile file(PathCombine(m_path, m_currentFile)); if (!file.remove()) { QMessageBox::critical(this, tr("Error"), tr("Unable to delete %1: %2") -- cgit v1.2.3