Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

#include <QLoggingCategory>
#include <QProcess>
#include <QDir>

Check warning on line 18 in deepin-devicemanager-server/deepin-devicecontrol/src/controlinterface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDir> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDBusConnection>

Check warning on line 19 in deepin-devicemanager-server/deepin-devicecontrol/src/controlinterface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusConnection> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QFile>

Check warning on line 20 in deepin-devicemanager-server/deepin-devicecontrol/src/controlinterface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QFile> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QThread>

Check warning on line 21 in deepin-devicemanager-server/deepin-devicecontrol/src/controlinterface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QThread> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDBusConnectionInterface>

Check warning on line 22 in deepin-devicemanager-server/deepin-devicecontrol/src/controlinterface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusConnectionInterface> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <polkit-qt5-1/PolkitQt1/Authority>

Check warning on line 24 in deepin-devicemanager-server/deepin-devicecontrol/src/controlinterface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <polkit-qt5-1/PolkitQt1/Authority> not found. Please note: Cppcheck does not need standard library headers to get proper results.

// 系统库文件
#include <cups.h>
Expand Down Expand Up @@ -358,6 +359,8 @@
fpop.write("0");
fpop.close();

QThread::msleep(800);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): QThread::msleep(800) blocks the single thread that owns ControlInterface and runs the D-Bus event loop, so other D-Bus requests and queued signals cannot be processed during the USB re-enable delay.

Triggers: When another device-control request or queued event arrives during USB device re-enabling.

Suggested fix: Perform the delayed re-enable in a worker thread or restructure the operation as an asynchronous state machine so the D-Bus event loop remains responsive.


// 第三步
if (!fpop.open(QIODevice::ReadWrite))
return false;
Expand Down
Loading