Merge branch 'dev-unity' into 'main'

Synchronize with dev-unity

See merge request kylin-desktop/ukui-search!54
This commit is contained in:
PengfeiZhang 2021-07-03 02:09:53 +00:00
commit 17b1c1a907
4 changed files with 30 additions and 14 deletions

View File

@ -1,4 +1,17 @@
# ukui-search
[WIP] UKUI Search is a user-wide desktop search feature of UKUI desktop environment.
[dWIP] UKUI Search is a user-wide desktop search feature of UKUI desktop environment.
Build from source
git clone https://github.com/ukui/ukui-search.git
cd ukui-search && mkdir build && cd build
qmake .. && make
sudo make install
/usr/bin/ukui-search

View File

@ -9,6 +9,7 @@ Exec=/usr/bin/ukui-search -s
Type=Application
Icon=kylin-search
X-UKUI-AutoRestart=true
NoDisplay=true
OnlyShowIn=UKUI
X-UKUI-Autostart-Phase=Application
Terminal=false

View File

@ -97,19 +97,6 @@ void FirstIndex::run() {
QTime t1 = QTime::currentTime();
// Create a fifo at ~/.config/org.ukui/ukui-search, the fifo is used to control the order of child processes' running.
QDir fifoDir = QDir(QDir::homePath() + "/.config/org.ukui/ukui-search");
if(!fifoDir.exists())
qDebug() << "create fifo path" << fifoDir.mkpath(fifoDir.absolutePath());
unlink(UKUI_SEARCH_PIPE_PATH);
int retval = mkfifo(UKUI_SEARCH_PIPE_PATH, 0777);
if(retval == -1) {
qCritical() << "creat fifo error!!";
syslog(LOG_ERR, "creat fifo error!!\n");
assert(false);
return;
}
qDebug() << "create fifo success\n";
QString indexDataBaseStatus = IndexStatusRecorder::getInstance()->getStatus(INDEX_DATABASE_STATE).toString();
QString contentIndexDataBaseStatus = IndexStatusRecorder::getInstance()->getStatus(CONTENT_INDEX_DATABASE_STATE).toString();

View File

@ -13,6 +13,21 @@ void SearchMethodManager::searchMethod(FileUtils::SearchMethod sm) {
qWarning("enum class error!!!\n");
}
if(FileUtils::SearchMethod::INDEXSEARCH == sm && 0 == FileUtils::_index_status) {
// Create a fifo at ~/.config/org.ukui/ukui-search, the fifo is used to control the order of child processes' running.
QDir fifoDir = QDir(QDir::homePath() + "/.config/org.ukui/ukui-search");
if(!fifoDir.exists())
qDebug() << "create fifo path" << fifoDir.mkpath(fifoDir.absolutePath());
unlink(UKUI_SEARCH_PIPE_PATH);
int retval = mkfifo(UKUI_SEARCH_PIPE_PATH, 0777);
if(retval == -1) {
qCritical() << "creat fifo error!!";
syslog(LOG_ERR, "creat fifo error!!\n");
assert(false);
return;
}
qDebug() << "create fifo success\n";
qWarning() << "start first index";
m_fi.start();
qWarning() << "start inotify index";