Skip to content

Commit df4618b

Browse files
committed
fix(context-menu): hide compatible install in empty area right-click
Always return false when right-clicking on empty area to prevent the "Install in compatible mode" option from appearing. 修复空白区域右键时兼容模式安装选项不应显示的问题。 PMS: TASK-389473 Log: 修复空白区域右键仍显示兼容模式安装选项的问题 Influence: 兼容模式安装菜单项仅在右键点击单个.deb文件时显示,空白区域右键不再出现。
1 parent 6307345 commit df4618b

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/dfmplugin-debinstaller/menu/debinstallermenuscene.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,12 @@ bool DebInstallerMenuScene::initialize(const QVariantHash &params)
7373
d->selectFiles = params.value(MenuParamKey::kSelectFiles).value<QList<QUrl>>();
7474
d->isEmptyArea = params.value(MenuParamKey::kIsEmptyArea).toBool();
7575

76-
if (d->isEmptyArea) {
77-
if (!isInstallerRunning())
78-
return false;
79-
} else if (d->selectFiles.size() != 1) {
76+
if (d->isEmptyArea)
77+
return false;
78+
79+
const auto &url = d->selectFiles.first();
80+
if (!url.isLocalFile() || !url.toLocalFile().endsWith(".deb"))
8081
return false;
81-
} else {
82-
const auto &url = d->selectFiles.first();
83-
if (!url.isLocalFile() || !url.toLocalFile().endsWith(".deb"))
84-
return false;
85-
}
8682

8783
return AbstractMenuScene::initialize(params);
8884
}

0 commit comments

Comments
 (0)