Optimization switch - macros Q_UNREACHABLE().
--HG-- branch : feature
This commit is contained in:
parent
79f2ddde2a
commit
9bc3660940
|
@ -174,6 +174,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
switch ( tool.getTypeTool() )
|
switch ( tool.getTypeTool() )
|
||||||
{
|
{
|
||||||
case Tool::ArrowTool:
|
case Tool::ArrowTool:
|
||||||
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::SinglePointTool:
|
case Tool::SinglePointTool:
|
||||||
{
|
{
|
||||||
|
@ -435,16 +436,22 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
//Because "history" not only show history of pattern, but help restore current data for each pattern's piece, we
|
//Because "history" not only show history of pattern, but help restore current data for each pattern's piece, we
|
||||||
//need add record about details and nodes, but don't show them.
|
//need add record about details and nodes, but don't show them.
|
||||||
case Tool::Detail:
|
case Tool::Detail:
|
||||||
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::UnionDetails:
|
case Tool::UnionDetails:
|
||||||
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::NodeArc:
|
case Tool::NodeArc:
|
||||||
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::NodePoint:
|
case Tool::NodePoint:
|
||||||
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::NodeSpline:
|
case Tool::NodeSpline:
|
||||||
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::NodeSplinePath:
|
case Tool::NodeSplinePath:
|
||||||
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qWarning()<<tr("Got wrong tool type. Ignore.");
|
qWarning()<<tr("Got wrong tool type. Ignore.");
|
||||||
|
|
|
@ -426,7 +426,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column )
|
||||||
this->row = row;
|
this->row = row;
|
||||||
switch (column)
|
switch (column)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0: // name
|
||||||
item = ui->tableWidgetIncrement->item(row, 0);
|
item = ui->tableWidgetIncrement->item(row, 0);
|
||||||
id = qvariant_cast<quint32>(item->data(Qt::UserRole));
|
id = qvariant_cast<quint32>(item->data(Qt::UserRole));
|
||||||
domElement = doc->elementById(QString().setNum(id));
|
domElement = doc->elementById(QString().setNum(id));
|
||||||
|
@ -439,7 +439,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column )
|
||||||
emit haveLiteChange();
|
emit haveLiteChange();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2: // base
|
||||||
itemName = ui->tableWidgetIncrement->item(row, 0);
|
itemName = ui->tableWidgetIncrement->item(row, 0);
|
||||||
item = ui->tableWidgetIncrement->item(row, column);
|
item = ui->tableWidgetIncrement->item(row, column);
|
||||||
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
||||||
|
@ -461,7 +461,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3: // ksize
|
||||||
itemName = ui->tableWidgetIncrement->item(row, 0);
|
itemName = ui->tableWidgetIncrement->item(row, 0);
|
||||||
item = ui->tableWidgetIncrement->item(row, column);
|
item = ui->tableWidgetIncrement->item(row, column);
|
||||||
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
||||||
|
@ -474,7 +474,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column )
|
||||||
emit haveLiteChange();
|
emit haveLiteChange();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4: // kgrowth
|
||||||
itemName = ui->tableWidgetIncrement->item(row, 0);
|
itemName = ui->tableWidgetIncrement->item(row, 0);
|
||||||
item = ui->tableWidgetIncrement->item(row, column);
|
item = ui->tableWidgetIncrement->item(row, column);
|
||||||
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
||||||
|
@ -487,7 +487,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column )
|
||||||
emit haveLiteChange();
|
emit haveLiteChange();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5: // description
|
||||||
itemName = ui->tableWidgetIncrement->item(row, 0);
|
itemName = ui->tableWidgetIncrement->item(row, 0);
|
||||||
item = ui->tableWidgetIncrement->item(row, column);
|
item = ui->tableWidgetIncrement->item(row, column);
|
||||||
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user