diff -Nru ukui-search-4.10.14.0/debian/changelog ukui-search-4.10.14.0/debian/changelog --- ukui-search-4.10.14.0/debian/changelog 2025-02-28 10:35:30.000000000 +0800 +++ ukui-search-4.10.14.0/debian/changelog 2025-03-14 16:32:46.000000000 +0800 @@ -1,3 +1,14 @@ +ukui-search (4.10.14.0-ok0.10) nile; urgency=medium + + * Issues:无 + * 其他改动: + - fix(dir-manager):不可变系统下无法添加u盘为搜索目录 + - fix(ukui-search-service/cgroup):cgroup添加版权信息 + - fix(ukcc-plugin):CMakeLists在pkgconfig时连接出错 + - perf(ukui-search-service):使用懒加载RemoteFileEventHelper来减少不开索引时对cpu占用 + + -- iaom <zhangpengfei@kylinos.cn> Fri, 14 Mar 2025 16:32:46 +0800 + ukui-search (4.10.14.0-ok0.9) nile; urgency=medium * Issues:无 diff -Nru ukui-search-4.10.14.0/debian/patches/0017-Update-changelog-ukui-search4.10.14.0-ok0.10.patch ukui-search-4.10.14.0/debian/patches/0017-Update-changelog-ukui-search4.10.14.0-ok0.10.patch --- ukui-search-4.10.14.0/debian/patches/0017-Update-changelog-ukui-search4.10.14.0-ok0.10.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-search-4.10.14.0/debian/patches/0017-Update-changelog-ukui-search4.10.14.0-ok0.10.patch 2025-03-14 16:32:46.000000000 +0800 @@ -0,0 +1,199 @@ +From: iaom <zhangpengfei@kylinos.cn> +Date: Fri, 14 Mar 2025 16:34:12 +0800 +Subject: Update changelog ukui-search4.10.14.0-ok0.10 + +--- + libsearch/index/pending-file-queue.cpp | 11 +++++++---- + search-ukcc-plugin/CMakeLists.txt | 4 ++-- + search-ukcc-plugin/search.cpp | 14 +++++++++++++- + .../dirwatcher/dir-watcher.cpp | 6 +++--- + .../dirwatcher/search-dir.cpp | 22 ++++++++++++++++------ + ukui-search-service/cgroup-helper.cpp | 20 ++++++++++++++++++++ + ukui-search-service/cgroup-helper.h | 20 ++++++++++++++++++++ + 7 files changed, 81 insertions(+), 16 deletions(-) + +diff --git a/libsearch/index/pending-file-queue.cpp b/libsearch/index/pending-file-queue.cpp +index 406209b..08fdc1d 100644 +--- a/libsearch/index/pending-file-queue.cpp ++++ b/libsearch/index/pending-file-queue.cpp +@@ -40,9 +40,6 @@ PendingFileQueue::PendingFileQueue(QObject *parent) : QThread(parent) + m_cacheTimer->moveToThread(this); + m_minProcessTimer->moveToThread(this); + +- m_fileEventHelper = new RemoteFileEventHelper; +- m_fileEventHelper->moveToThread(this); +- + // connect(this, &PendingFileQueue::cacheTimerStart, m_cacheTimer, f, Qt::DirectConnection); + // connect(this, &PendingFileQueue::minProcessTimerStart, m_minProcessTimer, f,Qt::DirectConnection); + connect(this, SIGNAL(cacheTimerStart()), m_cacheTimer, SLOT(start())); +@@ -53,7 +50,13 @@ PendingFileQueue::PendingFileQueue(QObject *parent) : QThread(parent) + connect(m_cacheTimer, &QTimer::timeout, this, &PendingFileQueue::processCache, Qt::DirectConnection); + connect(m_minProcessTimer, &QTimer::timeout, this, &PendingFileQueue::processCache, Qt::DirectConnection); + +- connect(this, &PendingFileQueue::signalFileEvent, m_fileEventHelper, &RemoteFileEventHelper::handleFileEventRequest); ++ connect(this, &PendingFileQueue::signalFileEvent, [&] (int type, const QString& arg1, const QString& arg2) { ++ if (!m_fileEventHelper) { ++ m_fileEventHelper = new RemoteFileEventHelper; ++ m_fileEventHelper->moveToThread(this); ++ } ++ Q_EMIT m_fileEventHelper->handleFileEventRequest(type,arg1, arg2); ++ }); + } + + PendingFileQueue *PendingFileQueue::getInstance(QObject *parent) +diff --git a/search-ukcc-plugin/CMakeLists.txt b/search-ukcc-plugin/CMakeLists.txt +index a190826..d74f2c1 100644 +--- a/search-ukcc-plugin/CMakeLists.txt ++++ b/search-ukcc-plugin/CMakeLists.txt +@@ -9,7 +9,7 @@ set(UKCC_PLUGIN_EXTERNAL_LIBS "") + set(UKCC_PLUGIN_PC_PKGS gsettings-qt kysdk-qtwidgets kylin-ai-base) + + foreach(PC_LIB IN ITEMS ${UKCC_PLUGIN_PC_PKGS}) +- pkg_check_modules(${PC_LIB} REQUIRED ${PC_LIB}) ++ pkg_check_modules(${PC_LIB} REQUIRED IMPORTED_TARGET ${PC_LIB}) + if(${${PC_LIB}_FOUND}) + include_directories(${${PC_LIB}_INCLUDE_DIRS}) + link_directories(${${PC_LIB}_LIBRARY_DIRS}) +@@ -32,7 +32,7 @@ target_link_libraries(search-ukcc-plugin PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets + gsettings-qt + ukcc +- ${UKCC_PLUGIN_PC_PKGS} ++ ${UKCC_PLUGIN_EXTERNAL_LIBS} + ) + + install(TARGETS search-ukcc-plugin +diff --git a/search-ukcc-plugin/search.cpp b/search-ukcc-plugin/search.cpp +index 1a5fb74..64e4611 100644 +--- a/search-ukcc-plugin/search.cpp ++++ b/search-ukcc-plugin/search.cpp +@@ -922,7 +922,19 @@ void Search::onAddSearchDirBtnClicked() + m_lastSearchDialogDir = selectedDir.left(selectedDir.lastIndexOf("/") + 1); + qDebug() << "======history of search dialog changed into " << m_lastSearchDialogDir; + qDebug() << "Selected a folder in onAddSearchDirBtnClicked(): " << selectedDir; +- int returnCode = setSearchDir(selectedDir, true); ++ ++ QString targetPath(selectedDir); ++ if (QString uDiskPath = "/media"; selectedDir == uDiskPath || selectedDir.startsWith(uDiskPath + "/")) { ++ QFileInfo uDiskPathInfo(uDiskPath); ++ if (uDiskPathInfo.isSymLink()) { ++ QString rightPart = selectedDir.section("/",1, -1, QString::SectionSkipEmpty); ++ targetPath = uDiskPathInfo.symLinkTarget(); ++ if (!targetPath.isEmpty() && !rightPart.isEmpty()) { ++ targetPath = targetPath + "/" + rightPart; ++ } ++ } ++ } ++ int returnCode = setSearchDir(targetPath, true); + switch (returnCode) { + case ReturnCode::Successful: + qDebug() << "Add search folder succeed! path = " << selectedDir; +diff --git a/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp b/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp +index 9591ea8..203b71e 100644 +--- a/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp ++++ b/ukui-search-service-dir-manager/dirwatcher/dir-watcher.cpp +@@ -120,11 +120,11 @@ int DirWatcher::appendSearchDir(const QString &path) + { + SearchDir dir(path); + if (dir.error() == SearchDir::Successful) { +- Q_EMIT this->appendIndexItem(path, dir.getBlackList()); +- qDebug() << "Add search dir:" << path << "blacklist:" << dir.getBlackList(); ++ Q_EMIT this->appendIndexItem(dir.getPath(), dir.getBlackList()); ++ qDebug() << "Add search dir:" << dir.getPath() << "blacklist:" << dir.getBlackList(); + //要添加已索引目录的父目录,先添加索引,再同步配置文件,从而使得下次读取配置文件时不会将子目录排除掉 + for (const QString &searchDir : Config::self()->searchDirs()) { +- if (searchDir.startsWith(path + "/") || path == "/") { ++ if (searchDir.startsWith(dir.getPath() + "/") || dir.getPath() == "/") { + SearchDir subDir(searchDir); + Config::self()->removeDir(subDir); + } +diff --git a/ukui-search-service-dir-manager/dirwatcher/search-dir.cpp b/ukui-search-service-dir-manager/dirwatcher/search-dir.cpp +index e7eee32..b02d336 100644 +--- a/ukui-search-service-dir-manager/dirwatcher/search-dir.cpp ++++ b/ukui-search-service-dir-manager/dirwatcher/search-dir.cpp +@@ -168,13 +168,23 @@ void SearchDir::handleBlackListGenerate() + } + + //处理要添加索引的路径与全局黑名单中路径为父子关系的情况 +- for (const QString& blackListPath : Config::self()->globalBlackList()) { +- if (m_path.startsWith(blackListPath + "/") or m_path == blackListPath) { +- m_error = UnderBlackList; +- return; ++ bool skipBlackListCheck(false); ++ if (QFileInfo uDiskPathInfo("/media"); uDiskPathInfo.isSymLink()) { ++ QString uDiskPath = uDiskPathInfo.symLinkTarget(); //特殊处理不可变下系统的u盘挂载目录 ++ if (m_path.startsWith(uDiskPath + "/") || m_path == uDiskPath) { ++ skipBlackListCheck = true; + } +- if (blackListPath.startsWith(m_path + "/")) { +- m_blackList.append(blackListPath); ++ } ++ ++ if (!skipBlackListCheck) { ++ for (const QString& blackListPath : Config::self()->globalBlackList()) { ++ if (m_path.startsWith(blackListPath + "/") || m_path == blackListPath) { ++ m_error = UnderBlackList; ++ return; ++ } ++ if (blackListPath.startsWith(m_path + "/")) { ++ m_blackList.append(blackListPath); ++ } + } + } + +diff --git a/ukui-search-service/cgroup-helper.cpp b/ukui-search-service/cgroup-helper.cpp +index c446e9c..a01d69d 100644 +--- a/ukui-search-service/cgroup-helper.cpp ++++ b/ukui-search-service/cgroup-helper.cpp +@@ -1,3 +1,23 @@ ++/* ++ * Copyright (C) 2025, KylinSoft Co., Ltd. ++ * ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see <https://www.gnu.org/licenses/>. ++ * ++ * Authors: amingamingaming <wangyiming01@kylinos.cn> ++ * ++ */ ++ + #include "cgroup-helper.h" + #include <QDir> + #include <QDebug> +diff --git a/ukui-search-service/cgroup-helper.h b/ukui-search-service/cgroup-helper.h +index 7e632d7..1dd2ab1 100644 +--- a/ukui-search-service/cgroup-helper.h ++++ b/ukui-search-service/cgroup-helper.h +@@ -1,3 +1,23 @@ ++/* ++ * Copyright (C) 2025, KylinSoft Co., Ltd. ++ * ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see <https://www.gnu.org/licenses/>. ++ * ++ * Authors: amingamingaming <wangyiming01@kylinos.cn> ++ * ++ */ ++ + #ifndef CGROUPHELPER_H + #define CGROUPHELPER_H + #include <QString> diff -Nru ukui-search-4.10.14.0/debian/patches/series ukui-search-4.10.14.0/debian/patches/series --- ukui-search-4.10.14.0/debian/patches/series 2025-02-28 10:35:30.000000000 +0800 +++ ukui-search-4.10.14.0/debian/patches/series 2025-03-14 16:32:46.000000000 +0800 @@ -14,3 +14,4 @@ 0014-Translated-using-Weblate-Vietnamese.patch 0015-Translated-using-Weblate-Vietnamese.patch 0016-Update-changelog-ukui-search4.10.14.0-ok0.9.patch +0017-Update-changelog-ukui-search4.10.14.0-ok0.10.patch