Merge PR #267: Don't compare QUUid with QStrings in an unsafe way
This commit is contained in:
commit
206f53fae3
@ -23,6 +23,7 @@
|
||||
#include "params.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QUuid>
|
||||
|
||||
Params::Params(QObject *parent) :
|
||||
QAbstractListModel(parent)
|
||||
@ -50,7 +51,7 @@ Param *Params::get(int index) const
|
||||
Param *Params::getParam(QString paramTypeId) const
|
||||
{
|
||||
foreach (Param *param, m_params) {
|
||||
if (param->paramTypeId() == paramTypeId) {
|
||||
if (QUuid(param->paramTypeId()) == QUuid(paramTypeId)) {
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,11 +43,11 @@ ParamType *ParamTypes::get(int index) const
|
||||
ParamType *ParamTypes::getParamType(const QString &id) const
|
||||
{
|
||||
foreach (ParamType *paramType, m_paramTypes) {
|
||||
if (paramType->id() == id) {
|
||||
if (paramType->id() == QUuid(id)) {
|
||||
return paramType;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ParamType *ParamTypes::findByName(const QString &name) const
|
||||
@ -57,7 +57,7 @@ ParamType *ParamTypes::findByName(const QString &name) const
|
||||
return paramType;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int ParamTypes::rowCount(const QModelIndex &parent) const
|
||||
|
||||
Reference in New Issue
Block a user