From f62c5dd2892b0c531e6a59ffc224cb50e510fe81 Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Tue, 26 Jan 2021 16:22:03 +0800 Subject: [PATCH] fix(frontend): Retract button is not reset when get new result. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 修复收起按钮未重置的问题和ukui-search -s拉起不显示主界面的bug Log: 修复收起按钮未重置的问题和ukui-search -s拉起不显示主界面的bug Bug: http://172.17.66.192/biz/bug-view-35227.html http://172.17.66.192/biz/bug-view-33087.html --- src/control/show-more-label.cpp | 1 + src/main.cpp | 4 ++++ src/mainwindow.cpp | 17 ++++++++++------- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/control/show-more-label.cpp b/src/control/show-more-label.cpp index f1c58c2..8582a19 100644 --- a/src/control/show-more-label.cpp +++ b/src/control/show-more-label.cpp @@ -16,6 +16,7 @@ ShowMoreLabel::~ShowMoreLabel() void ShowMoreLabel::resetLabel() { + m_isOpen = false; m_textLabel->setText(tr("Show More...")); } diff --git a/src/main.cpp b/src/main.cpp index cc5a436..64b6a64 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,6 +208,10 @@ int main(int argc, char *argv[]) XAtomHelper::getInstance()->setWindowMotifHint(w->winId(), hints); app.setActivationWindow(w); + + if (QString::compare(QString("-s"), QString(QLatin1String(argv[1]))) == 0) { + w->show(); + } // if(arguments.size()>1) // w->searchContent(arguments.at(1)); QObject::connect(&app, SIGNAL(messageReceived(const QString&)),w, SLOT(bootOptionsFilter(const QString&))); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 879f14b..ba65a16 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -93,15 +93,15 @@ MainWindow::MainWindow(QWidget *parent) : m_search_result_thread = new SearchResult(this); // m_search_result_thread->start(); connect(m_search_result_thread, &SearchResult::searchResultFile, this, [ = ](QString path) { -// qDebug()<<"Append a file into list: "<appendSearchItem(SearchItem::SearchType::Files, path); }); connect(m_search_result_thread, &SearchResult::searchResultDir, this, [ = ](QString path) { -// qDebug()<<"Append a dir into list: "<appendSearchItem(SearchItem::SearchType::Dirs, path); }); connect(m_search_result_thread, &SearchResult::searchResultContent, this, [ = ](QPair pair) { -// qDebug()<<"Append a file content into list: "<appendSearchItem(SearchItem::SearchType::Contents, pair.first, pair.second); }); @@ -215,6 +215,9 @@ void MainWindow::initUi() } else { m_contentFrame->setCurrentIndex(1); QTimer::singleShot(10,this,[=](){ + m_search_result_file->clear(); + m_search_result_dir->clear(); + m_search_result_content->clear(); if (! m_search_result_thread->isRunning()) { m_search_result_thread->start(); } @@ -282,9 +285,9 @@ void MainWindow::searchContent(QString searchcontent){ m_app_setting_lists.clear(); m_contentFrame->setKeyword(searchcontent); - m_search_result_file->clear(); - m_search_result_dir->clear(); - m_search_result_content->clear(); +// m_search_result_file->clear(); +// m_search_result_dir->clear(); +// m_search_result_content->clear(); AppMatch * appMatchor = new AppMatch(this); SettingsMatch * settingMatchor = new SettingsMatch(this); @@ -296,7 +299,7 @@ void MainWindow::searchContent(QString searchcontent){ m_app_setting_lists.append(appList); m_app_setting_lists.append(settingList); m_contentFrame->refreshSearchList(m_app_setting_lists); - + //文件、文件夹、内容搜索 this->m_searcher->onKeywordSearch(searchcontent, m_search_result_file, m_search_result_dir, m_search_result_content); }