From f9e9ea67ade45b4404674737eede874a083c7709 Mon Sep 17 00:00:00 2001 From: iaom <18504285112@163.com> Date: Wed, 30 Jun 2021 18:50:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Update=20README.md=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c00ecf2..d375118 100644 --- a/README.md +++ b/README.md @@ -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 From 272d707230e536179f6037d06eafe0c760d2d826 Mon Sep 17 00:00:00 2001 From: iaom <18504285112@163.com> Date: Thu, 1 Jul 2021 19:37:37 +0800 Subject: [PATCH 2/3] [Fix] Creat fifo error sometimes. --- libsearch/index/first-index.cpp | 13 ------------- libsearch/index/searchmethodmanager.cpp | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/libsearch/index/first-index.cpp b/libsearch/index/first-index.cpp index fb3ef49..15f6429 100644 --- a/libsearch/index/first-index.cpp +++ b/libsearch/index/first-index.cpp @@ -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(); diff --git a/libsearch/index/searchmethodmanager.cpp b/libsearch/index/searchmethodmanager.cpp index dc073cb..bfdc7ee 100644 --- a/libsearch/index/searchmethodmanager.cpp +++ b/libsearch/index/searchmethodmanager.cpp @@ -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"; From ae5477b901698b6b0a047ce28c0eb930787f6da6 Mon Sep 17 00:00:00 2001 From: iaom <18504285112@163.com> Date: Fri, 2 Jul 2021 14:50:42 +0800 Subject: [PATCH 3/3] Update desktop file. --- data/ukui-search-menu.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/data/ukui-search-menu.desktop b/data/ukui-search-menu.desktop index 07b5690..085b75c 100644 --- a/data/ukui-search-menu.desktop +++ b/data/ukui-search-menu.desktop @@ -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