Require torrent category creation to be explicit

This commit is contained in:
Thomas Piccirello
2018-07-23 01:48:35 -04:00
parent ee57b68901
commit d89ef22d85
2 changed files with 6 additions and 4 deletions

View File

@@ -1214,10 +1214,8 @@ bool TorrentHandle::setCategory(const QString &category)
{
if (m_category != category) {
if (!category.isEmpty()) {
if (!Session::isValidCategoryName(category)) return false;
if (!m_session->categories().contains(category))
if (!m_session->addCategory(category))
return false;
if (!Session::isValidCategoryName(category) || !m_session->categories().contains(category))
return false;
}
QString oldCategory = m_category;