Merge pull request #110 from iaom/0126-dev

Add return message when block an directory which is not in user directory.
This commit is contained in:
张佳萍 2021-01-27 10:26:37 +08:00 committed by GitHub
commit 510568b9c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 88 additions and 69 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
ukui-search (0.0.1+0126) v101; urgency=medium
* Bugs Fixed.
-- zhangpengfei <zhangpengfei@kylinos.cn> Tue, 26 Jan 2021 19:07:13 +0800
ukui-search (0.0.1+0123) v101; urgency=medium
* Bugs Fixed.

View File

@ -84,9 +84,20 @@ bool GlobalSettings::setBlockDirs(const QString &path, QString &returnMessage, b
{
if(remove)
{
if(path.isEmpty())
{
returnMessage = QString(tr("I can't remove an empty path string!"));
return false;
}
m_block_dirs_settings->remove(path);
return true;
}
if(!path.startsWith("/home"))
{
returnMessage = QString(tr("I can only search your user directory, it doesn't make any sense if you block an directory which is not in user directory!"));
return false;
}
//why QSetting's key can't start with "/"??
QString pathKey = path.right(path.length()-1);
@ -96,7 +107,7 @@ bool GlobalSettings::setBlockDirs(const QString &path, QString &returnMessage, b
{
if(pathKey.startsWith(i))
{
returnMessage = QString(tr("Parent folder has been blocked!"));
returnMessage = QString(tr("My parent folder has been blocked!"));
return false;
}

View File

@ -4,8 +4,18 @@
<context>
<name>GlobalSettings</name>
<message>
<location filename="../../libsearch/global-settings.cpp" line="99"/>
<source>Parent folder has been blocked!</source>
<location filename="../../libsearch/global-settings.cpp" line="89"/>
<source>I can&apos;t remove an empty path string!</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/global-settings.cpp" line="98"/>
<source>I can only search your user directory, it doesn&apos;t make any sense if you block an directory which is not in user directory!</source>
<translation></translation>
</message>
<message>
<location filename="../../libsearch/global-settings.cpp" line="110"/>
<source>My parent folder has been blocked!</source>
<translation></translation>
</message>
</context>

View File

@ -4,52 +4,52 @@
<context>
<name>ContentWidget</name>
<message>
<location filename="../../src/content-widget.cpp" line="325"/>
<location filename="../../src/content-widget.cpp" line="307"/>
<source>Recently Opened</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="351"/>
<location filename="../../src/content-widget.cpp" line="333"/>
<source>Open Quickly</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="352"/>
<location filename="../../src/content-widget.cpp" line="334"/>
<source>Commonly Used</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="588"/>
<location filename="../../src/content-widget.cpp" line="576"/>
<source>Apps</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="590"/>
<location filename="../../src/content-widget.cpp" line="578"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="592"/>
<location filename="../../src/content-widget.cpp" line="580"/>
<source>Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="594"/>
<location filename="../../src/content-widget.cpp" line="582"/>
<source>Dirs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="596"/>
<location filename="../../src/content-widget.cpp" line="584"/>
<source>File Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="598"/>
<location filename="../../src/content-widget.cpp" line="586"/>
<source>Best Matches</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="600"/>
<location filename="../../src/content-widget.cpp" line="588"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
@ -70,7 +70,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="163"/>
<location filename="../../src/mainwindow.cpp" line="164"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
@ -210,11 +210,6 @@
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="340"/>
<source>Parent folder has been blocked!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="265"/>
<source>Creating ...</source>
@ -264,33 +259,34 @@
<context>
<name>ShowMoreLabel</name>
<message>
<location filename="../../src/control/show-more-label.cpp" line="22"/>
<location filename="../../src/control/show-more-label.cpp" line="51"/>
<location filename="../../src/control/show-more-label.cpp" line="20"/>
<location filename="../../src/control/show-more-label.cpp" line="28"/>
<location filename="../../src/control/show-more-label.cpp" line="58"/>
<source>Show More...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="49"/>
<location filename="../../src/control/show-more-label.cpp" line="56"/>
<source>Retract</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="60"/>
<location filename="../../src/control/show-more-label.cpp" line="67"/>
<source>Loading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="65"/>
<location filename="../../src/control/show-more-label.cpp" line="72"/>
<source>Loading.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="70"/>
<location filename="../../src/control/show-more-label.cpp" line="77"/>
<source>Loading..</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="75"/>
<location filename="../../src/control/show-more-label.cpp" line="82"/>
<source>Loading...</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,52 +4,52 @@
<context>
<name>ContentWidget</name>
<message>
<location filename="../../src/content-widget.cpp" line="325"/>
<location filename="../../src/content-widget.cpp" line="307"/>
<source>Recently Opened</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="351"/>
<location filename="../../src/content-widget.cpp" line="333"/>
<source>Open Quickly</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="352"/>
<location filename="../../src/content-widget.cpp" line="334"/>
<source>Commonly Used</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="588"/>
<location filename="../../src/content-widget.cpp" line="576"/>
<source>Apps</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="590"/>
<location filename="../../src/content-widget.cpp" line="578"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="592"/>
<location filename="../../src/content-widget.cpp" line="580"/>
<source>Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="594"/>
<location filename="../../src/content-widget.cpp" line="582"/>
<source>Dirs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="596"/>
<location filename="../../src/content-widget.cpp" line="584"/>
<source>File Contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="598"/>
<location filename="../../src/content-widget.cpp" line="586"/>
<source>Best Matches</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="600"/>
<location filename="../../src/content-widget.cpp" line="588"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
@ -70,7 +70,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="163"/>
<location filename="../../src/mainwindow.cpp" line="164"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
@ -210,11 +210,6 @@
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="340"/>
<source>Parent folder has been blocked!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="265"/>
<source>Creating ...</source>
@ -264,33 +259,34 @@
<context>
<name>ShowMoreLabel</name>
<message>
<location filename="../../src/control/show-more-label.cpp" line="22"/>
<location filename="../../src/control/show-more-label.cpp" line="51"/>
<location filename="../../src/control/show-more-label.cpp" line="20"/>
<location filename="../../src/control/show-more-label.cpp" line="28"/>
<location filename="../../src/control/show-more-label.cpp" line="58"/>
<source>Show More...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="49"/>
<location filename="../../src/control/show-more-label.cpp" line="56"/>
<source>Retract</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="60"/>
<location filename="../../src/control/show-more-label.cpp" line="67"/>
<source>Loading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="65"/>
<location filename="../../src/control/show-more-label.cpp" line="72"/>
<source>Loading.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="70"/>
<location filename="../../src/control/show-more-label.cpp" line="77"/>
<source>Loading..</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="75"/>
<location filename="../../src/control/show-more-label.cpp" line="82"/>
<source>Loading...</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,52 +4,52 @@
<context>
<name>ContentWidget</name>
<message>
<location filename="../../src/content-widget.cpp" line="325"/>
<location filename="../../src/content-widget.cpp" line="307"/>
<source>Recently Opened</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="351"/>
<location filename="../../src/content-widget.cpp" line="333"/>
<source>Open Quickly</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="352"/>
<location filename="../../src/content-widget.cpp" line="334"/>
<source>Commonly Used</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="588"/>
<location filename="../../src/content-widget.cpp" line="576"/>
<source>Apps</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="590"/>
<location filename="../../src/content-widget.cpp" line="578"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="592"/>
<location filename="../../src/content-widget.cpp" line="580"/>
<source>Files</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="594"/>
<location filename="../../src/content-widget.cpp" line="582"/>
<source>Dirs</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="596"/>
<location filename="../../src/content-widget.cpp" line="584"/>
<source>File Contents</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="598"/>
<location filename="../../src/content-widget.cpp" line="586"/>
<source>Best Matches</source>
<translation></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="600"/>
<location filename="../../src/content-widget.cpp" line="588"/>
<source>Unknown</source>
<translation></translation>
</message>
@ -70,7 +70,7 @@
<translation></translation>
</message>
<message>
<location filename="../../src/mainwindow.cpp" line="163"/>
<location filename="../../src/mainwindow.cpp" line="164"/>
<source>Search</source>
<translation></translation>
</message>
@ -211,9 +211,8 @@
<translation></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="340"/>
<source>Parent folder has been blocked!</source>
<translation>12345</translation>
<translation type="vanished">12345</translation>
</message>
<message>
<source>Confirm</source>
@ -268,33 +267,34 @@
<context>
<name>ShowMoreLabel</name>
<message>
<location filename="../../src/control/show-more-label.cpp" line="22"/>
<location filename="../../src/control/show-more-label.cpp" line="51"/>
<location filename="../../src/control/show-more-label.cpp" line="20"/>
<location filename="../../src/control/show-more-label.cpp" line="28"/>
<location filename="../../src/control/show-more-label.cpp" line="58"/>
<source>Show More...</source>
<translation>...</translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="49"/>
<location filename="../../src/control/show-more-label.cpp" line="56"/>
<source>Retract</source>
<translation>&lt;u&gt;&lt;</translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="60"/>
<location filename="../../src/control/show-more-label.cpp" line="67"/>
<source>Loading</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="65"/>
<location filename="../../src/control/show-more-label.cpp" line="72"/>
<source>Loading.</source>
<translation>.</translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="70"/>
<location filename="../../src/control/show-more-label.cpp" line="77"/>
<source>Loading..</source>
<translation>..</translation>
</message>
<message>
<location filename="../../src/control/show-more-label.cpp" line="75"/>
<location filename="../../src/control/show-more-label.cpp" line="82"/>
<source>Loading...</source>
<translation>...</translation>
</message>