From 9bc366094091fca69a33240524c9ca9397821063 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 27 Feb 2014 11:30:05 +0200 Subject: [PATCH] Optimization switch - macros Q_UNREACHABLE(). --HG-- branch : feature --- src/dialogs/app/dialoghistory.cpp | 7 +++++++ src/dialogs/app/dialogincrements.cpp | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/dialogs/app/dialoghistory.cpp b/src/dialogs/app/dialoghistory.cpp index 2f97b8367..756cf7982 100644 --- a/src/dialogs/app/dialoghistory.cpp +++ b/src/dialogs/app/dialoghistory.cpp @@ -174,6 +174,7 @@ QString DialogHistory::Record(const VToolRecord &tool) switch ( tool.getTypeTool() ) { case Tool::ArrowTool: + Q_UNREACHABLE(); break; 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 //need add record about details and nodes, but don't show them. case Tool::Detail: + Q_UNREACHABLE(); break; case Tool::UnionDetails: + Q_UNREACHABLE(); break; case Tool::NodeArc: + Q_UNREACHABLE(); break; case Tool::NodePoint: + Q_UNREACHABLE(); break; case Tool::NodeSpline: + Q_UNREACHABLE(); break; case Tool::NodeSplinePath: + Q_UNREACHABLE(); break; default: qWarning()<row = row; switch (column) { - case 0: + case 0: // name item = ui->tableWidgetIncrement->item(row, 0); id = qvariant_cast(item->data(Qt::UserRole)); domElement = doc->elementById(QString().setNum(id)); @@ -439,7 +439,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ) emit haveLiteChange(); } break; - case 2: + case 2: // base itemName = ui->tableWidgetIncrement->item(row, 0); item = ui->tableWidgetIncrement->item(row, column); id = qvariant_cast(itemName->data(Qt::UserRole)); @@ -461,7 +461,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ) } } break; - case 3: + case 3: // ksize itemName = ui->tableWidgetIncrement->item(row, 0); item = ui->tableWidgetIncrement->item(row, column); id = qvariant_cast(itemName->data(Qt::UserRole)); @@ -474,7 +474,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ) emit haveLiteChange(); } break; - case 4: + case 4: // kgrowth itemName = ui->tableWidgetIncrement->item(row, 0); item = ui->tableWidgetIncrement->item(row, column); id = qvariant_cast(itemName->data(Qt::UserRole)); @@ -487,7 +487,7 @@ void DialogIncrements::cellChanged ( qint32 row, qint32 column ) emit haveLiteChange(); } break; - case 5: + case 5: // description itemName = ui->tableWidgetIncrement->item(row, 0); item = ui->tableWidgetIncrement->item(row, column); id = qvariant_cast(itemName->data(Qt::UserRole));