forked from openkylin/ukui-search
Fix the problem that path witch is hidden dir or is not exists can be choosen as search&block dir.
This commit is contained in:
parent
94ea037203
commit
35818d321e
|
@ -445,25 +445,25 @@ void Search::initFileDialog()
|
|||
qDebug() << "Selected a folder in onBtnAddClicked(): " << selectedDir;
|
||||
int returnCode = setBlockDir(selectedDir, true);
|
||||
switch (returnCode) {
|
||||
case ReturnCode::Succeed :
|
||||
case ReturnCode::Successful :
|
||||
qDebug() << "Add blocked folder succeed! path = " << selectedDir;
|
||||
getBlockDirs();
|
||||
break;
|
||||
case ReturnCode::PathEmpty :
|
||||
qWarning() << "Add blocked folder failed, choosen path is empty! path = " << selectedDir;
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add blocked folder failed, choosen path is empty!"));
|
||||
break;
|
||||
// case ReturnCode::NotInHomeDir :
|
||||
// qWarning() << "Add blocked folder failed, it is not in home path! path = " << selectedDir;
|
||||
// QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add blocked folder failed, it is not in home path!"));
|
||||
// break;
|
||||
case ReturnCode::ParentExist :
|
||||
case ReturnCode::Duplicated :
|
||||
qWarning() << "Add blocked folder failed, its parent dir is exist! path = " << selectedDir;
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add blocked folder failed, its parent dir is exist!"));
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add blocked folder failed, its parent dir has been added!"));
|
||||
break;
|
||||
case ReturnCode::NotExists :
|
||||
qWarning() << "Add blocked folder failed, it's not exist! path = " << selectedDir;
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add blocked folder failed, choosen path is not exist!"));
|
||||
break;
|
||||
case ReturnCode::HasBeenBlocked :
|
||||
qWarning() << "Add blocked folder failed, it has been already blocked! path = " << selectedDir;
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add blocked folder failed, it has been already blocked!"));
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add blocked folder failed, it has already been blocked!"));
|
||||
break;
|
||||
case ReturnCode::Hidden :
|
||||
qWarning() << "Add blocked folder failed, it has been hidden! path = " << selectedDir;
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add search folder failed, hidden path is not supported!"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -488,24 +488,27 @@ void Search::initFileDialog()
|
|||
qDebug() << "Selected a folder in onAddSearchDirBtnClicked(): " << selectedDir;
|
||||
int returnCode = setSearchDir(selectedDir, true);
|
||||
switch (returnCode) {
|
||||
case 0:
|
||||
case ReturnCode::Successful:
|
||||
qDebug() << "Add search folder succeed! path = " << selectedDir;
|
||||
break;
|
||||
case 1:
|
||||
case ReturnCode::Duplicated:
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add search folder failed, choosen path or its parent dir has been added!"));
|
||||
break;
|
||||
case 2:
|
||||
case ReturnCode::UnderBlackList:
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add search folder failed, choosen path is not supported currently!"));
|
||||
break;
|
||||
case 3:
|
||||
case ReturnCode::RepeatMount1:
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add search folder failed, choosen path is in repeat mounted devices and another path which is in the same device has been added!"));
|
||||
break;
|
||||
case 4:
|
||||
case ReturnCode::RepeatMount2:
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add search folder failed, another path which is in the same device has been added!"));
|
||||
break;
|
||||
case 5:
|
||||
case ReturnCode::NotExists:
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add search folder failed, choosen path is not exists!"));
|
||||
break;
|
||||
case ReturnCode::Hidden :
|
||||
QMessageBox::warning(m_pluginWidget, tr("Warning"), tr("Add search folder failed, hidden path is not supported!"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -542,15 +545,23 @@ void Search::getBlockDirs()
|
|||
*/
|
||||
int Search::setBlockDir(const QString &dirPath, const bool &is_add)
|
||||
{
|
||||
if (!is_add) {
|
||||
if (dirPath.isEmpty()) {
|
||||
return ReturnCode::PathEmpty;
|
||||
if (!QFile::exists(dirPath)) {
|
||||
return ReturnCode::NotExists;
|
||||
}
|
||||
|
||||
QStringList pathSections = dirPath.split("/");
|
||||
for (const QString §ion : pathSections) {
|
||||
if (section.startsWith(".")) {
|
||||
return ReturnCode::Hidden;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_add) {
|
||||
//删除黑名单目录
|
||||
m_dirSettings->remove(dirPath);
|
||||
m_dirSettings->sync();
|
||||
removeBlockDirFromList(dirPath);
|
||||
return ReturnCode::Succeed;
|
||||
return ReturnCode::Successful;
|
||||
}
|
||||
|
||||
QStringList oldBlockList = m_blockDirs;
|
||||
|
@ -561,14 +572,13 @@ int Search::setBlockDir(const QString &dirPath, const bool &is_add)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
for (QString dir : m_blockDirs) {
|
||||
if (dirPath == dir) {
|
||||
return ReturnCode::HasBeenBlocked;
|
||||
}
|
||||
|
||||
if (dirPath.startsWith(dir + "/") || dir == "/") {
|
||||
return ReturnCode::ParentExist;
|
||||
return ReturnCode::Duplicated;
|
||||
}
|
||||
|
||||
//有它的子文件夹已被添加,删除这些子文件夹
|
||||
|
@ -577,10 +587,10 @@ int Search::setBlockDir(const QString &dirPath, const bool &is_add)
|
|||
removeBlockDirFromList(dir);
|
||||
}
|
||||
}
|
||||
m_dirSettings->setValue(dirPath.right(dirPath.length() - 1), "0");
|
||||
m_dirSettings->setValue(dirPath, "0");
|
||||
m_dirSettings->sync();
|
||||
appendBlockDirToList(dirPath);
|
||||
return ReturnCode::Succeed;
|
||||
return ReturnCode::Successful;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -615,7 +625,14 @@ void Search::initSearchDirs()
|
|||
int Search::setSearchDir(const QString &dirPath, const bool isAdd)
|
||||
{
|
||||
if (!m_setSearchDirInterface->isValid()) {
|
||||
return -1;
|
||||
return ReturnCode::DirWatcherError;
|
||||
}
|
||||
|
||||
QStringList pathSections = dirPath.split("/");
|
||||
for (const QString §ion : pathSections) {
|
||||
if (section.startsWith(".")) {
|
||||
return ReturnCode::Hidden;
|
||||
}
|
||||
}
|
||||
|
||||
if (isAdd) {
|
||||
|
@ -653,7 +670,7 @@ int Search::setSearchDir(const QString &dirPath, const bool isAdd)
|
|||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ReturnCode::Successful;
|
||||
}
|
||||
|
||||
void Search::appendSearchDirToList(const QString &path)
|
||||
|
|
|
@ -55,11 +55,15 @@
|
|||
#define CONFIG_FILE "/.config/org.ukui/ukui-search/ukui-search-block-dirs.conf"
|
||||
|
||||
enum ReturnCode {
|
||||
Succeed,
|
||||
PathEmpty,
|
||||
NotInHomeDir,
|
||||
ParentExist,
|
||||
HasBeenBlocked
|
||||
DirWatcherError = -1,
|
||||
Successful,
|
||||
Duplicated,
|
||||
UnderBlackList,
|
||||
RepeatMount1,
|
||||
RepeatMount2,
|
||||
NotExists,
|
||||
HasBeenBlocked,
|
||||
Hidden
|
||||
};
|
||||
|
||||
class Search : public QObject, CommonInterface
|
||||
|
|
|
@ -4,52 +4,52 @@
|
|||
<context>
|
||||
<name>Search</name>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="13"/>
|
||||
<location filename="../search.cpp" line="184"/>
|
||||
<location filename="../search.cpp" line="32"/>
|
||||
<location filename="../search.cpp" line="203"/>
|
||||
<source>Search</source>
|
||||
<translation>འཚོལ་ཞིབ།</translation>
|
||||
<extra-contents_path>/Search/Search</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="220"/>
|
||||
<location filename="../search.cpp" line="239"/>
|
||||
<source>Create index</source>
|
||||
<translation>གསར་འཛུགས་འཚོལ་ཞིབ་བྱེད་པར་ཁྲིད་སྟོན།</translation>
|
||||
<extra-contents_path>/Search/Create index</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="221"/>
|
||||
<location filename="../search.cpp" line="240"/>
|
||||
<source>Creating index can help you getting results quickly.</source>
|
||||
<translation>སྟོན་གྲངས་གསར་སྐྲུན་བྱས་ན་ཁྱོད་ལ་མགྱོགས་མྱུར་ངང་གྲུབ་འབྲས་ཐོབ་པར་རོགས་རམ་བྱེད་ཐུབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="189"/>
|
||||
<location filename="../search.cpp" line="208"/>
|
||||
<source>Default web searching engine</source>
|
||||
<translation>ཁོག་གི་དྲ་ཤོག་གཏོད་པ་བཤེར་འཚོལ་རིགས་དབྱིབས།</translation>
|
||||
<extra-contents_path>/Search/Default web searching engine</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="193"/>
|
||||
<location filename="../search.cpp" line="212"/>
|
||||
<source>baidu</source>
|
||||
<translation>པའེ་ཏུའུ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="194"/>
|
||||
<location filename="../search.cpp" line="213"/>
|
||||
<source>sougou</source>
|
||||
<translation>སོའོ་གོའུ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="195"/>
|
||||
<location filename="../search.cpp" line="214"/>
|
||||
<source>360</source>
|
||||
<translation>360</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="329"/>
|
||||
<location filename="../search.cpp" line="348"/>
|
||||
<source>Block Folders</source>
|
||||
<translation>ལྐོག་བཀོད་མིང་ཐོ།</translation>
|
||||
<extra-contents_path>/Search/Block Folders</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="334"/>
|
||||
<location filename="../search.cpp" line="353"/>
|
||||
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
|
||||
<translation>གཤམ་གྱི་ཡིག་སྣོད་འཚོལ་བཤེར་མི་བྱེད། ཡིག་སྣོད་གསར་སྣོན་དང་གསུབ་འཕྲི་བྱས་ཚེ་ཡིག་ཆའི་དཀར་ཆག་སྒྲིག་འགོད་བྱ་ཐུབ།</translation>
|
||||
</message>
|
||||
|
@ -58,147 +58,159 @@
|
|||
<translation type="vanished">བསལ་འདེམས་ཀྱི་དཀར་ཆག།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="652"/>
|
||||
<location filename="../search.cpp" line="723"/>
|
||||
<location filename="../search.cpp" line="703"/>
|
||||
<location filename="../search.cpp" line="774"/>
|
||||
<source>delete</source>
|
||||
<translation>བསུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="415"/>
|
||||
<location filename="../search.cpp" line="459"/>
|
||||
<location filename="../search.cpp" line="434"/>
|
||||
<location filename="../search.cpp" line="478"/>
|
||||
<source>Directories</source>
|
||||
<translation>དཀར་ཆག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="251"/>
|
||||
<location filename="../search.cpp" line="270"/>
|
||||
<source>File Content Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<extra-contents_path>/Search/File Content Search</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="269"/>
|
||||
<location filename="../search.cpp" line="288"/>
|
||||
<source>show more results that match the keyword</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="267"/>
|
||||
<location filename="../search.cpp" line="286"/>
|
||||
<source>Fuzzy Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="256"/>
|
||||
<location filename="../search.cpp" line="275"/>
|
||||
<source>Precise Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="258"/>
|
||||
<location filename="../search.cpp" line="277"/>
|
||||
<source>show the results that exactly match the keyword</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="296"/>
|
||||
<location filename="../search.cpp" line="315"/>
|
||||
<source>Search Folders</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<extra-contents_path>/Search/Search Folders</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="302"/>
|
||||
<location filename="../search.cpp" line="321"/>
|
||||
<source>Following folders will be searched. You can set it by adding and removing folders.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="416"/>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<source>select blocked folder</source>
|
||||
<translation>བཀག་སྡོམ་བྱས་པའི་ཡིག་སྣོད་གདམ་གསེས</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="417"/>
|
||||
<location filename="../search.cpp" line="461"/>
|
||||
<location filename="../search.cpp" line="436"/>
|
||||
<location filename="../search.cpp" line="480"/>
|
||||
<source>Select</source>
|
||||
<translation>བདམས་ཐོན་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="418"/>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<location filename="../search.cpp" line="437"/>
|
||||
<location filename="../search.cpp" line="481"/>
|
||||
<source>Position: </source>
|
||||
<translation>གོ་གནས་ནི། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="419"/>
|
||||
<location filename="../search.cpp" line="463"/>
|
||||
<location filename="../search.cpp" line="438"/>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<source>FileName: </source>
|
||||
<translation>ཡིག་ཆའི་མིང་ནི། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="420"/>
|
||||
<location filename="../search.cpp" line="464"/>
|
||||
<location filename="../search.cpp" line="439"/>
|
||||
<location filename="../search.cpp" line="483"/>
|
||||
<source>FileType: </source>
|
||||
<translation>ཡིག་ཆའི་རིགས་དབྱིབས་ནི། </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="421"/>
|
||||
<location filename="../search.cpp" line="465"/>
|
||||
<location filename="../search.cpp" line="440"/>
|
||||
<location filename="../search.cpp" line="484"/>
|
||||
<source>Cancel</source>
|
||||
<translation>ཕྱིར་འཐེན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<location filename="../search.cpp" line="443"/>
|
||||
<location filename="../search.cpp" line="447"/>
|
||||
<location filename="../search.cpp" line="476"/>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<location filename="../search.cpp" line="485"/>
|
||||
<location filename="../search.cpp" line="488"/>
|
||||
<location filename="../search.cpp" line="454"/>
|
||||
<location filename="../search.cpp" line="458"/>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<location filename="../search.cpp" line="466"/>
|
||||
<location filename="../search.cpp" line="495"/>
|
||||
<location filename="../search.cpp" line="498"/>
|
||||
<location filename="../search.cpp" line="501"/>
|
||||
<location filename="../search.cpp" line="504"/>
|
||||
<location filename="../search.cpp" line="507"/>
|
||||
<location filename="../search.cpp" line="510"/>
|
||||
<source>Warning</source>
|
||||
<translation>ཐ་ཚིག་སྒྲོག་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<location filename="../search.cpp" line="466"/>
|
||||
<location filename="../search.cpp" line="510"/>
|
||||
<source>Add search folder failed, hidden path is not supported!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add blocked folder failed, choosen path is empty!</source>
|
||||
<translation>སྦྱོར་རྟ་ལྐོག་བཀོད་མིང་ཐོ་ཕམ་ཁ་བསལ་འདེམས་ཀྱི་ཐབས་ལམ་སྟོང་བ་རེད།</translation>
|
||||
<translation type="vanished">སྦྱོར་རྟ་ལྐོག་བཀོད་མིང་ཐོ་ཕམ་ཁ་བསལ་འདེམས་ཀྱི་ཐབས་ལམ་སྟོང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add blocked folder failed, it is not in home path!</source>
|
||||
<translation type="vanished">སྦྱོར་རྟ་ལྐོག་བཀོད་མིང་ཐོ་ཕམ་ཁ་བསལ་འདེམས་ཀྱི་དཀར་ཆག་མི་ཁྱིམ་དཀར་ཆག་འོག།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="443"/>
|
||||
<source>Add blocked folder failed, its parent dir is exist!</source>
|
||||
<location filename="../search.cpp" line="454"/>
|
||||
<source>Add blocked folder failed, its parent dir has been added!</source>
|
||||
<translation>སྦྱོར་རྟ་ལྐོག་བཀོད་མིང་ཐོ་ཕམ་ཁ་བསལ་འདེམས་ཀྱི་དཀར་ཆག་ནི་ལྐོག་བཀོད་མིང་ཐོ་འི་ཁྲོད་ཀྱི་དཀར་ཆག་འོག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="447"/>
|
||||
<source>Add blocked folder failed, it has been already blocked!</source>
|
||||
<location filename="../search.cpp" line="458"/>
|
||||
<source>Add blocked folder failed, choosen path is not exist!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<source>Add blocked folder failed, it has already been blocked!</source>
|
||||
<translation>སྦྱོར་རྟ་ལྐོག་བཀོད་མིང་ཐོ་ཕམ་ཁ་བསལ་འདེམས་ཀྱི་དཀར་ཆག་ནི་ལྐོག་བཀོད་མིང་ཐོ་འི་ཁྲོད་ཀྱི་དཀར་ཆག་འོག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="460"/>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<source>select search folder</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<location filename="../search.cpp" line="498"/>
|
||||
<source>Add search folder failed, choosen path is not supported currently!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="485"/>
|
||||
<location filename="../search.cpp" line="504"/>
|
||||
<source>Add search folder failed, another path which is in the same device has been added!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="476"/>
|
||||
<location filename="../search.cpp" line="495"/>
|
||||
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<location filename="../search.cpp" line="501"/>
|
||||
<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 type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="488"/>
|
||||
<location filename="../search.cpp" line="507"/>
|
||||
<source>Add search folder failed, choosen path is not exists!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -4,193 +4,201 @@
|
|||
<context>
|
||||
<name>Search</name>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="13"/>
|
||||
<location filename="../search.cpp" line="184"/>
|
||||
<location filename="../search.cpp" line="32"/>
|
||||
<location filename="../search.cpp" line="203"/>
|
||||
<source>Search</source>
|
||||
<translation>Search</translation>
|
||||
<extra-contents_path>/Search/Search</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="189"/>
|
||||
<location filename="../search.cpp" line="208"/>
|
||||
<source>Default web searching engine</source>
|
||||
<translation>Default web searching engine</translation>
|
||||
<extra-contents_path>/Search/Default web searching engine</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="193"/>
|
||||
<location filename="../search.cpp" line="212"/>
|
||||
<source>baidu</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="194"/>
|
||||
<location filename="../search.cpp" line="213"/>
|
||||
<source>sougou</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="195"/>
|
||||
<location filename="../search.cpp" line="214"/>
|
||||
<source>360</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="220"/>
|
||||
<location filename="../search.cpp" line="239"/>
|
||||
<source>Create index</source>
|
||||
<translation>Create index</translation>
|
||||
<extra-contents_path>/Search/Create index</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="221"/>
|
||||
<location filename="../search.cpp" line="240"/>
|
||||
<source>Creating index can help you getting results quickly.</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="251"/>
|
||||
<location filename="../search.cpp" line="270"/>
|
||||
<source>File Content Search</source>
|
||||
<translation>File Content Search</translation>
|
||||
<extra-contents_path>/Search/File Content Search</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="256"/>
|
||||
<location filename="../search.cpp" line="275"/>
|
||||
<source>Precise Search</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="258"/>
|
||||
<location filename="../search.cpp" line="277"/>
|
||||
<source>show the results that exactly match the keyword</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="267"/>
|
||||
<location filename="../search.cpp" line="286"/>
|
||||
<source>Fuzzy Search</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="269"/>
|
||||
<location filename="../search.cpp" line="288"/>
|
||||
<source>show more results that match the keyword</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="296"/>
|
||||
<location filename="../search.cpp" line="315"/>
|
||||
<source>Search Folders</source>
|
||||
<translation>Search Folders</translation>
|
||||
<extra-contents_path>/Search/Search Folders</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="302"/>
|
||||
<location filename="../search.cpp" line="321"/>
|
||||
<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="329"/>
|
||||
<location filename="../search.cpp" line="348"/>
|
||||
<source>Block Folders</source>
|
||||
<translation>Block Folders</translation>
|
||||
<extra-contents_path>/Search/Block Folders</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="334"/>
|
||||
<location filename="../search.cpp" line="353"/>
|
||||
<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="415"/>
|
||||
<location filename="../search.cpp" line="459"/>
|
||||
<location filename="../search.cpp" line="434"/>
|
||||
<location filename="../search.cpp" line="478"/>
|
||||
<source>Directories</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="416"/>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<source>select blocked folder</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="417"/>
|
||||
<location filename="../search.cpp" line="461"/>
|
||||
<location filename="../search.cpp" line="436"/>
|
||||
<location filename="../search.cpp" line="480"/>
|
||||
<source>Select</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="418"/>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<location filename="../search.cpp" line="437"/>
|
||||
<location filename="../search.cpp" line="481"/>
|
||||
<source>Position: </source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="419"/>
|
||||
<location filename="../search.cpp" line="463"/>
|
||||
<location filename="../search.cpp" line="438"/>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<source>FileName: </source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="420"/>
|
||||
<location filename="../search.cpp" line="464"/>
|
||||
<location filename="../search.cpp" line="439"/>
|
||||
<location filename="../search.cpp" line="483"/>
|
||||
<source>FileType: </source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="421"/>
|
||||
<location filename="../search.cpp" line="465"/>
|
||||
<location filename="../search.cpp" line="440"/>
|
||||
<location filename="../search.cpp" line="484"/>
|
||||
<source>Cancel</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<location filename="../search.cpp" line="443"/>
|
||||
<location filename="../search.cpp" line="447"/>
|
||||
<location filename="../search.cpp" line="476"/>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<location filename="../search.cpp" line="485"/>
|
||||
<location filename="../search.cpp" line="488"/>
|
||||
<location filename="../search.cpp" line="454"/>
|
||||
<location filename="../search.cpp" line="458"/>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<location filename="../search.cpp" line="466"/>
|
||||
<location filename="../search.cpp" line="495"/>
|
||||
<location filename="../search.cpp" line="498"/>
|
||||
<location filename="../search.cpp" line="501"/>
|
||||
<location filename="../search.cpp" line="504"/>
|
||||
<location filename="../search.cpp" line="507"/>
|
||||
<location filename="../search.cpp" line="510"/>
|
||||
<source>Warning</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<source>Add blocked folder failed, choosen path is empty!</source>
|
||||
<location filename="../search.cpp" line="454"/>
|
||||
<source>Add blocked folder failed, its parent dir has been added!</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="443"/>
|
||||
<source>Add blocked folder failed, its parent dir is exist!</source>
|
||||
<translation></translation>
|
||||
<location filename="../search.cpp" line="458"/>
|
||||
<source>Add blocked folder failed, choosen path is not exist!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="447"/>
|
||||
<source>Add blocked folder failed, it has been already blocked!</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="460"/>
|
||||
<source>select search folder</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="476"/>
|
||||
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<source>Add blocked folder failed, it has already been blocked!</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<source>select search folder</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="495"/>
|
||||
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="498"/>
|
||||
<source>Add search folder failed, choosen path is not supported currently!</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<location filename="../search.cpp" line="501"/>
|
||||
<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="485"/>
|
||||
<location filename="../search.cpp" line="504"/>
|
||||
<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="507"/>
|
||||
<source>Add search folder failed, choosen path is not exists!</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="652"/>
|
||||
<location filename="../search.cpp" line="723"/>
|
||||
<location filename="../search.cpp" line="466"/>
|
||||
<location filename="../search.cpp" line="510"/>
|
||||
<source>Add search folder failed, hidden path is not supported!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="703"/>
|
||||
<location filename="../search.cpp" line="774"/>
|
||||
<source>delete</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
|
|
|
@ -4,52 +4,52 @@
|
|||
<context>
|
||||
<name>Search</name>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="13"/>
|
||||
<location filename="../search.cpp" line="184"/>
|
||||
<location filename="../search.cpp" line="32"/>
|
||||
<location filename="../search.cpp" line="203"/>
|
||||
<source>Search</source>
|
||||
<translation>全局搜索</translation>
|
||||
<extra-contents_path>/Search/Search</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="220"/>
|
||||
<location filename="../search.cpp" line="239"/>
|
||||
<source>Create index</source>
|
||||
<translation>创建索引</translation>
|
||||
<extra-contents_path>/Search/Create index</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="221"/>
|
||||
<location filename="../search.cpp" line="240"/>
|
||||
<source>Creating index can help you getting results quickly.</source>
|
||||
<translation>开启之后可以快速获取搜索结果</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="189"/>
|
||||
<location filename="../search.cpp" line="208"/>
|
||||
<source>Default web searching engine</source>
|
||||
<translation>默认互联网搜索引擎</translation>
|
||||
<extra-contents_path>/Search/Default web searching engine</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="193"/>
|
||||
<location filename="../search.cpp" line="212"/>
|
||||
<source>baidu</source>
|
||||
<translation>百度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="194"/>
|
||||
<location filename="../search.cpp" line="213"/>
|
||||
<source>sougou</source>
|
||||
<translation>搜狗</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="195"/>
|
||||
<location filename="../search.cpp" line="214"/>
|
||||
<source>360</source>
|
||||
<translation>360</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="329"/>
|
||||
<location filename="../search.cpp" line="348"/>
|
||||
<source>Block Folders</source>
|
||||
<translation>排除的文件夹</translation>
|
||||
<extra-contents_path>/Search/Block Folders</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="334"/>
|
||||
<location filename="../search.cpp" line="353"/>
|
||||
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
|
||||
<translation>搜索将不查看以下文件夹,通过添加和删除可以设置排除的文件夹位置</translation>
|
||||
</message>
|
||||
|
@ -58,151 +58,151 @@
|
|||
<translation type="vanished">添加</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="652"/>
|
||||
<location filename="../search.cpp" line="723"/>
|
||||
<location filename="../search.cpp" line="703"/>
|
||||
<location filename="../search.cpp" line="774"/>
|
||||
<source>delete</source>
|
||||
<translation>删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="415"/>
|
||||
<location filename="../search.cpp" line="459"/>
|
||||
<location filename="../search.cpp" line="434"/>
|
||||
<location filename="../search.cpp" line="478"/>
|
||||
<source>Directories</source>
|
||||
<translation>文件夹</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="251"/>
|
||||
<location filename="../search.cpp" line="270"/>
|
||||
<source>File Content Search</source>
|
||||
<translation>搜索文本内容</translation>
|
||||
<extra-contents_path>/Search/File Content Search</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<source>precise Search</source>
|
||||
<translation type="vanished">精确搜索</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="269"/>
|
||||
<location filename="../search.cpp" line="288"/>
|
||||
<source>show more results that match the keyword</source>
|
||||
<translation>显示更多与输入内容匹配的搜索结果</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="267"/>
|
||||
<location filename="../search.cpp" line="286"/>
|
||||
<source>Fuzzy Search</source>
|
||||
<translation>模糊搜索</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="256"/>
|
||||
<location filename="../search.cpp" line="275"/>
|
||||
<source>Precise Search</source>
|
||||
<translation>精确搜索</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="258"/>
|
||||
<location filename="../search.cpp" line="277"/>
|
||||
<source>show the results that exactly match the keyword</source>
|
||||
<translation>仅显示与输入内容完全一致的搜索结果</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="296"/>
|
||||
<location filename="../search.cpp" line="315"/>
|
||||
<source>Search Folders</source>
|
||||
<translation>搜索范围</translation>
|
||||
<extra-contents_path>/Search/Search Folders</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="302"/>
|
||||
<location filename="../search.cpp" line="321"/>
|
||||
<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="416"/>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<source>select blocked folder</source>
|
||||
<translation>选择排除的文件夹</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="417"/>
|
||||
<location filename="../search.cpp" line="461"/>
|
||||
<location filename="../search.cpp" line="436"/>
|
||||
<location filename="../search.cpp" line="480"/>
|
||||
<source>Select</source>
|
||||
<translation>选择</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="418"/>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<location filename="../search.cpp" line="437"/>
|
||||
<location filename="../search.cpp" line="481"/>
|
||||
<source>Position: </source>
|
||||
<translation>位置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="419"/>
|
||||
<location filename="../search.cpp" line="463"/>
|
||||
<location filename="../search.cpp" line="438"/>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<source>FileName: </source>
|
||||
<translation>文件名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="420"/>
|
||||
<location filename="../search.cpp" line="464"/>
|
||||
<location filename="../search.cpp" line="439"/>
|
||||
<location filename="../search.cpp" line="483"/>
|
||||
<source>FileType: </source>
|
||||
<translation>类型</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="421"/>
|
||||
<location filename="../search.cpp" line="465"/>
|
||||
<location filename="../search.cpp" line="440"/>
|
||||
<location filename="../search.cpp" line="484"/>
|
||||
<source>Cancel</source>
|
||||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<location filename="../search.cpp" line="443"/>
|
||||
<location filename="../search.cpp" line="447"/>
|
||||
<location filename="../search.cpp" line="476"/>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<location filename="../search.cpp" line="485"/>
|
||||
<location filename="../search.cpp" line="488"/>
|
||||
<location filename="../search.cpp" line="454"/>
|
||||
<location filename="../search.cpp" line="458"/>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<location filename="../search.cpp" line="466"/>
|
||||
<location filename="../search.cpp" line="495"/>
|
||||
<location filename="../search.cpp" line="498"/>
|
||||
<location filename="../search.cpp" line="501"/>
|
||||
<location filename="../search.cpp" line="504"/>
|
||||
<location filename="../search.cpp" line="507"/>
|
||||
<location filename="../search.cpp" line="510"/>
|
||||
<source>Warning</source>
|
||||
<translation>警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="435"/>
|
||||
<source>Add blocked folder failed, choosen path is empty!</source>
|
||||
<translation>添加失败,选择的路径为空!</translation>
|
||||
<location filename="../search.cpp" line="466"/>
|
||||
<location filename="../search.cpp" line="510"/>
|
||||
<source>Add search folder failed, hidden path is not supported!</source>
|
||||
<translation>添加失败,不支持隐藏目录!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add blocked folder failed, it is not in home path!</source>
|
||||
<translation type="vanished">添加失败,添加的路径不在家目录下!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="443"/>
|
||||
<source>Add blocked folder failed, its parent dir is exist!</source>
|
||||
<location filename="../search.cpp" line="454"/>
|
||||
<source>Add blocked folder failed, its parent dir has been added!</source>
|
||||
<translation>添加失败,父目录已被添加!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="447"/>
|
||||
<source>Add blocked folder failed, it has been already blocked!</source>
|
||||
<location filename="../search.cpp" line="458"/>
|
||||
<source>Add blocked folder failed, choosen path is not exist!</source>
|
||||
<translation>添加失败,要添加的路径不存在!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="462"/>
|
||||
<source>Add blocked folder failed, it has already been blocked!</source>
|
||||
<translation>添加失败,这个文件夹已经被添加过了!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="460"/>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<source>select search folder</source>
|
||||
<translation>选择要搜索的文件夹</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="479"/>
|
||||
<location filename="../search.cpp" line="498"/>
|
||||
<source>Add search folder failed, choosen path is not supported currently!</source>
|
||||
<translation>添加失败!暂不支持该目录!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="485"/>
|
||||
<location filename="../search.cpp" line="504"/>
|
||||
<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="476"/>
|
||||
<location filename="../search.cpp" line="495"/>
|
||||
<source>Add search folder failed, choosen path or its parent dir has been added!</source>
|
||||
<translation>添加失败!该目录或其父目录已被添加!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../search.cpp" line="482"/>
|
||||
<location filename="../search.cpp" line="501"/>
|
||||
<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="488"/>
|
||||
<location filename="../search.cpp" line="507"/>
|
||||
<source>Add search folder failed, choosen path is not exists!</source>
|
||||
<translation>添加失败!要添加的路径不存在!</translation>
|
||||
</message>
|
||||
|
|
|
@ -134,10 +134,12 @@ void SearchDir::handleBlackListGenerate()
|
|||
{
|
||||
QStringList searchDirs = Config::self()->searchDirs();
|
||||
|
||||
//目录已被索引
|
||||
if (searchDirs.contains(m_path)) {
|
||||
m_error = Duplicated;
|
||||
return;
|
||||
//目录已被索引(根目录被添加过直接返回)
|
||||
for (const QString searchDir : searchDirs) {
|
||||
if (searchDir == m_path || searchDir == "/") {
|
||||
m_error = Duplicated;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//根目录特殊处理
|
||||
|
|
Loading…
Reference in New Issue