Merge branch 'new-frontend' into 'new-frontend'

Add web search selection with no result; App search fix bug;

See merge request kylin-desktop/ukui-search!149
This commit is contained in:
PengfeiZhang 2021-09-26 01:24:44 +00:00
commit 5d29be6ebe
2 changed files with 6 additions and 7 deletions

View File

@ -78,10 +78,8 @@ void ResultArea::pressEnter()
{
if (false == m_is_selected) {//未选中时默认选取bestlist第一项
int resultNum = m_bestListWidget->getResultNum();
if (0 == resultNum) {//搜索结果为空则选中网页搜索项
QModelIndex index = m_webSearchWidget->getModlIndex(0, 0);
m_webSearchWidget->setResultSelection(index);
m_selectedPluginID = m_webSearchWidget->getWidgetName();
if (0 == resultNum) {//无搜索结果时默认选中websearch
m_webSearchWidget->LaunchBrowser();//默认已选中websearch
m_is_selected = true;
} else {//选取bestlist第一项
QModelIndex index = m_bestListWidget->getModlIndex(0, 0);
@ -386,13 +384,13 @@ void ResultArea::initConnections()
connect(this, &ResultArea::startSearch, this, [=] () {
m_detail_open_state = false;
m_is_selected = false;
if (m_selectedPluginID == m_webSearchWidget->getWidgetName()) {
m_webSearchWidget->clearResultSelection();
}
QModelIndex index = m_webSearchWidget->getModlIndex(0, 0);//每次启动搜索则选中web搜索待bestlist收到结果后清空选中
m_webSearchWidget->setResultSelection(index);
});
connect(m_bestListWidget, &BestListWidget::sizeChanged, this, &ResultArea::onWidgetSizeChanged);
connect(m_bestListWidget, &BestListWidget::sizeChanged, this, [=] () {
if (!m_is_selected) {
m_webSearchWidget->clearResultSelection();//每次启动搜索则选中web搜索待bestlist收到结果后清空选中
QModelIndex index = m_bestListWidget->getModlIndex(0, 0);
m_bestListWidget->setResultSelection(index);
m_selectedPluginID = m_bestListWidget->getWidgetName();

View File

@ -98,6 +98,7 @@ void AppMatch::getAllDesktopFilePath(QString path) {
if(isDir) {
getAllDesktopFilePath(fileInfo.filePath());
qDebug() << fileInfo.filePath();
++i;
} else {
QString filePathStr = fileInfo.filePath();
if(m_ExcludedDesktopfiles.contains(filePathStr)) {