Skip to content

Commit

Permalink
feat: [mount] mount by cifs if cifs supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
itsXuSt authored and Johnson-zs committed Aug 22, 2024
1 parent d2317bb commit dd1e774
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/dfm-mount/private/dnetworkmounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,28 @@ bool DNetworkMounter::isDaemonMountEnable()
if (!systemBusIFace->isServiceRegistered(kDaemonService))
return false;

QDBusInterface daemonIface(kDaemonService, kDaemonPath, kDaemonIntro,
QDBusConnection::systemBus());
QDBusReply<QString> reply = daemonIface.call(kDaemonIntroMethod);
return reply.value().contains("<node name=\"MountControl\"/>");
// check if MountControl interface exists
QDBusInterface daemonIntroIface(kDaemonService, kDaemonPath, kDaemonIntro,
QDBusConnection::systemBus());
QDBusReply<QString> reply = daemonIntroIface.call(kDaemonIntroMethod);
if (reply.value().contains(R"(<node name="MountControl"/>)")) {
// check if "SupportedFileSystems" method exists
QDBusInterface introIface(kDaemonService,
"/com/deepin/filemanager/daemon/MountControl",
kDaemonIntro,
QDBusConnection::systemBus());
QDBusReply<QString> ifaceDesc = introIface.call(kDaemonIntroMethod);
if (!ifaceDesc.value().contains(R"(<method name="SupportedFileSystems">)"))
return true;

QDBusInterface mountIface(kDaemonService,
"/com/deepin/filemanager/daemon/MountControl",
"com.deepin.filemanager.daemon.MountControl",
QDBusConnection::systemBus());
QDBusReply<QStringList> supported = mountIface.call("SupportedFileSystems");
return supported.value().contains("cifs");
}
return false;
}

QList<QVariantMap> DNetworkMounter::loginPasswd(const QString &address)
Expand Down

0 comments on commit dd1e774

Please sign in to comment.