diff options
Diffstat (limited to 'src/categories.cpp')
| -rw-r--r-- | src/categories.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/categories.cpp b/src/categories.cpp index 59291a49..50ba5271 100644 --- a/src/categories.cpp +++ b/src/categories.cpp @@ -188,7 +188,7 @@ int CategoryFactory::addCategory(const QString &name, const std::vector<int> &ne void CategoryFactory::addCategory(int id, const QString &name, const std::vector<int> &nexusIDs, int parentID)
{
- int index = m_Categories.size();
+ int index = static_cast<int>(m_Categories.size());
m_Categories.push_back(Category(index, id, name, nexusIDs, parentID));
for (int nexusID : nexusIDs) {
m_NexusMap[nexusID] = index;
@@ -317,9 +317,11 @@ int CategoryFactory::getCategoryIndex(int ID) const int CategoryFactory::getCategoryID(const QString &name) const
{
- auto iter = std::find_if(m_Categories.begin(), m_Categories.end(), [name] (const Category &cat) -> bool {
+ auto iter = std::find_if(m_Categories.begin(), m_Categories.end(),
+ [name] (const Category &cat) -> bool {
return cat.m_Name == name;
});
+
if (iter != m_Categories.end()) {
return iter->m_ID;
} else {
|
