Commit 7183de7e authored by Alexander Reinholdt's avatar Alexander Reinholdt
Browse files

Get rid of redundant update() functions in findBookmark*() functions and improve code there.

parent 0a7d952f
Pipeline #46090 passed with stage
in 11 minutes and 43 seconds
......@@ -498,9 +498,6 @@ void Smb4KBookmarkHandler::readBookmarkList()
BookmarkPtr Smb4KBookmarkHandler::findBookmarkByUrl(const QUrl &url)
{
// Update the bookmarks:
update();
// Find the bookmark:
BookmarkPtr bookmark;
......@@ -508,9 +505,7 @@ BookmarkPtr Smb4KBookmarkHandler::findBookmarkByUrl(const QUrl &url)
{
for (const BookmarkPtr &b : bookmarksList())
{
if (QString::compare(b->url().toString(QUrl::RemoveUserInfo|QUrl::RemovePort),
url.toString(QUrl::RemoveUserInfo|QUrl::RemovePort),
Qt::CaseInsensitive) == 0)
if (b->url().matches(url, QUrl::RemoveUserInfo|QUrl::RemovePort))
{
bookmark = b;
break;
......@@ -524,9 +519,6 @@ BookmarkPtr Smb4KBookmarkHandler::findBookmarkByUrl(const QUrl &url)
BookmarkPtr Smb4KBookmarkHandler::findBookmarkByLabel(const QString &label)
{
// Update the bookmarks:
update();
// Find the bookmark:
BookmarkPtr bookmark;
......@@ -537,10 +529,6 @@ BookmarkPtr Smb4KBookmarkHandler::findBookmarkByLabel(const QString &label)
bookmark = b;
break;
}
else
{
continue;
}
}
return bookmark;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment