diff --git a/src/gui/tags/TagsView.cpp b/src/gui/tags/TagsView.cpp index d613b4e91..ca57cbf31 100644 --- a/src/gui/tags/TagsView.cpp +++ b/src/gui/tags/TagsView.cpp @@ -83,7 +83,16 @@ void TagsView::NotifyTagsChanged(TagsModel * sender) tempButton->Appearance.Margin.Top += 2; tempButton->Appearance.HorizontalAlign = ui::Appearance::AlignCentre; tempButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle; - tempButton->SetActionCallback({ [this, tag] { c->RemoveTag(tag); } }); + tempButton->SetActionCallback({ [this, tag] { + try + { + c->RemoveTag(tag); + } + catch(TagsModelException & ex) + { + new ErrorMessage("Could not remove tag", ByteString(ex.what()).FromUtf8()); + } + } }); tags.push_back(tempButton); AddComponent(tempButton); } @@ -125,7 +134,3 @@ void TagsView::addTag() } tagInput->SetText(""); } - -TagsView::~TagsView() { -} - diff --git a/src/gui/tags/TagsView.h b/src/gui/tags/TagsView.h index da2366ab4..318491160 100644 --- a/src/gui/tags/TagsView.h +++ b/src/gui/tags/TagsView.h @@ -27,7 +27,6 @@ public: void AttachController(TagsController * c_) { c = c_; } void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override; void NotifyTagsChanged(TagsModel * sender); - virtual ~TagsView(); }; #endif /* TAGSVIEW_H_ */