Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 18 additions & 1 deletion application/partedproxy/dmdbushandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,28 @@ QString DMDbusHandler::getRootLoginResult()
return m_loginMessage;
}

void DMDbusHandler::getAllDevice()
{
QDBusPendingCall pendingCall = m_dbus->getalldevice();
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingCall);

// 连接完成信号
QObject::connect(watcher, &QDBusPendingCallWatcher::finished,
[=](QDBusPendingCallWatcher *watcher) {
QDBusPendingReply<> reply = *watcher;
if (reply.isError()) {
qDebug() << __FUNCTION__ << reply.error().message();
QTimer::singleShot(500, this, SLOT(getAllDevice()));
}
watcher->deleteLater();
});
}

void DMDbusHandler::getDeviceInfo()
{
emit showSpinerWindow(true, tr("Initializing data..."));

m_dbus->getalldevice();
getAllDevice();
qDebug() << __FUNCTION__ << "-------";
}

Expand Down
5 changes: 5 additions & 0 deletions application/partedproxy/dmdbushandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ private slots:
*/
void onUpdateUsb();

/**
* @brief 触发重新请求设备信息的槽函数
*/
void getAllDevice();

private:
DMDBusInterface *m_dbus = nullptr;
static DMDbusHandler *m_staticHandeler;
Expand Down
2 changes: 1 addition & 1 deletion application/partedproxy/dmdbusinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Q_SLOTS: // METHODS
/**
* @brief 获取所有设备
*/
inline QDBusPendingReply<> getalldevice()
inline QDBusPendingCall getalldevice()
{
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QStringLiteral("getalldevice"), argumentList);
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
deepin-diskmanager (6.0.2) unstable; urgency=medium

* new tag v6.0.2
* fix get device info fail when init.

-- wangrong <wangrong@uniontech.com> Tue, 18 Mar 2025 14:21:23 +0800

deepin-diskmanager (6.0.1) unstable; urgency=medium

* new tag v6.0.1
Expand Down