diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml index 17211949..8043c7d2 100644 --- a/src/OptionsPopup.qml +++ b/src/OptionsPopup.qml @@ -637,7 +637,7 @@ Window { } } - if (imageWriter.andCapabilities("usb_otg")) { + if (imageWriter.checkHWAndSWCapability("usb_otg")) { deviceUsbOtgSupport = true } else { deviceUsbOtgSupport = false diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp index 73c65c04..3dfdecb7 100644 --- a/src/imagewriter.cpp +++ b/src/imagewriter.cpp @@ -502,8 +502,8 @@ bool ImageWriter::getHWFilterListInclusive() { return _deviceFilterIsInclusive; } -bool ImageWriter::andCapabilities(const QString &cap) { - return this->checkHWCapability(cap) && this->checkSWCapability(cap); +bool ImageWriter::checkHWAndSWCapability(const QString &cap, const QString &differentSWCap) { + return this->checkHWCapability(cap) && this->checkSWCapability(differentSWCap.isEmpty() ? cap : differentSWCap); } bool ImageWriter::checkHWCapability(const QString &cap) { diff --git a/src/imagewriter.h b/src/imagewriter.h index a31bdb41..0b05bf31 100644 --- a/src/imagewriter.h +++ b/src/imagewriter.h @@ -102,8 +102,8 @@ class ImageWriter : public QObject /* Get if the HW filter is in inclusive mode */ Q_INVOKABLE bool getHWFilterListInclusive(); - /* Get if both hard and software support a certain feature */ - Q_INVOKABLE bool andCapabilities(const QString &cap); + /* Get if both hard and software support a certain feature. If no differentSWCap is provided it will check for cap support in SW and HW lists. */ + Q_INVOKABLE bool checkHWAndSWCapability(const QString &cap, const QString &differentSWCap = ""); /* Check if the hardware supports a certain feature. */ Q_INVOKABLE bool checkHWCapability(const QString &cap);