Skip to content

Commit

Permalink
fix: [disc] cd to computer when a file deleted from subdir
Browse files Browse the repository at this point in the history
This is an issue introduced by bug-202249

Log: as title

Bug: https://pms.uniontech.com/bug-view-261005.html
  • Loading branch information
Johnson-zs committed Jun 25, 2024
1 parent ff3a5b8 commit 503540f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,15 @@ bool OpticalEventReceiver::detailViewIcon(const QUrl &url, QString *iconName)
return false;
}

bool OpticalEventReceiver::handleTabClosable(const QUrl &currentUrl, const QUrl &rootUrl)
bool OpticalEventReceiver::handleTabCloseable(const QUrl &currentUrl, const QUrl &rootUrl)

Check warning on line 192 in src/plugins/filemanager/dfmplugin-optical/events/opticaleventreceiver.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'handleTabCloseable' is never used.

Check warning on line 192 in src/plugins/filemanager/dfmplugin-optical/events/opticaleventreceiver.cpp

View workflow job for this annotation

GitHub Actions / static-check / Static-Check

The function 'handleTabCloseable' is never used.
{
const auto &scheme { OpticalHelper::scheme() };
if (currentUrl.scheme() != scheme || rootUrl.scheme() != scheme)
return false;

if (OpticalHelper::burnIsOnStaging(currentUrl)) {
// 当前所在的目录正在待刻录的目录中(staging),而一个磁盘的目录被删除了(disc)这意味着
// 光盘被卸载, 因此需要关闭当前tab
if (OpticalHelper::burnIsOnStaging(currentUrl) && OpticalHelper::burnIsOnDisc(rootUrl)) {
const QString &rootDev { OpticalHelper::burnDestDevice(rootUrl) };
const QString &curDev { OpticalHelper::burnDestDevice(currentUrl) };
if (rootDev == curDev) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public slots:
bool handleDropFiles(const QList<QUrl> &fromUrls, const QUrl &toUrl);
bool handleBlockShortcutPaste(quint64 winId, const QList<QUrl> &fromUrls, const QUrl &to);
bool detailViewIcon(const QUrl &url, QString *iconName);
bool handleTabClosable(const QUrl &currentUrl, const QUrl &rootUrl);
bool handleTabCloseable(const QUrl &currentUrl, const QUrl &rootUrl);

private:
bool isContainPWSubDirFile(const QList<QUrl> &urls);
Expand Down

0 comments on commit 503540f

Please sign in to comment.