From 507ccd686e6237f6d8474b54900cb4e6fb93bb80 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 16 Jun 2014 20:18:36 +0300 Subject: [PATCH] Vera++. --HG-- branch : develop --- src/app/container/calculator.cpp | 8 +- src/app/dialogs/app/dialogaboutapp.cpp | 146 +++++++++--------- src/app/dialogs/app/dialogaboutapp.h | 110 ++++++------- src/app/dialogs/app/dialogpatternxmledit.cpp | 8 +- src/app/dialogs/app/pages.cpp | 26 ++-- src/app/dialogs/tools/dialogalongline.cpp | 2 +- src/app/dialogs/tools/dialogarc.cpp | 2 +- src/app/dialogs/tools/dialogbisector.cpp | 2 +- src/app/dialogs/tools/dialogcutarc.cpp | 2 +- .../dialogs/tools/dialogeditwrongformula.h | 3 +- src/app/dialogs/tools/dialogendline.cpp | 4 +- src/app/dialogs/tools/dialognormal.cpp | 2 +- .../dialogs/tools/dialogpointofcontact.cpp | 2 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 2 +- src/app/dialogs/tools/dialogtool.cpp | 6 +- src/app/mainwindow.cpp | 2 +- src/app/tools/drawTools/vdrawtool.cpp | 2 +- src/app/undocommands/savedetailoptions.cpp | 2 - src/app/undocommands/savetooloptions.h | 3 +- src/app/widgets/vapplication.cpp | 44 +++--- src/app/xml/vpattern.cpp | 26 ++-- src/app/xml/vpattern.h | 2 - src/libs/qmuparser/qmuparsercallback.h | 3 +- 23 files changed, 203 insertions(+), 206 deletions(-) diff --git a/src/app/container/calculator.cpp b/src/app/container/calculator.cpp index 80684ef1c..021457d6c 100644 --- a/src/app/container/calculator.cpp +++ b/src/app/container/calculator.cpp @@ -91,7 +91,7 @@ Calculator::Calculator(const QString &formula, bool fromUser) SetVarFactory(AddVariable, this); // Add unary operators - if(fromUser) + if (fromUser) { DefinePostfixOprt(qApp->PostfixOperator(cm_Oprt), CmUnit); DefinePostfixOprt(qApp->PostfixOperator(mm_Oprt), MmUnit); @@ -292,7 +292,7 @@ void Calculator::InitCharacterSets() qreal Calculator::CmUnit(qreal val) { qreal unit = val; - switch(qApp->patternUnit()) + switch (qApp->patternUnit()) { case Unit::Mm: unit = val * 10.0; @@ -313,7 +313,7 @@ qreal Calculator::CmUnit(qreal val) qreal Calculator::MmUnit(qreal val) { qreal unit = val; - switch(qApp->patternUnit()) + switch (qApp->patternUnit()) { case Unit::Mm: break; @@ -334,7 +334,7 @@ qreal Calculator::MmUnit(qreal val) qreal Calculator::InchUnit(qreal val) { qreal unit = val; - switch(qApp->patternUnit()) + switch (qApp->patternUnit()) { case Unit::Mm: unit = val * 25.4; diff --git a/src/app/dialogs/app/dialogaboutapp.cpp b/src/app/dialogs/app/dialogaboutapp.cpp index 614f49efa..251ef9eef 100644 --- a/src/app/dialogs/app/dialogaboutapp.cpp +++ b/src/app/dialogs/app/dialogaboutapp.cpp @@ -1,73 +1,73 @@ -/************************************************************************ - ** - ** @file dialogaboutapp.cpp - ** @author Patrick Proy - ** @date 6 5, 2014 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#include "dialogaboutapp.h" -#include "ui_dialogaboutapp.h" -#include "../../version.h" -#include -#include -#include - -//--------------------------------------------------------------------------------------------------------------------- -DialogAboutApp::DialogAboutApp(QWidget *parent) : - QDialog(parent), - ui(new Ui::DialogAboutApp) -{ - ui->setupUi(this); - - ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION)); - ui->label_QT_Version->setText(tr("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR)); - - QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy")); - ui->label_Valentina_Built->setText(tr("Built on %3 at %4").arg(date.toString()).arg(__TIME__)); - - ui->label_Legal_Stuff->setText(WARRANTY); - - ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR)); - connect(ui->pushButton_Web_Site, &QPushButton::clicked, this, &DialogAboutApp::webButtonClicked ); - -} - -//--------------------------------------------------------------------------------------------------------------------- -DialogAboutApp::~DialogAboutApp() -{ - delete ui; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief Fake button clicked - */ -void DialogAboutApp::webButtonClicked() -{ - if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false) - { - QMessageBox::warning(this, tr("Warning"), tr("Cannot open your default browser")); - } - -} +/************************************************************************ + ** + ** @file dialogaboutapp.cpp + ** @author Patrick Proy + ** @date 6 5, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "dialogaboutapp.h" +#include "ui_dialogaboutapp.h" +#include "../../version.h" +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogAboutApp::DialogAboutApp(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogAboutApp) +{ + ui->setupUi(this); + + ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION)); + ui->label_QT_Version->setText(tr("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR)); + + QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy")); + ui->label_Valentina_Built->setText(tr("Built on %3 at %4").arg(date.toString()).arg(__TIME__)); + + ui->label_Legal_Stuff->setText(WARRANTY); + + ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR)); + connect(ui->pushButton_Web_Site, &QPushButton::clicked, this, &DialogAboutApp::webButtonClicked ); + +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogAboutApp::~DialogAboutApp() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Fake button clicked + */ +void DialogAboutApp::webButtonClicked() +{ + if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false) + { + QMessageBox::warning(this, tr("Warning"), tr("Cannot open your default browser")); + } + +} diff --git a/src/app/dialogs/app/dialogaboutapp.h b/src/app/dialogs/app/dialogaboutapp.h index 66d10afe5..8c6f27341 100644 --- a/src/app/dialogs/app/dialogaboutapp.h +++ b/src/app/dialogs/app/dialogaboutapp.h @@ -1,55 +1,55 @@ -/************************************************************************ - ** - ** @file dialogaboutapp.h - ** @author Patrick Proy - ** @date 6 5, 2014 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef DIALOGABOUTAPP_H -#define DIALOGABOUTAPP_H - -#include - -namespace Ui -{ - class DialogAboutApp; -} - -class DialogAboutApp : public QDialog -{ - Q_OBJECT - -public: - explicit DialogAboutApp(QWidget *parent = 0); - ~DialogAboutApp(); - -private: - Ui::DialogAboutApp *ui; - Q_DISABLE_COPY(DialogAboutApp) - -private slots: - void webButtonClicked(); -}; - -#endif // DIALOGABOUTAPP_H +/************************************************************************ + ** + ** @file dialogaboutapp.h + ** @author Patrick Proy + ** @date 6 5, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGABOUTAPP_H +#define DIALOGABOUTAPP_H + +#include + +namespace Ui +{ + class DialogAboutApp; +} + +class DialogAboutApp : public QDialog +{ + Q_OBJECT + +public: + explicit DialogAboutApp(QWidget *parent = 0); + ~DialogAboutApp(); + +private: + Ui::DialogAboutApp *ui; + Q_DISABLE_COPY(DialogAboutApp) + +private slots: + void webButtonClicked(); +}; + +#endif // DIALOGABOUTAPP_H diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index c1e037b88..7010748f3 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -106,7 +106,7 @@ bool DialogPatternXmlEdit::ApplyAttributeChange(QDomNode domElement, QString nam { return false; } - domElement.toElement().setAttribute(name,value); + domElement.toElement().setAttribute(name, value); return true; } @@ -558,7 +558,7 @@ void DialogPatternXmlEdit::ButtonApplyChangesClicked() currentChange=currentChange->next; } QString message; - if (this->CheckChanges(message,newroot) == false) + if (this->CheckChanges(message, newroot) == false) { QMessageBox::warning(this, "Error in changes", message); return; @@ -719,8 +719,8 @@ void DialogPatternXmlEdit::ButtonAddSonClicked() { return; } - QString value = QInputDialog::getText(this, tr("Node Value (may be empty)"),tr("Value:"), - QLineEdit::Normal,"", &ok); + QString value = QInputDialog::getText(this, tr("Node Value (may be empty)"), tr("Value:"), + QLineEdit::Normal, "", &ok); if (ok==false) { return; diff --git a/src/app/dialogs/app/pages.cpp b/src/app/dialogs/app/pages.cpp index 11f5a59ed..f4d6805ee 100644 --- a/src/app/dialogs/app/pages.cpp +++ b/src/app/dialogs/app/pages.cpp @@ -202,9 +202,9 @@ QGroupBox *ConfigurationPage::LangGroup() QString checkedUnit = settings.value("configuration/unit", "cm").toString(); - this->unitCombo->addItem(tr("Centimeters"),"cm"); - this->unitCombo->addItem(tr("Milimiters"),"mm"); - this->unitCombo->addItem(tr("Inches"),"in"); + this->unitCombo->addItem(tr("Centimeters"), "cm"); + this->unitCombo->addItem(tr("Milimiters"), "mm"); + this->unitCombo->addItem(tr("Inches"), "in"); // set default unit qint32 indexUnit = this->unitCombo->findData(checkedUnit); @@ -368,15 +368,15 @@ void CommunityPage::Apply() QApplication::applicationName()); settings.setValue("community/server", this->server->text()); settings.setValue("community/serverSecure", this->secureComm->isChecked()); - settings.setValue("community/useProxy",this->useProxy->isChecked()); - settings.setValue("community/proxyAddress",this->proxyAddress->text()); - settings.setValue("community/proxyPort",this->proxyPort->text()); - settings.setValue("community/proxyUser",this->proxyUser->text()); - settings.setValue("community/proxyPass",this->proxyPass->text()); + settings.setValue("community/useProxy", this->useProxy->isChecked()); + settings.setValue("community/proxyAddress", this->proxyAddress->text()); + settings.setValue("community/proxyPort", this->proxyPort->text()); + settings.setValue("community/proxyUser", this->proxyUser->text()); + settings.setValue("community/proxyPass", this->proxyPass->text()); - settings.setValue("community/username",this->username->text()); - settings.setValue("community/savePassword",this->savePassword->isChecked()); - settings.setValue("community/userpassword",this->userpassword->text()); + settings.setValue("community/username", this->username->text()); + settings.setValue("community/savePassword", this->savePassword->isChecked()); + settings.setValue("community/userpassword", this->userpassword->text()); } @@ -414,10 +414,10 @@ QGroupBox *CommunityPage::ServerGroup() QGroupBox *ServerGroup = new QGroupBox(tr("Server")); QFormLayout *serverLayout = new QFormLayout; - CommunityPage::add_lineedit(&this->server,serverLayout, + CommunityPage::add_lineedit(&this->server, serverLayout, settings.value("community/server", "community.valentina-project.org").toString(), tr("Server name/IP")); - CommunityPage::add_checkbox(&this->secureComm,serverLayout, + CommunityPage::add_checkbox(&this->secureComm, serverLayout, settings.value("community/serverSecure", 0).toBool(), tr("Secure connection")); ServerGroup->setLayout(serverLayout); diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 681f30d69..cbb375364 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -156,7 +156,7 @@ void DialogAlongLine::SaveData() pointName = ui->lineEditNamePoint->text(); typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); - formula.replace("\n"," "); + formula.replace("\n", " "); firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 44a030866..47c145de0 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -195,7 +195,7 @@ void DialogArc::DialogApply() void DialogArc::SaveData() { radius = ui->plainTextEditFormula->toPlainText(); - radius.replace("\n"," "); + radius.replace("\n", " "); f1 = ui->lineEditF1->text(); f2 = ui->lineEditF2->text(); center = getCurrentObjectId(ui->comboBoxBasePoint); diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 9de20034c..0eb457e48 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -247,7 +247,7 @@ void DialogBisector::SaveData() pointName = ui->lineEditNamePoint->text(); typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); - formula.replace("\n"," "); + formula.replace("\n", " "); firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); thirdPointId = getCurrentObjectId(ui->comboBoxThirdPoint); diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 5da56bc8c..e4791526c 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -138,7 +138,7 @@ void DialogCutArc::SaveData() { pointName = ui->lineEditNamePoint->text(); formula = ui->plainTextEditFormula->toPlainText(); - formula.replace("\n"," "); + formula.replace("\n", " "); arcId = getCurrentObjectId(ui->comboBoxArc); } diff --git a/src/app/dialogs/tools/dialogeditwrongformula.h b/src/app/dialogs/tools/dialogeditwrongformula.h index 862744e61..d7e22f6de 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.h +++ b/src/app/dialogs/tools/dialogeditwrongformula.h @@ -31,7 +31,8 @@ #include "dialogtool.h" -namespace Ui { +namespace Ui +{ class DialogEditWrongFormula; } diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 5ad7150ad..aeca74c04 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -94,7 +94,7 @@ void DialogEndLine::DeployFormulaTextEdit() ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); //Set icon from theme (internal for Windows system) ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); + QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); } } @@ -201,7 +201,7 @@ void DialogEndLine::SaveData() pointName = ui->lineEditNamePoint->text(); typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); - formula.replace("\n"," "); + formula.replace("\n", " "); angle = ui->doubleSpinBoxAngle->value(); basePointId = getCurrentObjectId(ui->comboBoxBasePoint); } diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index dd4558879..87cabe48f 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -153,7 +153,7 @@ void DialogNormal::SaveData() pointName = ui->lineEditNamePoint->text(); typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); - formula.replace("\n"," "); + formula.replace("\n", " "); angle = ui->doubleSpinBoxAngle->value(); firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 45526a6a7..ee3310d4c 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -198,7 +198,7 @@ void DialogPointOfContact::SaveData() { pointName = ui->lineEditNamePoint->text(); radius = ui->plainTextEditFormula->toPlainText(); - radius.replace("\n"," "); + radius.replace("\n", " "); center = getCurrentObjectId(ui->comboBoxCenter); firstPoint = getCurrentObjectId(ui->comboBoxFirstPoint); secondPoint = getCurrentObjectId(ui->comboBoxSecondPoint); diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 61ca75e58..0df400703 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -176,7 +176,7 @@ void DialogShoulderPoint::SaveData() pointName = ui->lineEditNamePoint->text(); typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); - formula.replace("\n"," "); + formula.replace("\n", " "); p1Line = getCurrentObjectId(ui->comboBoxP1Line); p2Line = getCurrentObjectId(ui->comboBoxP2Line); pShoulder = getCurrentObjectId(ui->comboBoxPShoulder); diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 1707ece65..6c22ba12b 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -467,7 +467,7 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label) palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76)); emit ToolTip(""); } - catch(qmu::QmuParserError &e) + catch (qmu::QmuParserError &e) { label->setText(tr("Error")); flag = false; @@ -504,7 +504,7 @@ void DialogTool::Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *l { // Replace line return with spaces for calc QString formula = edit->toPlainText(); - formula.replace("\n"," "); + formula.replace("\n", " "); formula = qApp->FormulaFromUser(formula); Calculator *cal = new Calculator(data); const qreal result = cal->EvalFormula(formula); @@ -528,7 +528,7 @@ void DialogTool::Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *l palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76)); emit ToolTip(""); } - catch(qmu::QmuParserError &e) + catch (qmu::QmuParserError &e) { label->setText(tr("Error")); flag = false; diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 4583238f2..548caf616 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -379,7 +379,7 @@ void MainWindow::ApplyDialog() void MainWindow::ToolEndLine(bool checked) { SetToolButtonWithApply(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"), - &MainWindow::ClosedDialogEndLine,&MainWindow::ApplyDialogEndLine); + &MainWindow::ClosedDialogEndLine, &MainWindow::ApplyDialogEndLine); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index fc72a46a3..06339c463 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -189,7 +189,7 @@ qreal VDrawTool::CheckFormula(QString &formula, VContainer *data) result = cal->EvalFormula(formula); delete cal; } - catch(qmu::QmuParserError &e) + catch (qmu::QmuParserError &e) { Q_UNUSED(e) delete cal; diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/app/undocommands/savedetailoptions.cpp index 491449ffc..a6b11c4dd 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/app/undocommands/savedetailoptions.cpp @@ -139,5 +139,3 @@ int SaveDetailOptions::id() const { return static_cast(UndoCommand::SaveDetailOptions); } - - diff --git a/src/app/undocommands/savetooloptions.h b/src/app/undocommands/savetooloptions.h index 4112312d9..c370127a8 100644 --- a/src/app/undocommands/savetooloptions.h +++ b/src/app/undocommands/savetooloptions.h @@ -38,7 +38,8 @@ class SaveToolOptions : public QObject, public QUndoCommand { Q_OBJECT public: - SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id, QUndoCommand *parent = 0); + SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id, + QUndoCommand *parent = 0); virtual ~SaveToolOptions(); virtual void undo(); virtual void redo(); diff --git a/src/app/widgets/vapplication.cpp b/src/app/widgets/vapplication.cpp index 6e7bb7f47..934ecd865 100644 --- a/src/app/widgets/vapplication.cpp +++ b/src/app/widgets/vapplication.cpp @@ -439,7 +439,7 @@ void VApplication::InitMeasurements() "Full measurement description"); measurements.insert(acrossBackShoulderWidth_M, m); - guiTexts.insert(acrossBackShoulderWidth_M,g ); + guiTexts.insert(acrossBackShoulderWidth_M, g ); descriptions.insert(acrossBackShoulderWidth_M, d); //================================================================================================================= m = VTranslation::translate("Measurements", "upper_back_width", @@ -1528,7 +1528,7 @@ bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const QMap::const_iterator i = measurements.constBegin(); while (i != measurements.constEnd()) { - if(token == i.value().translate()) + if (token == i.value().translate()) { newFormula.replace(position, token.length(), i.key()); bias = token.length() - i.key().length(); @@ -1545,7 +1545,7 @@ bool VApplication::VariablesFromUser(QString &newFormula, int position, const QS QMap::const_iterator i = variables.constBegin(); while (i != variables.constEnd()) { - if(token.indexOf( i.value().translate() ) == 0) + if (token.indexOf( i.value().translate() ) == 0) { newFormula.replace(position, i.value().translate().length(), i.key()); QString newToken = token; @@ -1564,7 +1564,7 @@ bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, c QMap::const_iterator i = postfixOperators.constBegin(); while (i != postfixOperators.constEnd()) { - if(token == i.value().translate()) + if (token == i.value().translate()) { newFormula.replace(position, token.length(), i.key()); bias = token.length() - i.key().length(); @@ -1581,7 +1581,7 @@ bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QS QMap::const_iterator i = functions.constBegin(); while (i != functions.constEnd()) { - if(token == i.value().translate()) + if (token == i.value().translate()) { newFormula.replace(position, token.length(), i.key()); bias = token.length() - i.key().length(); @@ -1598,7 +1598,7 @@ bool VApplication::VariablesToUser(QString &newFormula, int position, const QStr QMap::const_iterator i = variables.constBegin(); while (i != variables.constEnd()) { - if(token.indexOf( i.key() ) == 0) + if (token.indexOf( i.key() ) == 0) { newFormula.replace(position, i.key().length(), i.value().translate()); @@ -1615,7 +1615,7 @@ bool VApplication::VariablesToUser(QString &newFormula, int position, const QStr void VApplication::CorrectionsPositions(int position, int bias, QMap &tokens, QMap &numbers) { - if(bias == 0) + if (bias == 0) { return; } @@ -1630,7 +1630,7 @@ void VApplication::BiasTokens(int position, int bias, QMap &tokens QMap::const_iterator i = tokens.constBegin(); while (i != tokens.constEnd()) { - if(i.key()<= position) + if (i.key()<= position) { newTokens.insert(i.key(), i.value()); } @@ -1670,7 +1670,7 @@ QString VApplication::VarToUser(const QString &var) const QString newVar = var; int bias = 0; - if(VariablesToUser(newVar, 0, var, bias)) + if (VariablesToUser(newVar, 0, var, bias)) { return newVar; } @@ -1682,22 +1682,22 @@ QString VApplication::VarFromUser(const QString &var) const { QString newVar = var; int bias = 0; - if(MeasurementsFromUser(newVar, 0, var, bias)) + if (MeasurementsFromUser(newVar, 0, var, bias)) { return newVar; } - if(VariablesFromUser(newVar, 0, var, bias)) + if (VariablesFromUser(newVar, 0, var, bias)) { return newVar; } - if(PostfixOperatorsFromUser(newVar, 0, var, bias)) + if (PostfixOperatorsFromUser(newVar, 0, var, bias)) { return newVar; } - if(FunctionsFromUser(newVar, 0, var, bias)) + if (FunctionsFromUser(newVar, 0, var, bias)) { return newVar; } @@ -1737,7 +1737,7 @@ QString VApplication::FormulaFromUser(const QString &formula) for (int i = 0; i < tKeys.size(); ++i) { int bias = 0; - if(MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + if (MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) { @@ -1748,7 +1748,7 @@ QString VApplication::FormulaFromUser(const QString &formula) continue; } - if(VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + if (VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) { @@ -1759,7 +1759,7 @@ QString VApplication::FormulaFromUser(const QString &formula) continue; } - if(PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + if (PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) { @@ -1770,7 +1770,7 @@ QString VApplication::FormulaFromUser(const QString &formula) continue; } - if(FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + if (FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) { @@ -1787,7 +1787,7 @@ QString VApplication::FormulaFromUser(const QString &formula) bool osSeparatorValue = settings.value("configuration/osSeparator", 1).toBool(); QLocale loc = QLocale::system(); - if(loc != QLocale(QLocale::C) && osSeparatorValue) + if (loc != QLocale(QLocale::C) && osSeparatorValue) { QList nKeys = numbers.keys(); QList nValues = numbers.values(); @@ -1889,7 +1889,7 @@ QString VApplication::FormulaToUser(const QString &formula) } int bias = 0; - if(VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias)) + if (VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) { @@ -1906,7 +1906,7 @@ QString VApplication::FormulaToUser(const QString &formula) bool osSeparatorValue = settings.value("configuration/osSeparator", 1).toBool(); QLocale loc = QLocale::system(); - if(loc != QLocale::C && osSeparatorValue) + if (loc != QLocale::C && osSeparatorValue) { QList nKeys = numbers.keys(); QList nValues = numbers.values(); @@ -1915,12 +1915,12 @@ QString VApplication::FormulaToUser(const QString &formula) QLocale loc = QLocale(QLocale::C); bool ok = false; qreal d = loc.toDouble(nValues.at(i), &ok); - if(ok == false) + if (ok == false) { qDebug()<<"Can't convert to double token"<referens() <= 1) + if (tool->referens() <= 1) { QDomElement domElement = elementById(QString().setNum(t.key())); - if(domElement.isElement()) + if (domElement.isElement()) { QDomNode parent = domElement.parentNode(); - if(parent.isNull() == false && parent.toElement().tagName() == TagModeling) + if (parent.isNull() == false && parent.toElement().tagName() == TagModeling) { parent.removeChild(domElement); } diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index f1497e878..5e8fda878 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -247,6 +247,4 @@ inline QStringList VPattern::getPatternPieces() const return patternPieces; } - - #endif // VPATTERN_H diff --git a/src/libs/qmuparser/qmuparsercallback.h b/src/libs/qmuparser/qmuparsercallback.h index a038fd2ae..eac19aa21 100644 --- a/src/libs/qmuparser/qmuparsercallback.h +++ b/src/libs/qmuparser/qmuparsercallback.h @@ -48,8 +48,7 @@ class QmuParserCallback public: QmuParserCallback(fun_type0 a_pFun, bool a_bAllowOpti); QmuParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC); - QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity) - ; + QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity); QmuParserCallback(fun_type2 a_pFun, bool a_bAllowOpti); QmuParserCallback(fun_type3 a_pFun, bool a_bAllowOpti); QmuParserCallback(fun_type4 a_pFun, bool a_bAllowOpti);