Skip to content

Commit

Permalink
fix: address bar completer issues
Browse files Browse the repository at this point in the history
1.remove repeat records in history list.
2.exact match input ip str by change regular expression.

Log: fix address bar completer issue
Bug: https://pms.uniontech.com/bug-view-273343.html
     https://pms.uniontech.com/bug-view-273409.html
     https://pms.uniontech.com/bug-view-273339.html
  • Loading branch information
Lighto-Ku authored and deepin-bot[bot] committed Sep 20, 2024
1 parent 6cd2f53 commit 5897199
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void AddressBarPrivate::initUiForSizeMode()

void AddressBarPrivate::initData()
{
ipRegExp.setPattern(R"(((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3})");
protocolIPRegExp.setPattern(R"(((smb)|(ftp)|(sftp))(://)((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3})");
ipRegExp.setPattern(R"(^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$)");
protocolIPRegExp.setPattern(R"(^((smb)|(ftp)|(sftp))(://)((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$)");
protocolIPRegExp.setPatternOptions(QRegularExpression::CaseInsensitiveOption);

// 设置补全组件
Expand Down Expand Up @@ -532,7 +532,7 @@ void AddressBarPrivate::onReturnPressed()
if (DConfigManager::instance()->value(DConfigSearch::kSearchCfgPath,
DConfigSearch::kDisplaySearchHistory, true)
.toBool()) {
if (!historyList.contains(text))
if (historyList.contains(text))
historyList.removeAll(text);
historyList.append(text);
isHistoryInCompleterModel = false;
Expand Down

0 comments on commit 5897199

Please sign in to comment.