refact(frontend):优化部分内存占用,删除一些冗余代码

This commit is contained in:
iaom 2023-09-01 11:07:57 +08:00
parent d3375fa031
commit 1354acbc44
23 changed files with 293 additions and 717 deletions

View File

@ -42,7 +42,6 @@ set(UKUI_SEARCH_SRC
model/best-list-model.cpp model/best-list-model.h
model/search-result-manager.cpp model/search-result-manager.h
model/search-result-model.cpp model/search-result-model.h
model/web-search-model.cpp model/web-search-model.h
search-app-widget-plugin/search.cpp search-app-widget-plugin/search.h
ukui-search-dbus-service.cpp ukui-search-dbus-service.h
ukui-search-gui.cpp ukui-search-gui.h

View File

@ -25,16 +25,15 @@ using namespace UkuiSearch;
BestListModel::BestListModel(QObject *parent)
: QAbstractItemModel(parent)
{
m_item = new SearchResultItem;
initConnections();
}
QModelIndex BestListModel::index(int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(parent)
if(row < 0 || row > m_item->m_result_info_list.length() - 1)
if(row < 0 || row > m_items.length() - 1)
return QModelIndex();
return createIndex(row, column, m_item);
return createIndex(row, column, nullptr);
}
QModelIndex BestListModel::parent(const QModelIndex &index) const
@ -45,7 +44,7 @@ QModelIndex BestListModel::parent(const QModelIndex &index) const
int BestListModel::rowCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : (m_isExpanded ? m_item->m_result_info_list.length() : NUM_LIMIT_SHOWN_DEFAULT);
return parent.isValid() ? 0 : (m_isExpanded ? m_items.length() : NUM_LIMIT_SHOWN_DEFAULT);
}
int BestListModel::columnCount(const QModelIndex &parent) const
@ -57,13 +56,13 @@ QVariant BestListModel::data(const QModelIndex &index, int role) const
{
switch(role) {
case Qt::DecorationRole: {
return m_item->m_result_info_list.at(index.row()).icon;
return m_items.at(index.row()).icon;
}
case Qt::DisplayRole: {
return m_item->m_result_info_list.at(index.row()).name;
return m_items.at(index.row()).name;
}
case Qt::ToolTipRole: {
return m_item->m_result_info_list.at(index.row()).name;
return m_items.at(index.row()).name;
}
default:
return QVariant();
@ -73,7 +72,7 @@ QVariant BestListModel::data(const QModelIndex &index, int role) const
const SearchPluginIface::ResultInfo &BestListModel::getInfo(const QModelIndex &index)
{
return m_item->m_result_info_list.at(index.row());
return m_items.at(index.row());
}
const QString &BestListModel::getPluginInfo(const QModelIndex &index)
@ -86,7 +85,7 @@ void BestListModel::setExpanded(const bool &is_expanded)
this->beginResetModel();
m_isExpanded = is_expanded;
this->endResetModel();
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
Q_EMIT this->itemListChanged(m_items.length());
}
const bool &BestListModel::isExpanded()
@ -104,8 +103,8 @@ QStringList BestListModel::getActions(const QModelIndex &index)
QString BestListModel::getKey(const QModelIndex &index)
{
if (m_item->m_result_info_list.length() > index.row() && index.row() >= 0)
return m_item->m_result_info_list.at(index.row()).actionKey;
if (m_items.length() > index.row() && index.row() >= 0)
return m_items.at(index.row()).actionKey;
return NULL;
}
@ -118,19 +117,19 @@ void BestListModel::appendInfo(const QString &pluginId, const SearchPluginIface:
m_plugin_action_key_list.append(info.actionKey);
}
if (m_plugin_id_list.contains(pluginId)) {
if (info.name == m_item->m_result_info_list.at(m_plugin_id_list.lastIndexOf(pluginId)).name) {
if (info.name == m_items.at(m_plugin_id_list.lastIndexOf(pluginId)).name) {
return;
}
// qDebug()<<"plugin ID:"<<pluginId<<"Repalce result. name ="<<info.name;
this->beginResetModel();
m_item->m_result_info_list.replace(m_plugin_id_list.lastIndexOf(pluginId), info);
m_items.replace(m_plugin_id_list.lastIndexOf(pluginId), info);
this->endResetModel();
return;
}
this->beginResetModel();
// qDebug()<<"plugin ID:"<<pluginId<<"Got a result. name ="<<info.name;
m_plugin_id_list.append(pluginId);
m_item->m_result_info_list.append(info);
m_items.append(info);
QVector<SearchPluginIface::ResultInfo> result_info_list_tmp;
QVector<QString> plugin_id_list_tmp;
@ -150,16 +149,16 @@ void BestListModel::appendInfo(const QString &pluginId, const SearchPluginIface:
Q_FOREACH (const QString& plugin, orders) {
if (m_plugin_id_list.contains(plugin)) {
result_info_list_tmp.append(m_item->m_result_info_list.at(m_plugin_id_list.lastIndexOf(plugin)));
result_info_list_tmp.append(m_items.at(m_plugin_id_list.lastIndexOf(plugin)));
plugin_id_list_tmp.append(plugin);
}
}
m_item->m_result_info_list.clear();
m_item->m_result_info_list.swap(result_info_list_tmp);
m_items.clear();
m_items.swap(result_info_list_tmp);
m_plugin_id_list.clear();
m_plugin_id_list.swap(plugin_id_list_tmp);
this->endResetModel();
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
Q_EMIT this->itemListChanged(m_items.length());
}
@ -170,10 +169,10 @@ void BestListModel::removeInfo(const QString &pluginId)
if (index == -1) {
return;
}
m_item->m_result_info_list.removeAt(index);
m_items.removeAt(index);
m_plugin_id_list.removeAll(pluginId);
this->endResetModel();
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
Q_EMIT this->itemListChanged(m_items.length());
}
void BestListModel::moveInfo(const QString &pluginName, const int pos)
@ -191,12 +190,12 @@ void BestListModel::moveInfo(const QString &pluginName, const int pos)
m_plugin_id_list.insert(pos - 1, pluginName);
}
SearchPluginIface::ResultInfo info = m_item->m_result_info_list.at(index);
m_item->m_result_info_list.removeAt(index);
if (pos > m_item->m_result_info_list.size()) {
m_item->m_result_info_list.append(info);
SearchPluginIface::ResultInfo info = m_items.at(index);
m_items.removeAt(index);
if (pos > m_items.size()) {
m_items.append(info);
} else {
m_item->m_result_info_list.insert(pos - 1, info);
m_items.insert(pos - 1, info);
}
this->endResetModel();
}
@ -204,13 +203,13 @@ void BestListModel::moveInfo(const QString &pluginName, const int pos)
void BestListModel::startSearch(const QString &keyword)
{
Q_UNUSED(keyword)
if (!m_item->m_result_info_list.isEmpty()) {
if (!m_items.isEmpty()) {
this->beginResetModel();
m_plugin_id_list.clear();
m_plugin_action_key_list.clear();
m_item->m_result_info_list.clear();
m_items.clear();
this->endResetModel();
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
Q_EMIT this->itemListChanged(m_items.length());
}
}
@ -218,3 +217,9 @@ void BestListModel::initConnections()
{
}
BestListModel::~BestListModel()
{
m_items.clear();
m_items.squeeze();
}

View File

@ -32,7 +32,7 @@ class BestListModel : public QAbstractItemModel
public:
explicit BestListModel(QObject *parent = nullptr);
~BestListModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
@ -62,7 +62,7 @@ Q_SIGNALS:
private:
void initConnections();
SearchResultItem * m_item = nullptr;
QVector<SearchPluginIface::ResultInfo> m_items;
QVector<QString> m_plugin_id_list;
QVector<QString> m_plugin_action_key_list;
bool m_isExpanded = false;

View File

@ -52,6 +52,7 @@ void SearchResultManager::stopSearch()
SearchPluginIface *plugin = SearchPluginManager::getInstance()->getPlugin(m_pluginId);
plugin->stopSearch();
qDebug() << m_pluginId << "stopped";
m_resultQueue->clear();
}
void SearchResultManager::initConnections()
@ -86,4 +87,5 @@ void ReceiveResultThread::run()
Q_EMIT gotResultInfo(oneResult);
}
}
m_resultQueue->clear();
}

