From 154203f44b7b507eedbf1d3491ab64d655a79f5b Mon Sep 17 00:00:00 2001 From: Mouse Zhang Date: Fri, 16 Apr 2021 11:20:14 +0800 Subject: [PATCH] Move headers' reference from source files to header files. --- libsearch/file-utils.cpp | 11 ----------- libsearch/file-utils.h | 31 +++++++++++++++++++++++------- libsearch/index/search-manager.cpp | 9 ++------- libsearch/index/search-manager.h | 9 +++++++++ src/src.pro | 7 +++++-- 5 files changed, 40 insertions(+), 27 deletions(-) diff --git a/libsearch/file-utils.cpp b/libsearch/file-utils.cpp index 41c5110..6c89018 100644 --- a/libsearch/file-utils.cpp +++ b/libsearch/file-utils.cpp @@ -20,17 +20,6 @@ * */ #include "file-utils.h" -#include -#include -#include -#include -#include -#include "quazip/quazip.h" -#include -#include -#include -#include "uchardet/uchardet.h" -#include "poppler-qt5.h" size_t FileUtils::_max_index_count = 0; diff --git a/libsearch/file-utils.h b/libsearch/file-utils.h index 76b093e..223be43 100644 --- a/libsearch/file-utils.h +++ b/libsearch/file-utils.h @@ -21,13 +21,6 @@ */ #ifndef FILEUTILS_H #define FILEUTILS_H -#include "gobject-template.h" -#include -#include -#include -#include -#include -#include #include #include #include @@ -35,8 +28,29 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include #include "libsearch_global.h" +#include "gobject-template.h" + //#define INITIAL_STATE 0 //#define CREATING_INDEX 1 //#define FINISH_CREATING_INDEX 2 @@ -74,6 +88,9 @@ public: static size_t _current_index_count; //this one has been Abandoned,do not use it. static unsigned short _index_status; +// enum class SearchMethod{ DIRECTSEARCH = 0, INDEXSEARCH = 1}; +// static SearchMethod searchMethod = FileUtils::SearchMethod::DIRECTSEARCH; + private: FileUtils(); }; diff --git a/libsearch/index/search-manager.cpp b/libsearch/index/search-manager.cpp index d0a5e59..b8202cb 100644 --- a/libsearch/index/search-manager.cpp +++ b/libsearch/index/search-manager.cpp @@ -17,14 +17,7 @@ * Authors: zhangpengfei * */ -#include -#include -#include -#include -#include #include "search-manager.h" -#include "global-settings.h" -#include "chinese-segmentation.h" size_t SearchManager::uniqueSymbol1 = 0; size_t SearchManager::uniqueSymbol2 = 0; @@ -69,6 +62,8 @@ void SearchManager::onKeywordSearch(QString keyword,QQueue *searchResul ++uniqueSymbol3; m_mutex3.unlock(); + + FileSearch *filesearch; filesearch = new FileSearch(searchResultFile,uniqueSymbol1,keyword,"0",1,0,5); m_pool.start(filesearch); diff --git a/libsearch/index/search-manager.h b/libsearch/index/search-manager.h index 8c63ea2..9698e10 100644 --- a/libsearch/index/search-manager.h +++ b/libsearch/index/search-manager.h @@ -31,6 +31,15 @@ #include #include #include +#include +#include +#include +#include +#include + +#include "file-utils.h" +#include "global-settings.h" +#include "chinese-segmentation.h" #define INDEX_PATH (QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+"/.config/org.ukui/ukui-search/index_data").toStdString() diff --git a/src/src.pro b/src/src.pro index 9b1133f..8a4b878 100644 --- a/src/src.pro +++ b/src/src.pro @@ -68,8 +68,11 @@ qm_files.files = $$OUT_PWD/.qm/*.qm INSTALLS += qm_files -LIBS += -L$$OUT_PWD/../libsearch -lukui-search \ - -L$$OUT_PWD/../libchinese-segmentation -lchinese-segmentation +LIBS += -L$$OUT_PWD/../libchinese-segmentation -lchinese-segmentation \ + -L$$OUT_PWD/../libsearch -lukui-search + +INCLUDEPATH += $$PWD/../libchinese-segmentation +DEPENDPATH += $$PWD/../libchinese-segmentation INCLUDEPATH += $$PWD/../libsearch DEPENDPATH += $$PWD/../libsearch