AndroidDeviceDialog: Move refreshing devices to a diffrent thread

Easy to do and makes the dialog feel marginally nicer.

Task-number: QTCREATORBUG-13123
Change-Id: I64098f1fd751100d40227c298a9e7eb358552bfb
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
Daniel Teske
2015-04-10 18:08:51 +02:00
parent 3b64374a3e
commit 2023489869
4 changed files with 113 additions and 32 deletions

View File

@@ -41,6 +41,8 @@ QT_BEGIN_NAMESPACE
class QModelIndex;
QT_END_NAMESPACE
namespace Utils { class ProgressIndicator; }
namespace Android {
namespace Internal {
@@ -67,11 +69,20 @@ private slots:
void showHelp();
void avdAdded();
private:
static QVector<AndroidDeviceInfo> refreshDevices(const QString &adbToolPath,
const QString &androidToolPath,
const Utils::Environment &environment);
void devicesRefreshed();
void enableOkayButton();
AndroidDeviceModel *m_model;
Ui::AndroidDeviceDialog *m_ui;
Utils::ProgressIndicator *m_progressIndicator;
int m_apiLevel;
QString m_abi;
QFutureWatcher<AndroidConfig::CreateAvdInfo> m_futureWatcher;
QString m_serialNumberFromAdd;
QFutureWatcher<AndroidConfig::CreateAvdInfo> m_futureWatcherAddDevice;
QFutureWatcher<QVector<AndroidDeviceInfo>> m_futureWatcherRefreshDevices;
};
}