View File

@ -23,7 +23,6 @@ using namespace UkuiSearch;
SearchResultModel::SearchResultModel(const QString &plugin_id)
{
m_item = new SearchResultItem;
m_plugin_id = plugin_id;
m_search_manager = new SearchResultManager(plugin_id);
m_timer = new QTimer(this);
@ -34,10 +33,11 @@ SearchResultModel::SearchResultModel(const QString &plugin_id)
QModelIndex SearchResultModel::index(int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(parent)
if(row < 0 || row > m_item->m_result_info_list.length() - 1)
if(row < 0 || row > m_items.length() - 1)
return QModelIndex();
// QVector<SearchPluginIface::ResultInfo> * m_info = &m_result_info_list;
return createIndex(row, column, m_item);
return createIndex(row, column, nullptr);
}
QModelIndex SearchResultModel::parent(const QModelIndex &child) const
@ -48,7 +48,7 @@ QModelIndex SearchResultModel::parent(const QModelIndex &child) const
int SearchResultModel::rowCount(const QModelIndex &index) const
{
return index.isValid() ? 0 : (m_isExpanded ? m_item->m_result_info_list.length() : NUM_LIMIT_SHOWN_DEFAULT);
return index.isValid() ? 0 : (m_isExpanded ? m_items.length() : NUM_LIMIT_SHOWN_DEFAULT);
}
int SearchResultModel::columnCount(const QModelIndex &index) const
@ -58,15 +58,18 @@ int SearchResultModel::columnCount(const QModelIndex &index) const
QVariant SearchResultModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.row() >= m_items.count()) {
return {};
}
switch(role) {
case Qt::DecorationRole: {
return m_item->m_result_info_list.at(index.row()).icon;
return m_items.at(index.row()).icon;
}
case Qt::DisplayRole: {
return m_item->m_result_info_list.at(index.row()).name;
return m_items.at(index.row()).name;
}
case Qt::ToolTipRole: {
return m_item->m_result_info_list.at(index.row()).name;
return m_items.at(index.row()).name;
}
default:
return QVariant();
@ -76,35 +79,37 @@ QVariant SearchResultModel::data(const QModelIndex &index, int role) const
void SearchResultModel::appendInfo(const SearchPluginIface::ResultInfo &info)//TODO 代码逻辑可尝试梳理优化
{
if (m_item->m_result_info_list.length() > 5 //搜索结果大于5个并且搜索结果处于收起状态时只存储数据无需刷新UI
if (m_items.length() > 5 //搜索结果大于5个并且搜索结果处于收起状态时只存储数据无需刷新UI
and !m_isExpanded) {
m_item->m_result_info_list.append(info);
m_items.append(info);
return;
}
if (m_item->m_result_info_list.length() > 50
if (m_items.length() > 50
and m_isExpanded) {//搜索结果大于50个并且搜索结果处于展开状态时只存储数据并启动定时500ms刷新一次UI
m_item->m_result_info_list.append(info);
m_items.append(info);
if (!m_timer->isActive()) {
m_timer->start();
}
return;
}
this->beginResetModel();
m_item->m_result_info_list.append(info);
this->endResetModel();
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
// this->beginResetModel();
beginInsertRows(QModelIndex(), m_items.length(), m_items.length());
m_items.append(info);
// this->endResetModel();
endInsertRows();
Q_EMIT this->itemListChanged(m_items.length());
if (m_plugin_id != "Web Page") {
Q_EMIT this->sendBestListData(m_plugin_id, m_item->m_result_info_list.at(0));
Q_EMIT this->sendBestListData(m_plugin_id, m_items.at(0));
}
}
void SearchResultModel::startSearch(const QString &keyword)
{
if (!m_item->m_result_info_list.isEmpty()) {
if (!m_items.isEmpty()) {
this->beginResetModel();
m_item->m_result_info_list.clear();
m_items.clear();
this->endResetModel();
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
Q_EMIT this->itemListChanged(m_items.length());
}
m_search_manager->startSearch(keyword);
}
@ -114,14 +119,14 @@ void SearchResultModel::initConnections()
connect(this, &SearchResultModel::stopSearch, m_search_manager, &SearchResultManager::stopSearch);
connect(m_search_manager, &SearchResultManager::gotResultInfo, this, &SearchResultModel::appendInfo);
connect(m_timer, &QTimer::timeout, [ = ] () {//500ms刷新一次UI,防止搜索结果数据量过大导致的UI卡顿
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
Q_EMIT this->itemListChanged(m_items.length());
m_timer->stop();
});
}
const SearchPluginIface::ResultInfo &SearchResultModel::getInfo(const QModelIndex &index)
{
return m_item->m_result_info_list.at(index.row());
return m_items.at(index.row());
}
void SearchResultModel::setExpanded(const bool &is_expanded)
@ -129,7 +134,7 @@ void SearchResultModel::setExpanded(const bool &is_expanded)
this->beginResetModel();
m_isExpanded = is_expanded;
this->endResetModel();
Q_EMIT this->itemListChanged(m_item->m_result_info_list.length());
Q_EMIT this->itemListChanged(m_items.length());
}
const bool &SearchResultModel::isExpanded()
@ -143,7 +148,17 @@ void SearchResultModel::refresh()
this->endResetModel();
}
SearchResultItem::SearchResultItem(QObject *parent) : QObject(parent)
void SearchResultModel::stopSearchSlot()
{
beginResetModel();
m_items.clear();
m_items.squeeze();
endResetModel();
Q_EMIT stopSearch();
}
SearchResultModel::~SearchResultModel()
{
m_items.clear();
m_items.squeeze();
}

View File

@ -27,24 +27,12 @@
namespace UkuiSearch {
class SearchResultItem : public QObject {
friend class SearchResultModel;
friend class BestListModel;
friend class WebSearchModel;
Q_OBJECT
public:
explicit SearchResultItem(QObject *parent = nullptr);
~SearchResultItem() = default;
private:
//此插件所有搜索结果<具体信息>
QVector<SearchPluginIface::ResultInfo> m_result_info_list;
};
class SearchResultModel : public QAbstractItemModel
{
Q_OBJECT
public:
SearchResultModel(const QString &plugin_id);
~SearchResultModel() = default;
~SearchResultModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &child) const override;
int rowCount(const QModelIndex &parent) const override;
@ -59,6 +47,7 @@ public:
public Q_SLOTS:
void appendInfo(const SearchPluginIface::ResultInfo &);
void startSearch(const QString &);
void stopSearchSlot();
Q_SIGNALS:
void stopSearch();
@ -67,7 +56,7 @@ Q_SIGNALS:
private:
void initConnections();
SearchResultItem * m_item = nullptr;
QVector<SearchPluginIface::ResultInfo> m_items;
QString m_plugin_id;
SearchResultManager * m_search_manager = nullptr;
bool m_isExpanded = false;

View File

@ -1,86 +0,0 @@
/*
*
* Copyright (C) 2021, 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: jixiaoxu <jixiaoxu@kylinos.cn>
*
*/
#include "web-search-model.h"
#include <QDebug>
using namespace UkuiSearch;
WebSearchModel::WebSearchModel(QObject *parent)
: QAbstractItemModel(parent)
{
m_item = new SearchResultItem;
}
QModelIndex WebSearchModel::index(int row, int column, const QModelIndex &parent) const
{
Q_UNUSED(parent)
if(row < 0 || row > m_item->m_result_info_list.length() - 1)
return QModelIndex();
return createIndex(row, column, m_item);
}
QModelIndex WebSearchModel::parent(const QModelIndex &index) const
{
Q_UNUSED(index)
return QModelIndex();
}
int WebSearchModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid()) {
return 0;
}
else
return 1;
}
int WebSearchModel::columnCount(const QModelIndex &parent) const
{
return parent.isValid() ? 0 : 1;
}
QVariant WebSearchModel::data(const QModelIndex &index, int role) const
{
switch(role) {
case Qt::DecorationRole: {
return m_item->m_result_info_list.at(index.row()).icon;
}
case Qt::DisplayRole: {
return m_item->m_result_info_list.at(index.row()).name;
}
case Qt::ToolTipRole: {
return m_item->m_result_info_list.at(index.row()).name;
}
default:
return QVariant();
}
return QVariant();
}
void WebSearchModel::startSearch(const QString &keyword)
{
this->beginResetModel();
m_item->m_result_info_list.clear();
SearchPluginIface::ResultInfo info;
info.icon = QIcon(":/res/icons/edit-find-symbolic.svg");
info.name = keyword;
m_item->m_result_info_list.append(info);
this->endResetModel();
}

