From fcb5aa414219aa4af17bf63f808d80016f310733 Mon Sep 17 00:00:00 2001 From: iaom Date: Wed, 19 Apr 2023 15:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=BA=9B=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsearch/filesystemwatcher/file-system-watcher.cpp | 2 +- libsearch/mailsearch/mail-search-plugin.cpp | 1 + libsearch/notesearch/note-search-plugin.cpp | 1 + libsearch/searchinterface/result-item.cpp | 12 ++++++++++++ libsearch/searchinterface/result-item.h | 5 ++++- .../searchtasks/file-content-search-task.cpp | 1 + libsearch/settingsearch/settings-search-plugin.cpp | 1 + libsearch/websearch/web-search-plugin.cpp | 1 + 8 files changed, 22 insertions(+), 2 deletions(-) diff --git a/libsearch/filesystemwatcher/file-system-watcher.cpp b/libsearch/filesystemwatcher/file-system-watcher.cpp index f4fe84e..503e3f5 100644 --- a/libsearch/filesystemwatcher/file-system-watcher.cpp +++ b/libsearch/filesystemwatcher/file-system-watcher.cpp @@ -311,7 +311,7 @@ void FileSystemWatcher::eventProcess(int socket) } if (event->mask & EventModify) { // qDebug() << path << "--EventModify"; - if(!event->mask & IN_ISDIR) { + if(!(event->mask & IN_ISDIR)) { Q_EMIT modified(path); } } diff --git a/libsearch/mailsearch/mail-search-plugin.cpp b/libsearch/mailsearch/mail-search-plugin.cpp index 5b63529..9408a5c 100644 --- a/libsearch/mailsearch/mail-search-plugin.cpp +++ b/libsearch/mailsearch/mail-search-plugin.cpp @@ -18,6 +18,7 @@ * */ #include "mail-search-plugin.h" +#include #include "file-utils.h" #include "chinese-segmentation.h" using namespace UkuiSearch; diff --git a/libsearch/notesearch/note-search-plugin.cpp b/libsearch/notesearch/note-search-plugin.cpp index d263312..c6ab657 100644 --- a/libsearch/notesearch/note-search-plugin.cpp +++ b/libsearch/notesearch/note-search-plugin.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "file-utils.h" #include "chinese-segmentation.h" using namespace UkuiSearch; diff --git a/libsearch/searchinterface/result-item.cpp b/libsearch/searchinterface/result-item.cpp index 176fd26..65e9a6c 100644 --- a/libsearch/searchinterface/result-item.cpp +++ b/libsearch/searchinterface/result-item.cpp @@ -76,3 +76,15 @@ ResultItem::~ResultItem() ResultItem::ResultItem(const ResultItem &item): d(new ResultItemPrivate(*item.d)) { } + +ResultItem &ResultItem::operator=(const ResultItem &other) +{ + *d = *other.d; + return *this; +} +ResultItem &ResultItem::operator=(ResultItem &&other) Q_DECL_NOEXCEPT +{ + d = other.d; + other.d = nullptr; + return *this; +} diff --git a/libsearch/searchinterface/result-item.h b/libsearch/searchinterface/result-item.h index 6711115..5a38c03 100644 --- a/libsearch/searchinterface/result-item.h +++ b/libsearch/searchinterface/result-item.h @@ -30,10 +30,13 @@ public: explicit ResultItem(); virtual ~ResultItem(); - ResultItem(const ResultItem &item); explicit ResultItem(const size_t searchId); explicit ResultItem(const QString &itemKey); ResultItem(const size_t searchId, const QString &itemKey, const SearchResultPropertyMap &map); + ResultItem(const ResultItem &item); + ResultItem &operator=(const ResultItem &other); + ResultItem &operator=(ResultItem &&other) Q_DECL_NOEXCEPT; + void setSearchId(const size_t searchId); void setItemKey(const QString &itemKey); size_t getSearchId() const; diff --git a/libsearch/searchinterface/searchtasks/file-content-search-task.cpp b/libsearch/searchinterface/searchtasks/file-content-search-task.cpp index 1d72a4c..15c1211 100644 --- a/libsearch/searchinterface/searchtasks/file-content-search-task.cpp +++ b/libsearch/searchinterface/searchtasks/file-content-search-task.cpp @@ -29,6 +29,7 @@ //Qt #include #include +#include using namespace UkuiSearch; diff --git a/libsearch/settingsearch/settings-search-plugin.cpp b/libsearch/settingsearch/settings-search-plugin.cpp index 1d35b13..8ded2d4 100644 --- a/libsearch/settingsearch/settings-search-plugin.cpp +++ b/libsearch/settingsearch/settings-search-plugin.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "settings-search-plugin.h" #include "file-utils.h" diff --git a/libsearch/websearch/web-search-plugin.cpp b/libsearch/websearch/web-search-plugin.cpp index 1024e97..ac4eff2 100644 --- a/libsearch/websearch/web-search-plugin.cpp +++ b/libsearch/websearch/web-search-plugin.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "web-search-plugin.h" #include "global-settings.h" #define WEB_ENGINE_KEY "webEngine"