Skip to content

Commit

Permalink
fix: [menu]view mode menu issue
Browse files Browse the repository at this point in the history
hide tree view mode action of menu in the dir not support tree view.

Log: fix menu issue
Bug: https://pms.uniontech.com/bug-view-240215.html
  • Loading branch information
Lighto-Ku authored and deepin-bot[bot] committed Jan 17, 2024
1 parent 87d03fa commit 702c041
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "workspacemenu_defines.h"
#include "views/fileview.h"
#include "models/fileviewmodel.h"
#include "utils/workspacehelper.h"

#include <dfm-base/dfm_menu_defines.h>
#include <dfm-base/dfm_global_defines.h>
Expand Down Expand Up @@ -205,7 +206,8 @@ QMenu *SortAndDisplayMenuScenePrivate::addDisplayAsActions(QMenu *menu)
predicateAction[ActionID::kDisplayList] = tempAction;
tempAction->setProperty(ActionPropertyKey::kActionID, QString(ActionID::kDisplayList));

if (DConfigManager::instance()->value(kViewDConfName, kTreeViewEnable, true).toBool()) {
if (WorkspaceHelper::instance()->supportTreeView(view->rootUrl().scheme())
&& DConfigManager::instance()->value(kViewDConfName, kTreeViewEnable, true).toBool()) {
tempAction = subMenu->addAction(predicateName.value(ActionID::kDisplayTree));
tempAction->setCheckable(true);
predicateAction[ActionID::kDisplayTree] = tempAction;
Expand Down

0 comments on commit 702c041

Please sign in to comment.