Skip to content

Commit

Permalink
bookmarks: prevent multiple "*new*" tags from appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
vladisslav2011 committed Nov 13, 2024
1 parent f27c5a1 commit ecc6e08
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/qtgui/bookmarkstaglist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,15 @@ bool BookmarksTagList::RenameSelectedTag()

void BookmarksTagList::AddNewTag()
{
AddTag("*new*");
scrollToBottom();
editItem(item(rowCount()-1, 1));
constexpr const char * newItemName = "*new*";
QList<QTableWidgetItem *> found = findItems(newItemName, Qt::MatchExactly);
if(found.isEmpty())
{
AddTag(newItemName);
scrollToBottom();
editItem(item(rowCount()-1, 1));
}else
editItem(found[0]);
}

void BookmarksTagList::AddTag(QString name, Qt::CheckState checkstate, QColor color)
Expand Down

0 comments on commit ecc6e08

Please sign in to comment.