Commit 9f5e7c4e authored by Alexander Reinholdt's avatar Alexander Reinholdt
Browse files

Damn it, I think I made this mistake already once. Because also user provided...

Damn it, I think I made this mistake already once. Because also user provided URLs can be bookmarked where
e.g. the share name is written in lower case although it is capitalized, we cannot use QUrl::matches() here,
because it does not allow for case insensitive comparison. I added a comment so that I do not forget anymore...

In addition, the argument of Smb4KBookmarkHandler::bookmarksList(QString) was renamed so that is is clearer
what it stands for.
parent fe261763
Pipeline #46171 passed with stage
in 11 minutes and 16 seconds
......@@ -505,7 +505,10 @@ BookmarkPtr Smb4KBookmarkHandler::findBookmarkByUrl(const QUrl &url)
{
for (const BookmarkPtr &b : bookmarksList())
{
if (b->url().matches(url, QUrl::RemoveUserInfo|QUrl::RemovePort))
// NOTE: Since also user provided URLs can be bookmarked, we cannot use
// QUrl::matches() here, because it does not allow for case insensitive
// comparison.
if (QString::compare(url.toString(QUrl::RemoveUserInfo|QUrl::RemovePort), b->url().toString(QUrl::RemoveUserInfo|QUrl::RemovePort), Qt::CaseInsensitive) == 0)
{
bookmark = b;
break;
......@@ -561,7 +564,7 @@ QList<BookmarkPtr> Smb4KBookmarkHandler::bookmarksList() const
}
QList<BookmarkPtr> Smb4KBookmarkHandler::bookmarksList(const QString &category) const
QList<BookmarkPtr> Smb4KBookmarkHandler::bookmarksList(const QString &categoryName) const
{
// Update bookmarks
update();
......@@ -571,7 +574,7 @@ QList<BookmarkPtr> Smb4KBookmarkHandler::bookmarksList(const QString &category)
for (const BookmarkPtr &bookmark : bookmarksList())
{
if (category == bookmark->categoryName())
if (categoryName == bookmark->categoryName())
{
bookmarks << 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