From 666b399974f2bf7c7cea5c1132854cc5f476a99c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 12 Jun 2019 12:54:54 +0200 Subject: Gray out all VBox VMs if no VTx is available --- src/vsession.cpp | 8 ++++---- src/vsession.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vsession.cpp b/src/vsession.cpp index fec9fad..92cc9c4 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -254,7 +254,7 @@ bool VSession::run() const { qDebug() << "Sarting session " << this->getAttribute("short_description", "param") << " ..."; } - if (g_noVtx && is64Bit()) { + if (g_noVtx && needsVtx()) { QMessageBox::warning(nullptr, QObject::trUtf8("Warning"), QObject::trUtf8("The selected session is based on a 64 bit operating system," " but this computer doesn't seem to support this (VT-x/AMD-V not" @@ -364,15 +364,15 @@ QList VSession::readXmlFile(const QString& filepath) { return sessionList; } -bool VSession::is64Bit() const { +bool VSession::needsVtx() const { ImgType type = imgtype(); return (type == VMWARE && getAttribute("os").endsWith("-64")) - || (type == VBOX && getAttribute("os").endsWith("_64")); + || (type == VBOX /* && getAttribute("os").endsWith("_64") */); // Vbox 6.x doesn't seem to support 32bit VMs without VTx any more... // TODO: qemu-kvm, ... } QVariant VSession::foregroundRole() const { - if (!g_noVtx || !is64Bit()) + if (!g_noVtx || !needsVtx()) return Session::foregroundRole(); return QColor(180, 180, 180); } diff --git a/src/vsession.h b/src/vsession.h index 18d5c38..6c48ce4 100644 --- a/src/vsession.h +++ b/src/vsession.h @@ -65,7 +65,7 @@ class VSession : public Session { return SECTION_GENERIC; } - bool is64Bit() const; + bool needsVtx() const; QVariant foregroundRole() const; QString getAttribute(const QString& nodeName, -- cgit v1.2.3-55-g7522