Skip to content

Commit

Permalink
fix: Fix the first mount login SMB sharing directory to view attribut…
Browse files Browse the repository at this point in the history
…es, attribute page display the sharing management settings.

The path /media for the first mount in V25 is a relative path. Use the absolute path to determine whether the mount point exists.

Log: Fix the first mount login SMB sharing directory to view attributes, attribute page display the sharing management settings.

Bug: https://pms.uniontech.com/bug-view-296579.html
  • Loading branch information
dengzhongyuan365-dev authored and Johnson-zs committed Jan 14, 2025
1 parent a75e280 commit 1cb1aaa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/plugins/common/dfmplugin-dirshare/dirshare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,17 @@ QWidget *DirShare::createShareControlWidget(const QUrl &url)
if (!supported.contains(url.scheme()))
return nullptr;

auto info = InfoFactory::create<FileInfo>(url);
QFileInfo fileInfo(url.toLocalFile());
if (!fileInfo.exists())
return nullptr;

QString canonicalPath = fileInfo.canonicalFilePath();
if (canonicalPath.isEmpty())
return nullptr;

QUrl canonicalUrl = QUrl::fromLocalFile(canonicalPath);
auto info = InfoFactory::create<FileInfo>(canonicalUrl);

bool disableWidget = UserShareHelper::needDisableShareWidget(info);
if (!UserShareHelper::canShare(info))
return nullptr;
Expand Down

0 comments on commit 1cb1aaa

Please sign in to comment.