mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-10-04 07:09:56 +00:00
chore: code format by clang-format
This commit is contained in:
parent
c120b3399c
commit
96472cec90
68 changed files with 1517 additions and 1346 deletions
|
@ -1,7 +1,7 @@
|
|||
#include <QDebug>
|
||||
#include <QKeyEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QWheelEvent>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "devicemanage.h"
|
||||
#include "server.h"
|
||||
|
@ -9,15 +9,9 @@
|
|||
|
||||
#define DM_MAX_DEVICES_NUM 16
|
||||
|
||||
DeviceManage::DeviceManage(QObject *parent) : QObject(parent)
|
||||
{
|
||||
DeviceManage::DeviceManage(QObject *parent) : QObject(parent) {}
|
||||
|
||||
}
|
||||
|
||||
DeviceManage::~DeviceManage()
|
||||
{
|
||||
|
||||
}
|
||||
DeviceManage::~DeviceManage() {}
|
||||
|
||||
bool DeviceManage::connectDevice(Device::DeviceParams params)
|
||||
{
|
||||
|
@ -195,8 +189,7 @@ void DeviceManage::onControlStateChange(Device *device, Device::GroupControlStat
|
|||
return;
|
||||
}
|
||||
// free to host
|
||||
if (oldState == Device::GroupControlState::GCS_FREE
|
||||
&& newState == Device::GroupControlState::GCS_HOST) {
|
||||
if (oldState == Device::GroupControlState::GCS_FREE && newState == Device::GroupControlState::GCS_HOST) {
|
||||
// install direct control signals
|
||||
setGroupControlHost(device, true);
|
||||
// install convert control signals(frameSize need convert)
|
||||
|
@ -206,8 +199,7 @@ void DeviceManage::onControlStateChange(Device *device, Device::GroupControlStat
|
|||
return;
|
||||
}
|
||||
// host to free
|
||||
if (oldState == Device::GroupControlState::GCS_HOST
|
||||
&& newState == Device::GroupControlState::GCS_FREE) {
|
||||
if (oldState == Device::GroupControlState::GCS_HOST && newState == Device::GroupControlState::GCS_FREE) {
|
||||
// uninstall direct control signals
|
||||
setGroupControlHost(device, false);
|
||||
// uninstall convert control signals(frameSize need convert)
|
||||
|
@ -268,16 +260,14 @@ void DeviceManage::onKeyEvent(const QKeyEvent *from, const QSize &frameSize, con
|
|||
|
||||
quint16 DeviceManage::getFreePort()
|
||||
{
|
||||
quint16 port = m_localPortStart;
|
||||
quint16 port = m_localPortStart;
|
||||
while (port < m_localPortStart + DM_MAX_DEVICES_NUM) {
|
||||
bool used = false;
|
||||
QMapIterator<QString, QPointer<Device>> i(m_devices);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
auto device = i.value();
|
||||
if (device && device->getServer()
|
||||
&& device->getServer()->isReverse()
|
||||
&& port == device->getServer()->getParams().localPort) {
|
||||
if (device && device->getServer() && device->getServer()->isReverse() && port == device->getServer()->getParams().localPort) {
|
||||
used = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue