Changed some methods to be const
--HG-- branch : feature
This commit is contained in:
parent
e323afc4e6
commit
c6577675e7
|
@ -179,7 +179,7 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString previousItemName = ui.listWidget->item(ui.listWidget->count()-1)->text();
|
const QString previousItemName = ui.listWidget->item(ui.listWidget->count()-1)->text();
|
||||||
if(QString::compare(previousItemName, name) != 0)
|
if(QString::compare(previousItemName, name) != 0)
|
||||||
{
|
{
|
||||||
canAddNewPoint = true;
|
canAddNewPoint = true;
|
||||||
|
@ -416,7 +416,7 @@ void DialogDetail::DeleteItem()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool DialogDetail::DetailIsValid()
|
bool DialogDetail::DetailIsValid() const
|
||||||
{
|
{
|
||||||
if (ui.listWidget->count() < 3)
|
if (ui.listWidget->count() < 3)
|
||||||
{
|
{
|
||||||
|
@ -430,10 +430,10 @@ bool DialogDetail::DetailIsValid()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i=0; i<ui.listWidget->count()-1; i++)
|
for (int i=0, sz = ui.listWidget->count()-1; i<sz; ++i)
|
||||||
{
|
{
|
||||||
QString previousRow = ui.listWidget->item(i)->text();
|
const QString previousRow = ui.listWidget->item(i)->text();
|
||||||
QString nextRow = ui.listWidget->item(i+1)->text();
|
const QString nextRow = ui.listWidget->item(i+1)->text();
|
||||||
|
|
||||||
if (QString::compare(previousRow, nextRow) == 0)
|
if (QString::compare(previousRow, nextRow) == 0)
|
||||||
{
|
{
|
||||||
|
@ -446,8 +446,10 @@ bool DialogDetail::DetailIsValid()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool DialogDetail::FirstPointEqualLast()
|
bool DialogDetail::FirstPointEqualLast() const
|
||||||
{
|
{
|
||||||
|
if (ui.listWidget->count() > 1)
|
||||||
|
{
|
||||||
const QString firstDetailPoint = ui.listWidget->item(0)->text();
|
const QString firstDetailPoint = ui.listWidget->item(0)->text();
|
||||||
const QString lastDetailPoint = ui.listWidget->item(ui.listWidget->count()-1)->text();
|
const QString lastDetailPoint = ui.listWidget->item(ui.listWidget->count()-1)->text();
|
||||||
|
|
||||||
|
@ -459,4 +461,6 @@ bool DialogDetail::FirstPointEqualLast()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,8 @@ private:
|
||||||
/** @brief closed keep option about equdistant (closed or not) */
|
/** @brief closed keep option about equdistant (closed or not) */
|
||||||
bool closed;
|
bool closed;
|
||||||
bool flagWidth;
|
bool flagWidth;
|
||||||
bool DetailIsValid();
|
bool DetailIsValid() const;
|
||||||
bool FirstPointEqualLast();
|
bool FirstPointEqualLast() const;
|
||||||
|
|
||||||
void NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode,
|
void NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode,
|
||||||
qreal mx = 0, qreal my = 0, bool reverse = false);
|
qreal mx = 0, qreal my = 0, bool reverse = false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user