forked from openkylin/ukui-search
Add web search selection with no result; App search fix bug;
This commit is contained in:
parent
9b34938b9b
commit
b9b206cb3a
|
@ -78,10 +78,8 @@ void ResultArea::pressEnter()
|
||||||
{
|
{
|
||||||
if (false == m_is_selected) {//未选中时默认选取bestlist第一项
|
if (false == m_is_selected) {//未选中时默认选取bestlist第一项
|
||||||
int resultNum = m_bestListWidget->getResultNum();
|
int resultNum = m_bestListWidget->getResultNum();
|
||||||
if (0 == resultNum) {//搜索结果为空则选中网页搜索项
|
if (0 == resultNum) {//无搜索结果时默认选中websearch
|
||||||
QModelIndex index = m_webSearchWidget->getModlIndex(0, 0);
|
m_webSearchWidget->LaunchBrowser();//默认已选中websearch
|
||||||
m_webSearchWidget->setResultSelection(index);
|
|
||||||
m_selectedPluginID = m_webSearchWidget->getWidgetName();
|
|
||||||
m_is_selected = true;
|
m_is_selected = true;
|
||||||
} else {//选取bestlist第一项
|
} else {//选取bestlist第一项
|
||||||
QModelIndex index = m_bestListWidget->getModlIndex(0, 0);
|
QModelIndex index = m_bestListWidget->getModlIndex(0, 0);
|
||||||
|
@ -386,13 +384,13 @@ void ResultArea::initConnections()
|
||||||
connect(this, &ResultArea::startSearch, this, [=] () {
|
connect(this, &ResultArea::startSearch, this, [=] () {
|
||||||
m_detail_open_state = false;
|
m_detail_open_state = false;
|
||||||
m_is_selected = false;
|
m_is_selected = false;
|
||||||
if (m_selectedPluginID == m_webSearchWidget->getWidgetName()) {
|
QModelIndex index = m_webSearchWidget->getModlIndex(0, 0);//每次启动搜索则选中web搜索,待bestlist收到结果后清空选中
|
||||||
m_webSearchWidget->clearResultSelection();
|
m_webSearchWidget->setResultSelection(index);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
connect(m_bestListWidget, &BestListWidget::sizeChanged, this, &ResultArea::onWidgetSizeChanged);
|
connect(m_bestListWidget, &BestListWidget::sizeChanged, this, &ResultArea::onWidgetSizeChanged);
|
||||||
connect(m_bestListWidget, &BestListWidget::sizeChanged, this, [=] () {
|
connect(m_bestListWidget, &BestListWidget::sizeChanged, this, [=] () {
|
||||||
if (!m_is_selected) {
|
if (!m_is_selected) {
|
||||||
|
m_webSearchWidget->clearResultSelection();//每次启动搜索则选中web搜索,待bestlist收到结果后清空选中
|
||||||
QModelIndex index = m_bestListWidget->getModlIndex(0, 0);
|
QModelIndex index = m_bestListWidget->getModlIndex(0, 0);
|
||||||
m_bestListWidget->setResultSelection(index);
|
m_bestListWidget->setResultSelection(index);
|
||||||
m_selectedPluginID = m_bestListWidget->getWidgetName();
|
m_selectedPluginID = m_bestListWidget->getWidgetName();
|
||||||
|
|
|
@ -98,6 +98,7 @@ void AppMatch::getAllDesktopFilePath(QString path) {
|
||||||
if(isDir) {
|
if(isDir) {
|
||||||
getAllDesktopFilePath(fileInfo.filePath());
|
getAllDesktopFilePath(fileInfo.filePath());
|
||||||
qDebug() << fileInfo.filePath();
|
qDebug() << fileInfo.filePath();
|
||||||
|
++i;
|
||||||
} else {
|
} else {
|
||||||
QString filePathStr = fileInfo.filePath();
|
QString filePathStr = fileInfo.filePath();
|
||||||
if(m_ExcludedDesktopfiles.contains(filePathStr)) {
|
if(m_ExcludedDesktopfiles.contains(filePathStr)) {
|
||||||
|
|
Loading…
Reference in New Issue