Skip to content

Commit

Permalink
fix: [titlebar] Error displayed in view mode
Browse files Browse the repository at this point in the history
The url used to query the default view mode is incorrect

Log: fix bug
Bug: https://pms.uniontech.com/bug-view-217717.html
  • Loading branch information
Kakueeen authored and max-lvs committed Oct 8, 2023
1 parent 7f1e532 commit c95c3e7
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 @@ -45,8 +45,9 @@ void OptionButtonBoxPrivate::setViewMode(ViewMode mode)

void OptionButtonBoxPrivate::loadViewMode(const QUrl &url)
{
auto defaultViewMode = static_cast<int>(TitleBarEventCaller::sendGetDefualtViewMode(url.scheme()));
auto viewMode = static_cast<ViewMode>(Application::appObtuselySetting()->value("FileViewState", url).toMap().value("viewMode", defaultViewMode).toInt());
QUrl tmpUrl = url.adjusted(QUrl::RemoveQuery);
auto defaultViewMode = static_cast<int>(TitleBarEventCaller::sendGetDefualtViewMode(tmpUrl.scheme()));
auto viewMode = static_cast<ViewMode>(Application::appObtuselySetting()->value("FileViewState", tmpUrl).toMap().value("viewMode", defaultViewMode).toInt());

switchMode(viewMode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ bool SearchMenuScene::initialize(const QVariantHash &params)
QVariantHash tmpParams = params;
QList<AbstractMenuScene *> currentScene;
const auto &targetUrl = SearchHelper::searchTargetUrl(d->currentDir);
auto menuScene = dpfSlotChannel->push("dfmplugin_workspace", "slot_FindMenuScene", targetUrl.scheme()).toString();
const auto &scheme = targetUrl.scheme() == Global::Scheme::kComputer ? Global::Scheme::kFile : targetUrl.scheme();
auto menuScene = dpfSlotChannel->push("dfmplugin_workspace", "slot_FindMenuScene", scheme).toString();
if (auto scene = dfmplugin_menu_util::menuSceneCreateScene(menuScene)) {
currentScene.append(scene);
tmpParams[MenuParamKey::kCurrentDir] = targetUrl;
Expand Down

0 comments on commit c95c3e7

Please sign in to comment.