forked from openkylin/ukui-search
Add autostart confs;
This commit is contained in:
parent
1d6c0c3374
commit
483947db31
|
@ -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
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue