From 483947db31a6c892b7656ad533fe895175144309 Mon Sep 17 00:00:00 2001 From: iaom Date: Fri, 7 May 2021 19:39:43 +0800 Subject: [PATCH] Add autostart confs; --- data/ukui-search.desktop | 7 +++---- libsearch/index/first-index.cpp | 6 +++--- libsearch/index/inotify-index.cpp | 2 +- src/search-app-thread.cpp | 4 +++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/data/ukui-search.desktop b/data/ukui-search.desktop index 1a8bbe0..db77937 100644 --- a/data/ukui-search.desktop +++ b/data/ukui-search.desktop @@ -8,7 +8,6 @@ Comment[zh_CN]=全局搜索 Exec=/usr/bin/ukui-search %U Type=Application Icon=kylin-search -X-UKUI-AutoRestart=true -OnlyShowIn=UKUI -X-UKUI-Autostart-Phase=Application -Terminal=false +OnlyShowIn=MATE; +X-MATE-Autostart-Phase=Application +X-MATE-AutoRestart=true diff --git a/libsearch/index/first-index.cpp b/libsearch/index/first-index.cpp index 878593b..144ea59 100644 --- a/libsearch/index/first-index.cpp +++ b/libsearch/index/first-index.cpp @@ -129,7 +129,7 @@ void FirstIndex::run(){ mutex2.lock(); mutex3.lock(); sem.acquire(4); - QtConcurrent::run([&](){ +// QtConcurrent::run([&](){ sem.acquire(1); mutex1.unlock(); this->setPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); @@ -137,7 +137,7 @@ void FirstIndex::run(){ FileUtils::_max_index_count = this->q_index->length(); qDebug()<<"max_index_count:"<forceSync(); +// GlobalSettings::getInstance()->forceSync(); ::_exit(0); } else if(pid < 0) diff --git a/libsearch/index/inotify-index.cpp b/libsearch/index/inotify-index.cpp index fa7ae2b..dddc18b 100644 --- a/libsearch/index/inotify-index.cpp +++ b/libsearch/index/inotify-index.cpp @@ -323,7 +323,7 @@ fork: qDebug() << "select timeout!"; ::free(read_timeout); IndexGenerator::getInstance()->~IndexGenerator(); - GlobalSettings::getInstance()->forceSync(); +// GlobalSettings::getInstance()->forceSync(); ::_exit(0); }else{ GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "0"); diff --git a/src/search-app-thread.cpp b/src/search-app-thread.cpp index ffd1493..c382742 100644 --- a/src/search-app-thread.cpp +++ b/src/search-app-thread.cpp @@ -39,8 +39,10 @@ SearchApp::~SearchApp() void SearchApp::run() { + size_t tmp_uniqueSymbol; m_mutex.lock(); uniqueSymbol++; + tmp_uniqueSymbol = uniqueSymbol; m_mutex.unlock(); //nameList:应用名,pathList:已安装的是.desktop路径,未安装为空,iconList:已安装的是图标名,未安装的是图标路径 QStringList nameList, pathList, iconList, descList; @@ -74,7 +76,7 @@ void SearchApp::run() appVector.append(iconList); appVector.append(descList); m_mutex.lock(); - if (uniqueSymbol == uniqueSymbol) { + if (tmp_uniqueSymbol == uniqueSymbol) { Q_EMIT this->searchResultApp(appVector); } m_mutex.unlock();