Skip to content
Commit 575a0f34 authored by Vishesh Handa's avatar Vishesh Handa
Browse files

KEditTagsDialog: Use the uri not the label as the unique identifier

The EditTags dialog used the Resource::genericLabel() as the unique
identifier when accessing tags. It would save this genericLabel in the
Qt::UserRole of the QListWidgetItem. This caused the following problems -

* When removing a tag, the tag would be identified via Tag(genericLabel),
  this will NOT always give the correct tag back. Mainly cause
  Tag(QString) operates on the nao:identifier not the genericLabel.
  Quite often the genericLabel and the nao:identifier are the same, so
  this wouldn't always be a problem.

  By using Tag(genericLabel) we try to delete a tag with nao:identifier
  genericLabel, which didn't actually exist.

* When saving tags, it would create each tag with the Tag(genericLabel),
  this would normally be fine, unless there exists a tag whose
  nao:identifier and genericLabel are not the same. In that case the tag
  would be duplicated, and since the user only sees the genericLabel, it
  would result in 2 identical tags being shown.

* When saving the tags, it would try and re-create each tag which was
  being returned. This resulted in a lot of unnecessary Tag::setLabel
  calls which cause unnecessary writes, and slow down the entire
  process. This can get especially slow when marking a file with a large
  number of tags. We now only set the label of the tags which do not
  already exist.

BUG: 312606
BUG: 313635
parent e33c4ae6
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