mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 11:35:56 +00:00
feat: auto apply update script
This commit is contained in:
parent
d4475fd4ac
commit
7c1e0206b4
2 changed files with 5 additions and 4 deletions
|
@ -43,15 +43,15 @@ bool DeviceManage::connectDevice(Device::DeviceParams params)
|
|||
connect(device, &Device::deviceDisconnect, this, &DeviceManage::onDeviceDisconnect);
|
||||
connect(device, &Device::controlStateChange, this, &DeviceManage::onControlStateChange);
|
||||
m_devices[params.serial] = device;
|
||||
if (!m_script.isEmpty()) {
|
||||
device->updateScript(m_script);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DeviceManage::updateScript(QString script)
|
||||
{
|
||||
if (m_devices.isEmpty()) {
|
||||
qWarning() << "no device connect!!!";
|
||||
return;
|
||||
}
|
||||
m_script = script;
|
||||
QMapIterator<QString, QPointer<Device>> i(m_devices);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
|
|
|
@ -40,6 +40,7 @@ private:
|
|||
private:
|
||||
QMap<QString, QPointer<Device>> m_devices;
|
||||
quint16 m_localPortStart = 27183;
|
||||
QString m_script;
|
||||
};
|
||||
|
||||
#endif // DEVICEMANAGE_H
|
||||
|
|
Loading…
Add table
Reference in a new issue