From 4a64f403c493713fc0e5e8807269db410bcfe514 Mon Sep 17 00:00:00 2001 From: rankun Date: Sun, 14 Jun 2020 16:40:30 +0800 Subject: [PATCH] fix: drop file on group control --- QtScrcpy/device/device.cpp | 6 ++++-- QtScrcpy/device/device.h | 4 ++-- QtScrcpy/device/ui/videoform.cpp | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/QtScrcpy/device/device.cpp b/QtScrcpy/device/device.cpp index 4e19d00..4ddce87 100644 --- a/QtScrcpy/device/device.cpp +++ b/QtScrcpy/device/device.cpp @@ -173,8 +173,10 @@ void Device::initSignals() connect(this, &Device::switchFullScreen, m_videoForm, &VideoForm::onSwitchFullScreen); } if (m_fileHandler) { - connect(this, &Device::pushFileRequest, m_fileHandler, &FileHandler::onPushFileRequest); - connect(this, &Device::installApkRequest, m_fileHandler, &FileHandler::onInstallApkRequest); + connect(this, &Device::pushFileRequest, this, [this](const QString &file, const QString &devicePath) { + m_fileHandler->onPushFileRequest(getSerial(), file, devicePath); + }); + connect(this, &Device::installApkRequest, this, [this](const QString &apkFile) { m_fileHandler->onInstallApkRequest(getSerial(), apkFile); }); connect(m_fileHandler, &FileHandler::fileHandlerResult, this, [this](FileHandler::FILE_HANDLER_RESULT processResult, bool isApk) { QString tipsType = ""; if (isApk) { diff --git a/QtScrcpy/device/device.h b/QtScrcpy/device/device.h index f574493..2463e0a 100644 --- a/QtScrcpy/device/device.h +++ b/QtScrcpy/device/device.h @@ -75,8 +75,8 @@ signals: void requestDeviceClipboard(); void setDeviceClipboard(); void clipboardPaste(); - void pushFileRequest(const QString &serial, const QString &file, const QString &devicePath = ""); - void installApkRequest(const QString &serial, const QString &apkFile); + void pushFileRequest(const QString &file, const QString &devicePath = ""); + void installApkRequest(const QString &apkFile); // key map void mouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize); diff --git a/QtScrcpy/device/ui/videoform.cpp b/QtScrcpy/device/ui/videoform.cpp index 001d037..5185a98 100644 --- a/QtScrcpy/device/ui/videoform.cpp +++ b/QtScrcpy/device/ui/videoform.cpp @@ -712,8 +712,8 @@ void VideoForm::dropEvent(QDropEvent *event) } if (fileInfo.isFile() && fileInfo.suffix() == "apk") { - emit m_device->installApkRequest(m_device->getSerial(), file); + emit m_device->installApkRequest(file); return; } - emit m_device->pushFileRequest(m_device->getSerial(), file, Config::getInstance().getPushFilePath() + fileInfo.fileName()); + emit m_device->pushFileRequest(file, Config::getInstance().getPushFilePath() + fileInfo.fileName()); }