Merge pull request #200 from MouseZhangZh/main

Move headers' reference from source files to header files.
This commit is contained in:
Mouse Zhang 2021-04-16 11:39:04 +08:00 committed by GitHub
commit 82e74f4c6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 27 deletions

View File

@ -20,17 +20,6 @@
* *
*/ */
#include "file-utils.h" #include "file-utils.h"
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QUrl>
#include <QMap>
#include "quazip/quazip.h"
#include <quazip/quazipfile.h>
#include <QDomDocument>
#include <QQueue>
#include "uchardet/uchardet.h"
#include "poppler-qt5.h"
size_t FileUtils::_max_index_count = 0; size_t FileUtils::_max_index_count = 0;

View File

@ -21,13 +21,6 @@
*/ */
#ifndef FILEUTILS_H #ifndef FILEUTILS_H
#define FILEUTILS_H #define FILEUTILS_H
#include "gobject-template.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <QString> #include <QString>
#include <QCryptographicHash> #include <QCryptographicHash>
#include <QIcon> #include <QIcon>
@ -35,8 +28,29 @@
#include <QMimeDatabase> #include <QMimeDatabase>
#include <QMimeType> #include <QMimeType>
#include <QDir> #include <QDir>
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QUrl>
#include <QMap>
#include <QDomDocument>
#include <QQueue>
#include <quazip/quazipfile.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <quazip/quazip.h>
#include <uchardet/uchardet.h>
//#include <poppler-qt5.h>
#include <poppler/qt5/poppler-qt5.h>
#include "libsearch_global.h" #include "libsearch_global.h"
#include "gobject-template.h"
//#define INITIAL_STATE 0 //#define INITIAL_STATE 0
//#define CREATING_INDEX 1 //#define CREATING_INDEX 1
//#define FINISH_CREATING_INDEX 2 //#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 size_t _current_index_count; //this one has been Abandoned,do not use it.
static unsigned short _index_status; static unsigned short _index_status;
// enum class SearchMethod{ DIRECTSEARCH = 0, INDEXSEARCH = 1};
// static SearchMethod searchMethod = FileUtils::SearchMethod::DIRECTSEARCH;
private: private:
FileUtils(); FileUtils();
}; };

View File

@ -17,14 +17,7 @@
* Authors: zhangpengfei <zhangpengfei@kylinos.cn> * Authors: zhangpengfei <zhangpengfei@kylinos.cn>
* *
*/ */
#include <QFileInfo>
#include <QDebug>
#include <QtConcurrent>
#include <QThread>
#include <QUrl>
#include "search-manager.h" #include "search-manager.h"
#include "global-settings.h"
#include "chinese-segmentation.h"
size_t SearchManager::uniqueSymbol1 = 0; size_t SearchManager::uniqueSymbol1 = 0;
size_t SearchManager::uniqueSymbol2 = 0; size_t SearchManager::uniqueSymbol2 = 0;
@ -69,6 +62,8 @@ void SearchManager::onKeywordSearch(QString keyword,QQueue<QString> *searchResul
++uniqueSymbol3; ++uniqueSymbol3;
m_mutex3.unlock(); m_mutex3.unlock();
FileSearch *filesearch; FileSearch *filesearch;
filesearch = new FileSearch(searchResultFile,uniqueSymbol1,keyword,"0",1,0,5); filesearch = new FileSearch(searchResultFile,uniqueSymbol1,keyword,"0",1,0,5);
m_pool.start(filesearch); m_pool.start(filesearch);

View File

@ -31,6 +31,15 @@
#include <thread> #include <thread>
#include <QRunnable> #include <QRunnable>
#include <QThreadPool> #include <QThreadPool>
#include <QFileInfo>
#include <QDebug>
#include <QtConcurrent/QtConcurrent>
#include <QThread>
#include <QUrl>
#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() #define INDEX_PATH (QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+"/.config/org.ukui/ukui-search/index_data").toStdString()

View File

@ -70,8 +70,11 @@ qm_files.files = $$OUT_PWD/.qm/*.qm
INSTALLS += qm_files INSTALLS += qm_files
LIBS += -L$$OUT_PWD/../libsearch -lukui-search \ LIBS += -L$$OUT_PWD/../libchinese-segmentation -lchinese-segmentation \
-L$$OUT_PWD/../libchinese-segmentation -lchinese-segmentation -L$$OUT_PWD/../libsearch -lukui-search
INCLUDEPATH += $$PWD/../libchinese-segmentation
DEPENDPATH += $$PWD/../libchinese-segmentation
INCLUDEPATH += $$PWD/../libsearch INCLUDEPATH += $$PWD/../libsearch
DEPENDPATH += $$PWD/../libsearch DEPENDPATH += $$PWD/../libsearch