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
|
||||
{
|
||||
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)
|
||||
{
|
||||
canAddNewPoint = true;
|
||||
|
@ -416,7 +416,7 @@ void DialogDetail::DeleteItem()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogDetail::DetailIsValid()
|
||||
bool DialogDetail::DetailIsValid() const
|
||||
{
|
||||
if (ui.listWidget->count() < 3)
|
||||
{
|
||||
|
@ -430,10 +430,10 @@ bool DialogDetail::DetailIsValid()
|
|||
}
|
||||
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();
|
||||
QString nextRow = ui.listWidget->item(i+1)->text();
|
||||
const QString previousRow = ui.listWidget->item(i)->text();
|
||||
const QString nextRow = ui.listWidget->item(i+1)->text();
|
||||
|
||||
if (QString::compare(previousRow, nextRow) == 0)
|
||||
{
|
||||
|
@ -446,7 +446,9 @@ 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 lastDetailPoint = ui.listWidget->item(ui.listWidget->count()-1)->text();
|
||||
|
@ -460,3 +462,5 @@ bool DialogDetail::FirstPointEqualLast()
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -74,8 +74,8 @@ private:
|
|||
/** @brief closed keep option about equdistant (closed or not) */
|
||||
bool closed;
|
||||
bool flagWidth;
|
||||
bool DetailIsValid();
|
||||
bool FirstPointEqualLast();
|
||||
bool DetailIsValid() const;
|
||||
bool FirstPointEqualLast() const;
|
||||
|
||||
void NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode,
|
||||
qreal mx = 0, qreal my = 0, bool reverse = false);
|
||||
|
|
Loading…
Reference in New Issue
Block a user