mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
add support for identifying old devices in CableInfoWidget
This commit is contained in:
@@ -151,6 +151,7 @@ void CableInfoWidget::analyzeCableInfo()
|
||||
"Failed to find plist dictionary in response.");
|
||||
return;
|
||||
}
|
||||
m_cableInfo.isOldDevice = !ioreg["ConnectionActive"].valid();
|
||||
m_cableInfo.isConnected = ioreg["ConnectionActive"].getBool();
|
||||
|
||||
// Check if genuine (Apple manufacturer and valid model info)
|
||||
@@ -254,7 +255,8 @@ void CableInfoWidget::updateUI()
|
||||
delete item;
|
||||
}
|
||||
|
||||
if (!m_cableInfo.isConnected) {
|
||||
// old devices don't report ConnectionActive
|
||||
if (!m_cableInfo.isConnected && !m_cableInfo.isOldDevice) {
|
||||
m_loadingWidget->showError(
|
||||
QString("%1 does not seem to be connected to any cable.")
|
||||
.arg(QString::fromStdString(m_device->deviceInfo.productType)));
|
||||
|
||||
@@ -67,6 +67,8 @@ private:
|
||||
QStringList supportedTransports;
|
||||
QStringList activeTransports;
|
||||
bool isFakeInfo = false;
|
||||
bool isOldDevice =
|
||||
false; // devices that don't report ConnectionActive are likely old
|
||||
};
|
||||
|
||||
// UI components
|
||||
|
||||
Reference in New Issue
Block a user