View File

@ -1,50 +0,0 @@
/*
*
* Copyright (C) 2023, 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/>.
*
*
*/
#ifndef WEBSEARCHMODEL_H
#define WEBSEARCHMODEL_H
#include <QAbstractItemModel>
#include <QIcon>
#include <QLabel>
#include "search-result-model.h"
namespace UkuiSearch {
class WebSearchModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit WebSearchModel(QObject *parent = nullptr);
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
public Q_SLOTS:
void startSearch(const QString &);
private:
SearchResultItem * m_item = nullptr;
};
}
#endif // WEBSEARCHMODEL_H

View File

@ -423,7 +423,7 @@ void ResultView::initConnections()
m_styleDelegate->setSearchKeyword(keyword);
m_model->startSearch(keyword);
});
connect(this, &ResultView::stopSearch, m_model, &SearchResultModel::stopSearch);
connect(this, &ResultView::stopSearch, m_model, &SearchResultModel::stopSearchSlot);
//connect(this->selectionModel(), &QItemSelectionModel::selectionChanged, this, &ResultView::onRowSelectedSlot);
connect(this, &ResultView::clicked, this, &ResultView::onRowSelectedSlot);
connect(this, &ResultView::activated, this, &ResultView::onRowDoubleClickedSlot);

View File

