From febf3645d042dd7a5bf488d091286a3efd46a727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 21 Aug 2014 00:23:20 +0200 Subject: [PATCH] Fix version file problems, fix console window not being destroyed --- gui/ConsoleWindow.cpp | 5 +++++ gui/ConsoleWindow.h | 2 +- logic/minecraft/MinecraftVersion.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp index 467008b6d..01c1514a8 100644 --- a/gui/ConsoleWindow.cpp +++ b/gui/ConsoleWindow.cpp @@ -55,6 +55,7 @@ ConsoleWindow::ConsoleWindow(MinecraftProcess *mcproc, QWidget *parent) : QMainWindow(parent), m_proc(mcproc) { MultiMCPlatform::fixWM_CLASS(this); + setAttribute(Qt::WA_DeleteOnClose); auto instance = m_proc->instance(); auto icon = MMC->icons()->getIcon(instance->iconKey()); @@ -263,3 +264,7 @@ void ConsoleWindow::onLaunchFailed(InstancePtr instance) if (!isVisible()) show(); } +ConsoleWindow::~ConsoleWindow() +{ + +} diff --git a/gui/ConsoleWindow.h b/gui/ConsoleWindow.h index 97600baa3..1b086f1ae 100644 --- a/gui/ConsoleWindow.h +++ b/gui/ConsoleWindow.h @@ -27,7 +27,7 @@ class ConsoleWindow : public QMainWindow public: explicit ConsoleWindow(MinecraftProcess *proc, QWidget *parent = 0); - virtual ~ConsoleWindow() {}; + virtual ~ConsoleWindow(); /** * @brief specify if the window is allowed to close diff --git a/logic/minecraft/MinecraftVersion.cpp b/logic/minecraft/MinecraftVersion.cpp index 939c1149e..bd53997b8 100644 --- a/logic/minecraft/MinecraftVersion.cpp +++ b/logic/minecraft/MinecraftVersion.cpp @@ -147,7 +147,7 @@ QString MinecraftVersion::getPatchFilename() bool MinecraftVersion::needsUpdate() { auto settings = MMC->settings(); - bool result = hasUpdate() && settings->get("AutoUpdateMinecraftVersions").toBool(); + bool result = m_versionSource == Remote || (hasUpdate() && settings->get("AutoUpdateMinecraftVersions").toBool()); return result; }