diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2024-05-08 13:51:06 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2024-05-10 16:07:01 +0000 |
commit | 6fea65f029ee8bbdcb0162b8c5ee31e65fa5dbfe (patch) | |
tree | 24b98a3fc2e2558b2eee2294b4dacaec24b3b92e | |
parent | be222eaff4da289bc83c0e8f177b0ed8a7420719 (diff) |
Android: Support "android-desktop" device definitions in AvdDialog
Change-Id: Iec80fe8b46302adeb1308d41da77e0a489c9c95e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r-- | src/plugins/android/avddialog.cpp | 26 | ||||
-rw-r--r-- | src/plugins/android/avddialog.h | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/src/plugins/android/avddialog.cpp b/src/plugins/android/avddialog.cpp index e2d06eac61..8239a181af 100644 --- a/src/plugins/android/avddialog.cpp +++ b/src/plugins/android/avddialog.cpp @@ -111,6 +111,7 @@ AvdDialog::AvdDialog(QWidget *parent) m_deviceTypeToStringMap.insert(AvdDialog::Automotive, "Automotive"); m_deviceTypeToStringMap.insert(AvdDialog::TV, "TV"); m_deviceTypeToStringMap.insert(AvdDialog::Wear, "Wear"); + m_deviceTypeToStringMap.insert(AvdDialog::Desktop, "Desktop"); parseDeviceDefinitionsList(); for (const QString &type : m_deviceTypeToStringMap) @@ -211,6 +212,8 @@ AvdDialog::DeviceType AvdDialog::tagToDeviceType(const QString &type_tag) return AvdDialog::TV; else if (type_tag.contains("android-automotive")) return AvdDialog::Automotive; + else if (type_tag.contains("android-desktop")) + return AvdDialog::Desktop; else return AvdDialog::PhoneOrTablet; } @@ -225,6 +228,29 @@ void AvdDialog::parseDeviceDefinitionsList() return; } + /* Example output: +Available devices definitions: +id: 0 or "automotive_1024p_landscape" + Name: Automotive (1024p landscape) + OEM : Google + Tag : android-automotive-playstore +--------- +id: 1 or "automotive_1080p_landscape" + Name: Automotive (1080p landscape) + OEM : Google + Tag : android-automotive +--------- +id: 2 or "Galaxy Nexus" + Name: Galaxy Nexus + OEM : Google +--------- +id: 3 or "desktop_large" + Name: Large Desktop + OEM : Google + Tag : android-desktop +... + */ + QStringList avdDeviceInfo; const auto lines = output.split('\n'); diff --git a/src/plugins/android/avddialog.h b/src/plugins/android/avddialog.h index 33247807d9..bdcddc5243 100644 --- a/src/plugins/android/avddialog.h +++ b/src/plugins/android/avddialog.h @@ -33,7 +33,7 @@ public: explicit AvdDialog(QWidget *parent = nullptr); int exec() override; - enum DeviceType { Phone, Tablet, Automotive, TV, Wear, PhoneOrTablet }; + enum DeviceType { Phone, Tablet, Automotive, TV, Wear, Desktop, PhoneOrTablet }; ProjectExplorer::IDevice::Ptr device() const; |