@ -1,237 +0,0 @@
/*
* Copyright (C) 2020, 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: sunfengsheng <sunfengsheng@kylinos.cn>
*
*/
#include "app-match.h"
#include <glib.h>
#include <qt5xdg/XdgIcon>
#include <qt5xdg/XdgDesktopFile>
#include <QMap>
#include "file-utils.h"
#include "app-search-plugin.h"
using namespace UkuiSearch;
static AppMatch *app_match_Class = nullptr;
AppMatch *AppMatch::getAppMatch() {
if(!app_match_Class) {
app_match_Class = new AppMatch;
}
return app_match_Class;
}
AppMatch::AppMatch(QObject *parent) : QThread(parent)
// m_versionCommand(new QProcess(this))
{
qDBusRegisterMetaType<QMap<QString, QString>>();
qDBusRegisterMetaType<QList<QMap<QString, QString>>>();
m_interFace = new QDBusInterface("com.kylin.softwarecenter.getsearchresults", "/com/kylin/softwarecenter/getsearchresults",
"com.kylin.getsearchresults",
QDBusConnection::sessionBus());
if(!m_interFace->isValid()) {
qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message());
}
m_interFace->setTimeout(1500);
m_appInfoTable = new AppInfoTable;
qDebug() << "AppMatch init finished.";
}
AppMatch::~AppMatch() {
if(m_interFace) {
delete m_interFace;
}
m_interFace = NULL;
if(m_appInfoTable) {
delete m_appInfoTable;
}
m_appInfoTable = NULL;
}
void AppMatch::startMatchApp(QString input, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult) {
appNameMatch(input, uniqueSymbol, searchResult);
slotDBusCallFinished(input, uniqueSymbol, searchResult);
qDebug() << "App match finished!";
}
/**
* @brief AppMatch::appNameMatch
*
* @param appname
*
*/
void AppMatch::appNameMatch(QString keyWord, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult) {
QStringList results;
//m_appInfoTable->searchInstallAppOrderByFavoritesDesc(keyWord, results);
for (int i = 0; i < results.size() / 3; i++) {
{
QMutexLocker locker(&AppSearchPlugin::m_mutex);
if (uniqueSymbol != AppSearchPlugin::uniqueSymbol) {
return;
}
}
SearchPluginIface::ResultInfo ri;
ri.actionKey = results.at(i*3);
ri.name = results.at(i*3 + 1);
ri.icon = XdgIcon::fromTheme(results.at(i*3 + 2), QIcon(":/res/icons/desktop.png"));
ri.type = 0;
searchResult->enqueue(ri);
}
/* QMultiMap<QString, QStringList> installAppMap;
m_appInfoTable->getInstallAppMap(installAppMap);
QMap<NameString, QStringList> resultAppMap;
for (auto i = installAppMap.begin(); i != installAppMap.end(); ++i) {
NameString name;
name.app_name = i.key();
QStringList infoList;
infoList = i.value();
resultAppMap.insert(name, infoList);
}
QMapIterator<NameString, QStringList> iter(resultAppMap);
while(iter.hasNext()) {
iter.next();
if(iter.key().app_name.contains(keyWord, Qt::CaseInsensitive)) {
SearchPluginIface::ResultInfo ri;
creatResultInfo(ri, iter, true);
AppSearchPlugin::m_mutex.lock();
if (uniqueSymbol == AppSearchPlugin::uniqueSymbol) {
searchResult->enqueue(ri);
AppSearchPlugin::m_mutex.unlock();
continue;
} else {
AppSearchPlugin::m_mutex.unlock();
return;
}
}
if(iter.value().at(3) == ""){
continue;
}
QStringList pinyinlist;
pinyinlist = FileUtils::findMultiToneWords(iter.value().at(3));
bool matched = false;
for(int i = 0; i < pinyinlist.size() / 2; i++) {
QString shouzimu = pinyinlist.at(2 * i + 1); // 中文转首字母
if(shouzimu.contains(keyWord, Qt::CaseInsensitive)) {
SearchPluginIface::ResultInfo ri;
creatResultInfo(ri, iter, true);
AppSearchPlugin::m_mutex.lock();
if (uniqueSymbol == AppSearchPlugin::uniqueSymbol) {
searchResult->enqueue(ri);
AppSearchPlugin::m_mutex.unlock();
matched = true;
break;
} else {
AppSearchPlugin::m_mutex.unlock();
return;
}
}
if(keyWord.size() < 2)
break;
QString pinyin = pinyinlist.at(2 * i); // 中文转拼音
if(pinyin.contains(keyWord, Qt::CaseInsensitive)) {
SearchPluginIface::ResultInfo ri;
AppSearchPlugin::m_mutex.lock();
creatResultInfo(ri, iter, true);
if (uniqueSymbol == AppSearchPlugin::uniqueSymbol) {
searchResult->enqueue(ri);
AppSearchPlugin::m_mutex.unlock();
matched = true;
break;
} else {
AppSearchPlugin::m_mutex.unlock();
return;
}
}
}
if(matched) {
continue;
}
QStringList tmpList;
tmpList << iter.value().at(2) << iter.value().at(3);
for(QString s : tmpList) {
if(s.contains(keyWord, Qt::CaseInsensitive)) {
SearchPluginIface::ResultInfo ri;
AppSearchPlugin::m_mutex.lock();
creatResultInfo(ri, iter, true);
if (uniqueSymbol == AppSearchPlugin::uniqueSymbol) {
searchResult->enqueue(ri);
AppSearchPlugin::m_mutex.unlock();
break;
} else {
AppSearchPlugin::m_mutex.unlock();
return;
}
}
}
}*/
}
void AppMatch::slotDBusCallFinished(QString keyWord, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult) {
QDBusReply<QList<QMap<QString, QString>>> reply = m_interFace->call("get_search_result", keyWord); //阻塞,直到远程方法调用完成。
if(reply.isValid()) {
parseSoftWareCenterReturn(reply.value(), uniqueSymbol, searchResult);
} else {
qWarning() << "SoftWareCenter dbus called failed!";
}
}
void AppMatch::parseSoftWareCenterReturn(QList<QMap<QString, QString>> list, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult) {
qDebug() << "Begin parseSoftWareCenterReturn";
QLocale locale;
for(int i = 0; i < list.size(); i++) {
SearchPluginIface::ResultInfo ri;
if(locale.language() == QLocale::Chinese) {
ri.name = list.at(i).value("displayname_cn");
} else {
ri.name = list.at(i).value("appname");
}
ri.icon = !(QIcon(list.at(i).value("icon")).isNull()) ? QIcon(list.at(i).value("icon")) : QIcon(":/res/icons/desktop.png");
SearchPluginIface::DescriptionInfo di;
di.key = QString(tr("Application Description:"));
di.value = list.at(i).value("discription");
ri.description.append(di);
ri.actionKey = list.at(i).value("appname");
ri.type = 1; //1 means not installed apps.
AppSearchPlugin::m_mutex.lock();
if (uniqueSymbol == AppSearchPlugin::uniqueSymbol) {
searchResult->enqueue(ri);
AppSearchPlugin::m_mutex.unlock();
} else {
AppSearchPlugin::m_mutex.unlock();
break;
}
}
}
//void AppMatch::creatResultInfo(SearchPluginIface::ResultInfo &ri, QMapIterator<NameString, QStringList> &iter, bool isInstalled)
//{
//// ri.icon = QIcon::fromTheme(iter.value().at(1), QIcon(":/res/icons/desktop.png"));
// ri.icon = XdgIcon::fromTheme(iter.value().at(1), QIcon(":/res/icons/desktop.png"));
// ri.name = iter.key().app_name;
// ri.actionKey = iter.value().at(0);
// ri.type = 0; //0 means installed apps.
//}
void AppMatch::run() {
qDebug() << "App map init..";
qDebug() << "App map init finished..";
}

