Add autostart confs;

This commit is contained in:
iaom 2021-05-07 19:39:43 +08:00
parent 1d6c0c3374
commit 483947db31
4 changed files with 10 additions and 9 deletions

View File

@ -8,7 +8,6 @@ Comment[zh_CN]=全局搜索
Exec=/usr/bin/ukui-search %U Exec=/usr/bin/ukui-search %U
Type=Application Type=Application
Icon=kylin-search Icon=kylin-search
X-UKUI-AutoRestart=true OnlyShowIn=MATE;
OnlyShowIn=UKUI X-MATE-Autostart-Phase=Application
X-UKUI-Autostart-Phase=Application X-MATE-AutoRestart=true
Terminal=false

View File

@ -129,7 +129,7 @@ void FirstIndex::run(){
mutex2.lock(); mutex2.lock();
mutex3.lock(); mutex3.lock();
sem.acquire(4); sem.acquire(4);
QtConcurrent::run([&](){ // QtConcurrent::run([&](){
sem.acquire(1); sem.acquire(1);
mutex1.unlock(); mutex1.unlock();
this->setPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); this->setPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
@ -137,7 +137,7 @@ void FirstIndex::run(){
FileUtils::_max_index_count = this->q_index->length(); FileUtils::_max_index_count = this->q_index->length();
qDebug()<<"max_index_count:"<<FileUtils::_max_index_count; qDebug()<<"max_index_count:"<<FileUtils::_max_index_count;
sem.release(5); sem.release(5);
}); // });
QtConcurrent::run([&](){ QtConcurrent::run([&](){
sem.acquire(2); sem.acquire(2);
mutex2.unlock(); mutex2.unlock();
@ -189,7 +189,7 @@ void FirstIndex::run(){
if (p_indexGenerator) if (p_indexGenerator)
delete p_indexGenerator; delete p_indexGenerator;
p_indexGenerator = nullptr; p_indexGenerator = nullptr;
GlobalSettings::getInstance()->forceSync(); // GlobalSettings::getInstance()->forceSync();
::_exit(0); ::_exit(0);
} }
else if(pid < 0) else if(pid < 0)

View File

@ -323,7 +323,7 @@ fork:
qDebug() << "select timeout!"; qDebug() << "select timeout!";
::free(read_timeout); ::free(read_timeout);
IndexGenerator::getInstance()->~IndexGenerator(); IndexGenerator::getInstance()->~IndexGenerator();
GlobalSettings::getInstance()->forceSync(); // GlobalSettings::getInstance()->forceSync();
::_exit(0); ::_exit(0);
}else{ }else{
GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "0"); GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "0");

View File

@ -39,8 +39,10 @@ SearchApp::~SearchApp()
void SearchApp::run() void SearchApp::run()
{ {
size_t tmp_uniqueSymbol;
m_mutex.lock(); m_mutex.lock();
uniqueSymbol++; uniqueSymbol++;
tmp_uniqueSymbol = uniqueSymbol;
m_mutex.unlock(); m_mutex.unlock();
//nameList:应用名pathList:已安装的是.desktop路径未安装为空iconList:已安装的是图标名,未安装的是图标路径 //nameList:应用名pathList:已安装的是.desktop路径未安装为空iconList:已安装的是图标名,未安装的是图标路径
QStringList nameList, pathList, iconList, descList; QStringList nameList, pathList, iconList, descList;
@ -74,7 +76,7 @@ void SearchApp::run()
appVector.append(iconList); appVector.append(iconList);
appVector.append(descList); appVector.append(descList);
m_mutex.lock(); m_mutex.lock();
if (uniqueSymbol == uniqueSymbol) { if (tmp_uniqueSymbol == uniqueSymbol) {
Q_EMIT this->searchResultApp(appVector); Q_EMIT this->searchResultApp(appVector);
} }
m_mutex.unlock(); m_mutex.unlock();