From deb148f2977a64533a6e6884e37aafd006b5cf8e Mon Sep 17 00:00:00 2001 From: zhangpengfei Date: Wed, 27 Jan 2021 10:22:56 +0800 Subject: [PATCH] Add return message when block an directory which is not in user directory; Update translations. --- debian/changelog | 6 +++ libsearch/global-settings.cpp | 13 +++++- .../libsearch/libukui-search_zh_CN.ts | 14 ++++++- translations/ukui-search/bo.ts | 42 +++++++++---------- translations/ukui-search/tr.ts | 42 +++++++++---------- translations/ukui-search/zh_CN.ts | 40 +++++++++--------- 6 files changed, 88 insertions(+), 69 deletions(-) diff --git a/debian/changelog b/debian/changelog index 803c228..bdb159a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ukui-search (0.0.1+0126) v101; urgency=medium + + * Bugs Fixed. + + -- zhangpengfei Tue, 26 Jan 2021 19:07:13 +0800 + ukui-search (0.0.1+0123) v101; urgency=medium * Bugs Fixed. diff --git a/libsearch/global-settings.cpp b/libsearch/global-settings.cpp index 4b72865..04ca3c2 100644 --- a/libsearch/global-settings.cpp +++ b/libsearch/global-settings.cpp @@ -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; } diff --git a/translations/libsearch/libukui-search_zh_CN.ts b/translations/libsearch/libukui-search_zh_CN.ts index e391e15..b02a82a 100644 --- a/translations/libsearch/libukui-search_zh_CN.ts +++ b/translations/libsearch/libukui-search_zh_CN.ts @@ -4,8 +4,18 @@ GlobalSettings - - Parent folder has been blocked! + + I can't remove an empty path string! + 传入参数不能为空! + + + + I can only search your user directory, it doesn't make any sense if you block an directory which is not in user directory! + 搜索只会搜索用户目录下的文件,屏蔽不在用户目录下的路径是没有意义的! + + + + My parent folder has been blocked! 我的父文件夹已经被屏蔽了! diff --git a/translations/ukui-search/bo.ts b/translations/ukui-search/bo.ts index 4eb2aeb..0419082 100644 --- a/translations/ukui-search/bo.ts +++ b/translations/ukui-search/bo.ts @@ -4,52 +4,52 @@ ContentWidget - + Recently Opened - + Open Quickly - + Commonly Used - + Apps - + Settings - + Files - + Dirs - + File Contents - + Best Matches - + Unknown @@ -70,7 +70,7 @@ - + Search @@ -210,11 +210,6 @@ Cancel - - - Parent folder has been blocked! - - Creating ... @@ -264,33 +259,34 @@ ShowMoreLabel - - + + + Show More... - + Retract - + Loading - + Loading. - + Loading.. - + Loading... diff --git a/translations/ukui-search/tr.ts b/translations/ukui-search/tr.ts index 4eb2aeb..0419082 100644 --- a/translations/ukui-search/tr.ts +++ b/translations/ukui-search/tr.ts @@ -4,52 +4,52 @@ ContentWidget - + Recently Opened - + Open Quickly - + Commonly Used - + Apps - + Settings - + Files - + Dirs - + File Contents - + Best Matches - + Unknown @@ -70,7 +70,7 @@ - + Search @@ -210,11 +210,6 @@ Cancel - - - Parent folder has been blocked! - - Creating ... @@ -264,33 +259,34 @@ ShowMoreLabel - - + + + Show More... - + Retract - + Loading - + Loading. - + Loading.. - + Loading... diff --git a/translations/ukui-search/zh_CN.ts b/translations/ukui-search/zh_CN.ts index ed57b78..dba6d32 100644 --- a/translations/ukui-search/zh_CN.ts +++ b/translations/ukui-search/zh_CN.ts @@ -4,52 +4,52 @@ ContentWidget - + Recently Opened 最近 - + Open Quickly 快速 - + Commonly Used 常用 - + Apps 应用 - + Settings 配置项 - + Files 文件 - + Dirs 文件夹 - + File Contents 文件内容 - + Best Matches 最佳匹配 - + Unknown 未知 @@ -70,7 +70,7 @@ 搜索 - + Search 搜索 @@ -211,9 +211,8 @@ 取消 - Parent folder has been blocked! - 12345 + 12345 Confirm @@ -268,33 +267,34 @@ ShowMoreLabel - - + + + Show More... 显示更多... - + Retract <u>收起< - + Loading 加载中 - + Loading. 加载中. - + Loading.. 加载中.. - + Loading... 加载中...