View File

@ -1,61 +0,0 @@
/*
* Copyright (C) 2020, 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: sunfengsheng <sunfengsheng@kylinos.cn>
*
*/
#ifndef APPMATCH_H
#define APPMATCH_H
#include <QObject>
#include <QDir>
#include <QLocale>
#include <QDebug>
#include <QDBusInterface>
#include <QDBusReply>
#include <QtDBus>
#include <QThread>
#include "search-plugin-iface.h"
#include "../appdata/app-info-table.h"
namespace UkuiSearch {
class AppMatch : public QThread {
Q_OBJECT
public:
static AppMatch *getAppMatch();
void startMatchApp(QString input, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult);
protected:
void run() override;
private:
explicit AppMatch(QObject *parent = nullptr);
~AppMatch();
void getAllDesktopFilePath(QString path);
void appNameMatch(QString keyWord, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult);
void parseSoftWareCenterReturn(QList<QMap<QString, QString>> list, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult);
//void creatResultInfo(SearchPluginIface::ResultInfo &ri, QMapIterator<UkuiSearch::NameString, QStringList> &iter, bool isInstalled = true);
QString m_sourceText;
size_t m_uniqueSymbol;
DataQueue<SearchPluginIface::ResultInfo> *m_search_result = nullptr;
QDBusInterface *m_interFace = nullptr;
private Q_SLOTS:
void slotDBusCallFinished(QString keyWord, size_t uniqueSymbol, DataQueue<SearchPluginIface::ResultInfo> *searchResult);
};
}
#endif // APPMATCH_H

View File

@ -205,6 +205,7 @@ void AppSearchPlugin::run()
m_searchResult->enqueue(ri);
}
}
m_appSearchResults->clear();
}
void AppSearchPlugin::initDetailPage()

View File

@ -39,7 +39,6 @@ namespace UkuiSearch {
class LIBSEARCH_EXPORT AppSearchPlugin : public QThread, public SearchPluginIface
{
friend class AppSearch;
friend class AppMatch;
Q_OBJECT
public:
AppSearchPlugin(QObject *parent = nullptr);

View File

@ -21,7 +21,6 @@
#define LIBSEARCH_H
#include "libsearch_global.h"
#include "appsearch/app-match.h"
#include "file-utils.h"
#include "global-settings.h"

View File

@ -40,7 +40,7 @@ public:
inline void clear() {
QMutexLocker locker(&m_mutex);
QList<T>::clear();
return;
QList<T>::reserve(QList<T>::size());
}
inline bool isEmpty() {
QMutexLocker locker(&m_mutex);

View File

@ -70,6 +70,10 @@ public:
actionKey = actionKeyToSet;
type = typeToSet;
}
~ResultInfo() {
description.clear();
description.squeeze();
}
};
virtual ~SearchPluginIface() {}

View File

@ -42,13 +42,13 @@
<translation>360</translation>
</message>
<message>
<location filename="../search.cpp" line="377"/>
<location filename="../search.cpp" line="388"/>
<source>Block Folders</source>
<translation></translation>
<extra-contents_path>/Search/Block Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="382"/>
<location filename="../search.cpp" line="393"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation> </translation>
</message>
@ -57,14 +57,14 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../search.cpp" line="698"/>
<location filename="../search.cpp" line="769"/>
<location filename="../search.cpp" line="709"/>
<location filename="../search.cpp" line="780"/>
<source>delete</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="427"/>
<location filename="../search.cpp" line="471"/>
<location filename="../search.cpp" line="438"/>
<location filename="../search.cpp" line="482"/>
<source>Directories</source>
<translation></translation>
</message>
@ -74,106 +74,106 @@
<extra-contents_path>/Search/File Content Search</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="318"/>
<location filename="../search.cpp" line="328"/>
<source>show more results that match the keyword</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="316"/>
<location filename="../search.cpp" line="325"/>
<source>Fuzzy Search</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="254"/>
<location filename="../search.cpp" line="255"/>
<source>Create file index</source>
<translation></translation>
<extra-contents_path>/Search/Create file index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="277"/>
<location filename="../search.cpp" line="280"/>
<source>Create file content index</source>
<translation></translation>
<extra-contents_path>/Search/Create file content index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="305"/>
<location filename="../search.cpp" line="312"/>
<source>Precise Search</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="307"/>
<location filename="../search.cpp" line="315"/>
<source>show the results that exactly match the keyword</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="344"/>
<location filename="../search.cpp" line="355"/>
<source>Search Folders</source>
<translation></translation>
<extra-contents_path>/Search/Search Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="350"/>
<location filename="../search.cpp" line="361"/>
<source>Following folders will be searched. You can set it by adding and removing folders.</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="428"/>
<location filename="../search.cpp" line="439"/>
<source>select blocked folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="429"/>
<location filename="../search.cpp" line="473"/>
<location filename="../search.cpp" line="440"/>
<location filename="../search.cpp" line="484"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="430"/>
<location filename="../search.cpp" line="474"/>
<location filename="../search.cpp" line="441"/>
<location filename="../search.cpp" line="485"/>
<source>Position: </source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="431"/>
<location filename="../search.cpp" line="475"/>
<location filename="../search.cpp" line="442"/>
<location filename="../search.cpp" line="486"/>
<source>FileName: </source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="432"/>
<location filename="../search.cpp" line="476"/>
<location filename="../search.cpp" line="443"/>
<location filename="../search.cpp" line="487"/>
<source>FileType: </source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="433"/>
<location filename="../search.cpp" line="477"/>
<location filename="../search.cpp" line="444"/>
<location filename="../search.cpp" line="488"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="458"/>
<location filename="../search.cpp" line="462"/>
<location filename="../search.cpp" line="466"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="499"/>
<location filename="../search.cpp" line="502"/>
<location filename="../search.cpp" line="505"/>
<location filename="../search.cpp" line="508"/>
<location filename="../search.cpp" line="511"/>
<location filename="../search.cpp" line="514"/>
<location filename="../search.cpp" line="517"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="514"/>
<source>Add search folder failed, hidden&#x3000;path is not supported!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="517"/>
<source>Add search folder failed, permission denied!</source>
<translation></translation>
</message>
@ -186,47 +186,47 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="458"/>
<source>Add blocked folder failed, its parent dir has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="462"/>
<source>Add blocked folder failed, choosen path is not exist!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="466"/>
<source>Add blocked folder failed, it has already been blocked!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="472"/>
<location filename="../search.cpp" line="483"/>
<source>select search folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="502"/>
<source>Add search folder failed, choosen path is not supported currently!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="508"/>
<source>Add search folder failed, another path which is in the same device has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="499"/>
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="505"/>
<source>Add search folder failed, choosen path is in repeat mounted devices and another path which is in the same device has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="511"/>
<source>Add search folder failed, choosen path is not exists!</source>
<translation></translation>
</message>

View File

@ -43,174 +43,174 @@
<extra-contents_path>/Search/File Content Search</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="305"/>
<location filename="../search.cpp" line="312"/>
<source>Precise Search</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="307"/>
<location filename="../search.cpp" line="315"/>
<source>show the results that exactly match the keyword</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="316"/>
<location filename="../search.cpp" line="325"/>
<source>Fuzzy Search</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="318"/>
<location filename="../search.cpp" line="328"/>
<source>show more results that match the keyword</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="344"/>
<location filename="../search.cpp" line="355"/>
<source>Search Folders</source>
<translation>Search Folders</translation>
<extra-contents_path>/Search/Search Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="350"/>
<location filename="../search.cpp" line="361"/>
<source>Following folders will be searched. You can set it by adding and removing folders.</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="377"/>
<location filename="../search.cpp" line="388"/>
<source>Block Folders</source>
<translation>Block Folders</translation>
<extra-contents_path>/Search/Block Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="382"/>
<location filename="../search.cpp" line="393"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="427"/>
<location filename="../search.cpp" line="471"/>
<location filename="../search.cpp" line="438"/>
<location filename="../search.cpp" line="482"/>
<source>Directories</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="428"/>
<location filename="../search.cpp" line="439"/>
<source>select blocked folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="429"/>
<location filename="../search.cpp" line="473"/>
<location filename="../search.cpp" line="440"/>
<location filename="../search.cpp" line="484"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="430"/>
<location filename="../search.cpp" line="474"/>
<location filename="../search.cpp" line="441"/>
<location filename="../search.cpp" line="485"/>
<source>Position: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="431"/>
<location filename="../search.cpp" line="475"/>
<location filename="../search.cpp" line="442"/>
<location filename="../search.cpp" line="486"/>
<source>FileName: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="432"/>
<location filename="../search.cpp" line="476"/>
<location filename="../search.cpp" line="443"/>
<location filename="../search.cpp" line="487"/>
<source>FileType: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="433"/>
<location filename="../search.cpp" line="477"/>
<location filename="../search.cpp" line="444"/>
<location filename="../search.cpp" line="488"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="458"/>
<location filename="../search.cpp" line="462"/>
<location filename="../search.cpp" line="466"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="499"/>
<location filename="../search.cpp" line="502"/>
<location filename="../search.cpp" line="505"/>
<location filename="../search.cpp" line="508"/>
<location filename="../search.cpp" line="511"/>
<location filename="../search.cpp" line="514"/>
<location filename="../search.cpp" line="517"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="458"/>
<source>Add blocked folder failed, its parent dir has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="462"/>
<source>Add blocked folder failed, choosen path is not exist!</source>
<translation>Add blocked folder failed, choosen path is not exist!</translation>
</message>
<message>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="466"/>
<source>Add blocked folder failed, it has already been blocked!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="472"/>
<location filename="../search.cpp" line="483"/>
<source>select search folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="499"/>
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="502"/>
<source>Add search folder failed, choosen path is not supported currently!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="505"/>
<source>Add search folder failed, choosen path is in repeat mounted devices and another path which is in the same device has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="508"/>
<source>Add search folder failed, another path which is in the same device has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="511"/>
<source>Add search folder failed, choosen path is not exists!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="514"/>
<source>Add search folder failed, hidden&#x3000;path is not supported!</source>
<translation>Add search folder failed, hidden&#x3000;path is not supported!</translation>
</message>
<message>
<location filename="../search.cpp" line="254"/>
<location filename="../search.cpp" line="255"/>
<source>Create file index</source>
<translation>Create file index</translation>
<extra-contents_path>/Search/Create file index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="277"/>
<location filename="../search.cpp" line="280"/>
<source>Create file content index</source>
<translation>Create file content index</translation>
<extra-contents_path>/Search/Create file content index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="517"/>
<source>Add search folder failed, permission denied!</source>
<translation>Add search folder failed, permission denied!</translation>
</message>
<message>
<location filename="../search.cpp" line="698"/>
<location filename="../search.cpp" line="769"/>
<location filename="../search.cpp" line="709"/>
<location filename="../search.cpp" line="780"/>
<source>delete</source>
<translation></translation>
</message>

View File

@ -42,25 +42,25 @@
<translation>360</translation>
</message>
<message>
<location filename="../search.cpp" line="254"/>
<location filename="../search.cpp" line="255"/>
<source>Create file index</source>
<translation> </translation>
<extra-contents_path>/Search/Create file index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="277"/>
<location filename="../search.cpp" line="280"/>
<source>Create file content index</source>
<translation> </translation>
<extra-contents_path>/Search/Create file content index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="377"/>
<location filename="../search.cpp" line="388"/>
<source>Block Folders</source>
<translation> </translation>
<extra-contents_path>/Search/Block Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="382"/>
<location filename="../search.cpp" line="393"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation> </translation>
</message>
@ -69,14 +69,14 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../search.cpp" line="698"/>
<location filename="../search.cpp" line="769"/>
<location filename="../search.cpp" line="709"/>
<location filename="../search.cpp" line="780"/>
<source>delete</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="427"/>
<location filename="../search.cpp" line="471"/>
<location filename="../search.cpp" line="438"/>
<location filename="../search.cpp" line="482"/>
<source>Directories</source>
<translation></translation>
</message>
@ -86,139 +86,139 @@
<extra-contents_path>/Search/File Content Search</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="305"/>
<location filename="../search.cpp" line="312"/>
<source>Precise Search</source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="307"/>
<location filename="../search.cpp" line="315"/>
<source>show the results that exactly match the keyword</source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="316"/>
<location filename="../search.cpp" line="325"/>
<source>Fuzzy Search</source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="318"/>
<location filename="../search.cpp" line="328"/>
<source>show more results that match the keyword</source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="344"/>
<location filename="../search.cpp" line="355"/>
<source>Search Folders</source>
<translation> </translation>
<extra-contents_path>/Search/Search Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="350"/>
<location filename="../search.cpp" line="361"/>
<source>Following folders will be searched. You can set it by adding and removing folders.</source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="428"/>
<location filename="../search.cpp" line="439"/>
<source>select blocked folder</source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="429"/>
<location filename="../search.cpp" line="473"/>
<location filename="../search.cpp" line="440"/>
<location filename="../search.cpp" line="484"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="430"/>
<location filename="../search.cpp" line="474"/>
<location filename="../search.cpp" line="441"/>
<location filename="../search.cpp" line="485"/>
<source>Position: </source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="431"/>
<location filename="../search.cpp" line="475"/>
<location filename="../search.cpp" line="442"/>
<location filename="../search.cpp" line="486"/>
<source>FileName: </source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="432"/>
<location filename="../search.cpp" line="476"/>
<location filename="../search.cpp" line="443"/>
<location filename="../search.cpp" line="487"/>
<source>FileType: </source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="433"/>
<location filename="../search.cpp" line="477"/>
<location filename="../search.cpp" line="444"/>
<location filename="../search.cpp" line="488"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="458"/>
<location filename="../search.cpp" line="462"/>
<location filename="../search.cpp" line="466"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="499"/>
<location filename="../search.cpp" line="502"/>
<location filename="../search.cpp" line="505"/>
<location filename="../search.cpp" line="508"/>
<location filename="../search.cpp" line="511"/>
<location filename="../search.cpp" line="514"/>
<location filename="../search.cpp" line="517"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="458"/>
<source>Add blocked folder failed, its parent dir has been added!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="462"/>
<source>Add blocked folder failed, choosen path is not exist!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="466"/>
<source>Add blocked folder failed, it has already been blocked!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="514"/>
<source>Add search folder failed, hidden&#x3000;path is not supported!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="472"/>
<location filename="../search.cpp" line="483"/>
<source>select search folder</source>
<translation> </translation>
</message>
<message>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="499"/>
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="502"/>
<source>Add search folder failed, choosen path is not supported currently!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="505"/>
<source>Add search folder failed, choosen path is in repeat mounted devices and another path which is in the same device has been added!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="508"/>
<source>Add search folder failed, another path which is in the same device has been added!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="511"/>
<source>Add search folder failed, choosen path is not exists!</source>
<translation> !</translation>
</message>
<message>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="517"/>
<source>Add search folder failed, permission denied!</source>
<translation> !</translation>
</message>

View File

@ -42,13 +42,13 @@
<translation>360</translation>
</message>
<message>
<location filename="../search.cpp" line="377"/>
<location filename="../search.cpp" line="388"/>
<source>Block Folders</source>
<translation></translation>
<extra-contents_path>/Search/Block Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="382"/>
<location filename="../search.cpp" line="393"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation></translation>
</message>
@ -57,14 +57,14 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../search.cpp" line="698"/>
<location filename="../search.cpp" line="769"/>
<location filename="../search.cpp" line="709"/>
<location filename="../search.cpp" line="780"/>
<source>delete</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="427"/>
<location filename="../search.cpp" line="471"/>
<location filename="../search.cpp" line="438"/>
<location filename="../search.cpp" line="482"/>
<source>Directories</source>
<translation></translation>
</message>
@ -74,151 +74,151 @@
<extra-contents_path>/Search/File Content Search</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="318"/>
<location filename="../search.cpp" line="328"/>
<source>show more results that match the keyword</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="316"/>
<location filename="../search.cpp" line="325"/>
<source>Fuzzy Search</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="254"/>
<location filename="../search.cpp" line="255"/>
<source>Create file index</source>
<translation></translation>
<extra-contents_path>/Search/Create file index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="277"/>
<location filename="../search.cpp" line="280"/>
<source>Create file content index</source>
<translation></translation>
<extra-contents_path>/Search/Create file content index</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="305"/>
<location filename="../search.cpp" line="312"/>
<source>Precise Search</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="307"/>
<location filename="../search.cpp" line="315"/>
<source>show the results that exactly match the keyword</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="344"/>
<location filename="../search.cpp" line="355"/>
<source>Search Folders</source>
<translation></translation>
<extra-contents_path>/Search/Search Folders</extra-contents_path>
</message>
<message>
<location filename="../search.cpp" line="350"/>
<location filename="../search.cpp" line="361"/>
<source>Following folders will be searched. You can set it by adding and removing folders.</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="428"/>
<location filename="../search.cpp" line="439"/>
<source>select blocked folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="429"/>
<location filename="../search.cpp" line="473"/>
<location filename="../search.cpp" line="440"/>
<location filename="../search.cpp" line="484"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="430"/>
<location filename="../search.cpp" line="474"/>
<location filename="../search.cpp" line="441"/>
<location filename="../search.cpp" line="485"/>
<source>Position: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="431"/>
<location filename="../search.cpp" line="475"/>
<location filename="../search.cpp" line="442"/>
<location filename="../search.cpp" line="486"/>
<source>FileName: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="432"/>
<location filename="../search.cpp" line="476"/>
<location filename="../search.cpp" line="443"/>
<location filename="../search.cpp" line="487"/>
<source>FileType: </source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="433"/>
<location filename="../search.cpp" line="477"/>
<location filename="../search.cpp" line="444"/>
<location filename="../search.cpp" line="488"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="458"/>
<location filename="../search.cpp" line="462"/>
<location filename="../search.cpp" line="466"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="499"/>
<location filename="../search.cpp" line="502"/>
<location filename="../search.cpp" line="505"/>
<location filename="../search.cpp" line="508"/>
<location filename="../search.cpp" line="511"/>
<location filename="../search.cpp" line="514"/>
<location filename="../search.cpp" line="517"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="459"/>
<location filename="../search.cpp" line="503"/>
<location filename="../search.cpp" line="470"/>
<location filename="../search.cpp" line="514"/>
<source>Add search folder failed, hidden&#x3000;path is not supported!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="506"/>
<location filename="../search.cpp" line="517"/>
<source>Add search folder failed, permission denied!</source>
<translation>访</translation>
</message>
<message>
<location filename="../search.cpp" line="447"/>
<location filename="../search.cpp" line="458"/>
<source>Add blocked folder failed, its parent dir has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="451"/>
<location filename="../search.cpp" line="462"/>
<source>Add blocked folder failed, choosen path is not exist!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="455"/>
<location filename="../search.cpp" line="466"/>
<source>Add blocked folder failed, it has already been blocked!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="472"/>
<location filename="../search.cpp" line="483"/>
<source>select search folder</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="491"/>
<location filename="../search.cpp" line="502"/>
<source>Add search folder failed, choosen path is not supported currently!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="497"/>
<location filename="../search.cpp" line="508"/>
<source>Add search folder failed, another path which is in the same device has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="488"/>
<location filename="../search.cpp" line="499"/>
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="494"/>
<location filename="../search.cpp" line="505"/>
<source>Add search folder failed, choosen path is in repeat mounted devices and another path which is in the same device has been added!</source>
<translation></translation>
</message>
<message>
<location filename="../search.cpp" line="500"/>
<location filename="../search.cpp" line="511"/>
<source>Add search folder failed, choosen path is not exists!</source>
<translation></translation>
</message>

View File

@ -17,34 +17,33 @@
<context>
<name>UkuiSearch::AppMatch</name>
<message>
<location filename="../../libsearch/appsearch/app-match.cpp" line="208"/>
<source>Application Description:</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>UkuiSearch::AppSearchPlugin</name>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
<source>Add Shortcut to Desktop</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
<source>Add Shortcut to Panel</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="34"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="251"/>
<source>Install</source>
<translation></translation>
</message>

View File

@ -17,9 +17,8 @@
<context>
<name>UkuiSearch::AppMatch</name>
<message>
<location filename="../../libsearch/appsearch/app-match.cpp" line="208"/>
<source>Application Description:</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
</context>
<context>
@ -33,25 +32,25 @@
<name>UkuiSearch::AppSearchPlugin</name>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
<source>Add Shortcut to Desktop</source>
<translation> </translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
<source>Add Shortcut to Panel</source>
<translation> </translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="34"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="251"/>
<source>Install</source>
<translation></translation>
</message>

View File

@ -17,9 +17,8 @@
<context>
<name>UkuiSearch::AppMatch</name>
<message>
<location filename="../../libsearch/appsearch/app-match.cpp" line="208"/>
<source>Application Description:</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
</context>
<context>
@ -33,25 +32,25 @@
<name>UkuiSearch::AppSearchPlugin</name>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="31"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="247"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
<source>Open</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="32"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="248"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
<source>Add Shortcut to Desktop</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="33"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="249"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
<source>Add Shortcut to Panel</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="34"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="250"/>
<location filename="../../libsearch/appsearch/app-search-plugin.cpp" line="251"/>
<source>Install</source>
<translation></translation>
</message>