diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 72e78bae7..19cecb884 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -217,7 +217,7 @@ void VApplication::NewValentina(const QString &fileName) { const QString run = QString("\"%1\" \"%2\"").arg(qApp->applicationFilePath()).arg(fileName); qCDebug(vApp)<<"New process with arguments. program ="< #include -const QString VSettings::SettingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator"); -const QString VSettings::SettingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state"); -const QString VSettings::SettingConfigurationAutosaveTime = QStringLiteral("configuration/autosave/time"); -const QString VSettings::SettingConfigurationSendReportState = QStringLiteral("configuration/send_report/state"); -const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale"); -const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit"); -const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); -const QString VSettings::SettingConfigurationConfirmItemDeletion = QStringLiteral("configuration/confirm_item_deletion"); +const QString VSettings::SettingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator"); +const QString VSettings::SettingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state"); +const QString VSettings::SettingConfigurationAutosaveTime = QStringLiteral("configuration/autosave/time"); +const QString VSettings::SettingConfigurationSendReportState = QStringLiteral("configuration/send_report/state"); +const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale"); +const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit"); +const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); +const QString VSettings::SettingConfigurationConfirmItemDeletion + = QStringLiteral("configuration/confirm_item_deletion"); -const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); -const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements"); -const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); -const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); +const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); +const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements"); +const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); +const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); -const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); -const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); -const QString VSettings::SettingPatternUndo = QStringLiteral("pattern/undo"); +const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); +const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); +const QString VSettings::SettingPatternUndo = QStringLiteral("pattern/undo"); -const QString VSettings::SettingGeneralRecentFileList = QStringLiteral("recentFileList"); -const QString VSettings::SettingGeneralRestoreFileList = QStringLiteral("restoreFileList"); -const QString VSettings::SettingGeneralGeometry = QStringLiteral("geometry"); -const QString VSettings::SettingGeneralWindowState = QStringLiteral("windowState"); +const QString VSettings::SettingGeneralRecentFileList = QStringLiteral("recentFileList"); +const QString VSettings::SettingGeneralRestoreFileList = QStringLiteral("restoreFileList"); +const QString VSettings::SettingGeneralGeometry = QStringLiteral("geometry"); +const QString VSettings::SettingGeneralWindowState = QStringLiteral("windowState"); -const QString VSettings::SettingCommunityServer = QStringLiteral("community/server"); -const QString VSettings::SettingCommunityServerSecure = QStringLiteral("community/serverSecure"); -const QString VSettings::SettingCommunityUseProxy = QStringLiteral("community/useProxy"); -const QString VSettings::SettingCommunityProxyAddress = QStringLiteral("community/proxyAddress"); -const QString VSettings::SettingCommunityProxyPort = QStringLiteral("community/proxyPort"); -const QString VSettings::SettingCommunityProxyUser = QStringLiteral("community/proxyUser"); -const QString VSettings::SettingCommunityProxyPass = QStringLiteral("community/proxyPass"); -const QString VSettings::SettingCommunityUsername = QStringLiteral("community/username"); -const QString VSettings::SettingCommunitySavePassword = QStringLiteral("community/savePassword"); -const QString VSettings::SettingCommunityUserPassword = QStringLiteral("community/userpassword"); +const QString VSettings::SettingCommunityServer = QStringLiteral("community/server"); +const QString VSettings::SettingCommunityServerSecure = QStringLiteral("community/serverSecure"); +const QString VSettings::SettingCommunityUseProxy = QStringLiteral("community/useProxy"); +const QString VSettings::SettingCommunityProxyAddress = QStringLiteral("community/proxyAddress"); +const QString VSettings::SettingCommunityProxyPort = QStringLiteral("community/proxyPort"); +const QString VSettings::SettingCommunityProxyUser = QStringLiteral("community/proxyUser"); +const QString VSettings::SettingCommunityProxyPass = QStringLiteral("community/proxyPass"); +const QString VSettings::SettingCommunityUsername = QStringLiteral("community/username"); +const QString VSettings::SettingCommunitySavePassword = QStringLiteral("community/savePassword"); +const QString VSettings::SettingCommunityUserPassword = QStringLiteral("community/userpassword"); //--------------------------------------------------------------------------------------------------------------------- VSettings::VSettings(Format format, Scope scope, const QString &organization, const QString &application, diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index 1421480f6..cad72ef13 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -85,7 +85,7 @@ void PathPage::DefaultPath() QTableWidgetItem *item = pathTable->item(row, 1); SCASSERT(item != nullptr); - switch(row) + switch (row) { case 1: // standard measurements item->setText(VSettings::StandardTablesPath()); @@ -110,7 +110,7 @@ void PathPage::EditPath() SCASSERT(item != nullptr); QString path; - switch(row) + switch (row) { case 0: // individual measurements path = qApp->getSettings()->GetPathIndividualMeasurements(); diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp index dc21d86c2..bdfe9be34 100644 --- a/src/app/dialogs/app/dialoglayoutprogress.cpp +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -75,7 +75,7 @@ void DialogLayoutProgress::Arranged(int count) void DialogLayoutProgress::Error(const LayoutErrors &state) { QString text; - switch(state) + switch (state) { case LayoutErrors::NoError: return; diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp index b2bdd401d..9d0ffa32e 100644 --- a/src/app/dialogs/app/dialoglayoutsettings.cpp +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -323,7 +323,7 @@ QSizeF DialogLayoutSettings::Template() qreal width = 0; qreal height = 0; - switch(temp) + switch (temp) { case PaperSizeTemplate::A0: width = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit); @@ -366,7 +366,7 @@ Unit DialogLayoutSettings::LayoutUnit() const //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::CorrectPaperDecimals() { - switch(oldPaperUnit) + switch (oldPaperUnit) { case Unit::Cm: case Unit::Mm: @@ -389,7 +389,7 @@ void DialogLayoutSettings::CorrectPaperDecimals() //--------------------------------------------------------------------------------------------------------------------- void DialogLayoutSettings::CorrectLayoutDecimals() { - switch(oldLayoutUnit) + switch (oldLayoutUnit) { case Unit::Cm: case Unit::Mm: diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 7b9164229..49c2aa8df 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -31,8 +31,9 @@ #include "dialogtool.h" -namespace Ui { -class DialogCurveIntersectAxis; +namespace Ui +{ + class DialogCurveIntersectAxis; } class VisToolCurveIntersectAxis; diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 89975afa8..978e8a7e6 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -31,8 +31,9 @@ #include "dialogtool.h" -namespace Ui { -class DialogLineIntersectAxis; +namespace Ui +{ + class DialogLineIntersectAxis; } class VisToolLineIntersectAxis; diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index 0e65f14b4..4f891af4d 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -748,7 +748,7 @@ void VSpline::SetKcurve(qreal factor) //--------------------------------------------------------------------------------------------------------------------- int VSpline::Sign(long double ld) const { - if(qAbs(ld)<0.00000000001) + if (qAbs(ld)<0.00000000001) { return 0; } @@ -844,7 +844,7 @@ qreal VSpline::ParamT (const QPointF &pBt) const ts += CalcT (GetP1().toQPointF().x(), d->p2.x(), d->p3.x(), GetP4().toQPointF().x(), pBt.x()); ts += CalcT (GetP1().toQPointF().y(), d->p2.y(), d->p3.y(), GetP4().toQPointF().y(), pBt.y()); - if(ts.isEmpty()) + if (ts.isEmpty()) { return -1; // We don't have candidates } diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 649958727..ee837e22e 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -71,10 +71,10 @@ Q_LOGGING_CATEGORY(vMainWindow, "v.mainwindow") * @param parent parent widget. */ MainWindow::MainWindow(QWidget *parent) - :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), currentTool(Tool::Arrow), lastUsedTool(Tool::Arrow), - currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr), - isInitialized(false), dialogTable(nullptr), dialogTool(nullptr), dialogHistory(nullptr), - comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0), + :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), currentTool(Tool::Arrow), + lastUsedTool(Tool::Arrow), currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), + mouseCoordinate(nullptr), helpLabel(nullptr), isInitialized(false), dialogTable(nullptr), dialogTool(nullptr), + dialogHistory(nullptr), comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0), currentToolBoxIndex(0), drawMode(true), recentFileActs(), separatorAct(nullptr), autoSaveTimer(nullptr), guiEnabled(true), gradationHeights(nullptr), gradationSizes(nullptr), toolOptions(nullptr), lock(nullptr) @@ -2201,7 +2201,9 @@ void MainWindow::CreateMenus() void MainWindow::LastUsedTool() { if (currentTool == lastUsedTool) + { return; + } switch ( lastUsedTool ) { diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index e16d98232..7fc17c0cb 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -56,7 +56,7 @@ TableWindow::TableWindow(QWidget *parent) :QMainWindow(parent), ui(new Ui::TableWindow), listDetails(QVector()), papers(QList()), shadows(QList()), - scenes(QList()), details(QList >()),fileName(QString()), + scenes(QList()), details(QList >()), fileName(QString()), description(QString()), tempScene(nullptr) { ui->setupUi(this); diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index 073d4b9c0..6ef6f3892 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -39,8 +39,9 @@ class VToolLinePoint : public VToolPoint { Q_OBJECT public: - VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, - const quint32 &basePointId, const qreal &angle, QGraphicsItem * parent = nullptr); + VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const + QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, + QGraphicsItem * parent = nullptr); virtual ~VToolLinePoint(); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::LinePoint)}; diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 00744a5c9..a5ecf4dce 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -173,10 +173,10 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics * @return the created tool */ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formula, const quint32 &p1Line, - const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &lineColor, - const QString &pointName, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, + const QString &lineColor, const QString &pointName, const qreal &mx, + const qreal &my, VMainGraphicsScene *scene, VPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(p1Line); const QSharedPointer secondPoint = data->GeometricObject(p2Line); diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 51dc6f60d..1733ee413 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -185,7 +185,7 @@ int VAbstractTool::ConfirmDeletion() msgBox.setText(tr("Do you really want to delete?")); msgBox.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); msgBox.setDefaultButton(QDialogButtonBox::No); - msgBox.setIconPixmap(qApp->style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(32,32) ); + msgBox.setIconPixmap(qApp->style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(32, 32) ); int dialogResult = msgBox.exec(); diff --git a/src/app/version.cpp b/src/app/version.cpp index f9ca57d77..631b100c1 100644 --- a/src/app/version.cpp +++ b/src/app/version.cpp @@ -52,9 +52,13 @@ QString compilerString() return QLatin1String("GCC " ) + QLatin1String(__VERSION__); #elif defined(Q_CC_MSVC) if (_MSC_VER >= 1800) // 1800: MSVC 2013 (yearly release cycle) + { return QLatin1String("MSVC ") + QString::number(2008 + ((_MSC_VER / 100) - 13)); + } if (_MSC_VER >= 1500) // 1500: MSVC 2008, 1600: MSVC 2010, ... (2-year release cycle) + { return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15)); + } #endif return QLatin1String(""); } diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 362fe7e28..8de7c9abf 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -84,7 +84,7 @@ QString VPatternConverter::XSDSchema(int ver) const { CheckVersion(ver); - switch(ver) + switch (ver) { case (0x000100): return QStringLiteral("://schema/pattern/v0.1.0.xsd"); @@ -107,7 +107,7 @@ void VPatternConverter::ApplyPatches() { try { - switch(ver) + switch (ver) { case (0x000100): { diff --git a/src/libs/qmuparser/qmuparsertest.h b/src/libs/qmuparser/qmuparsertest.h index 8444175ca..288269ed6 100644 --- a/src/libs/qmuparser/qmuparsertest.h +++ b/src/libs/qmuparser/qmuparsertest.h @@ -275,7 +275,7 @@ private: } // Custom value recognition - static int IsHexVal (const QString &a_szExpr, int *a_iPos, qreal *a_fVal , const std::locale &s_locale); + static int IsHexVal (const QString &a_szExpr, int *a_iPos, qreal *a_fVal, const std::locale &s_locale); // cppcheck-suppress functionStatic int TestNames(); diff --git a/src/libs/qmuparser/qmuparsertokenreader.cpp b/src/libs/qmuparser/qmuparsertokenreader.cpp index b6da95f2e..f476d2140 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.cpp +++ b/src/libs/qmuparser/qmuparsertokenreader.cpp @@ -412,7 +412,7 @@ bool QmuParserTokenReader::IsBuiltIn ( token_type &a_Tok ) } m_iSynFlags = noBC | noOPT | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; - m_iSynFlags |= noEND ; + m_iSynFlags |= noEND; } else if (i == cmBO) { diff --git a/src/libs/vlayout/vabstractdetail.cpp b/src/libs/vlayout/vabstractdetail.cpp index ef0a85aa7..e5d0b951e 100644 --- a/src/libs/vlayout/vabstractdetail.cpp +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -226,20 +226,20 @@ QVector VAbstractDetail::Equidistant(const QVector &points, co QVector VAbstractDetail::RemoveDublicates(const QVector &points) { QVector p = points; - for(int i = 0; i < p.size(); i++) + for (int i = 0; i < p.size(); i++) { QPointF current = p.at(i); - for(int j = i; j < p.size(); j++) + for (int j = i; j < p.size(); j++) { - if(j == i) + if (j == i) { continue; } else { QPointF temp = p.at(j); - if(current == temp) + if (current == temp) { QVector::iterator iter = p.begin() + j; p.erase(iter); diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp index a3237e0a4..f3adaecd8 100644 --- a/src/libs/vlayout/vbank.cpp +++ b/src/libs/vlayout/vbank.cpp @@ -80,7 +80,7 @@ int VBank::GetTiket() } } - switch(caseType) + switch (caseType) { case Cases::CaseThreeGroup: return GetNextThreeGroups(); @@ -260,7 +260,7 @@ int VBank::ArrangedCount() const //--------------------------------------------------------------------------------------------------------------------- void VBank::PrepareGroup() { - switch(caseType) + switch (caseType) { case Cases::CaseThreeGroup: PrepareThreeGroups(); diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index 831b81d50..d4763ede5 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -143,7 +143,7 @@ QVector VContour::UniteWithContour(const VLayoutDetail &detail, int glo } int i=0; - while(i < d->globalContour.count()) + while (i < d->globalContour.count()) { if (i == i2) { diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 2be3c848c..55c7a3d29 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -284,7 +284,7 @@ qint64 VLayoutDetail::Square() const QVector x; QVector y; - for(int i=0; i < n; ++i) + for (int i=0; i < n; ++i) { x.append(d->layoutAllowence.at(i).x()); y.append(d->layoutAllowence.at(i).y()); @@ -356,7 +356,7 @@ QVector VLayoutDetail::Map(const QVector &points) const if (d->mirror) { QList list = p.toList(); - for(int k=0, s=list.size(), max=(s/2); k constant; QVector multiple; - for(int i=0; inum_faces; i++ ) + for (unsigned int i = 0; i < res->num_faces; i++ ) { if (offset == 0) { @@ -165,7 +165,7 @@ void VObjEngine::drawPath(const QPainterPath &path) } int num_verts = res->faces[offset]; offset++; - for( int j = 0; j < num_verts; j++ ) + for ( int j = 0; j < num_verts; j++ ) { int p0 = res->faces[offset + j]; pf[j] = QPointF(points[p0].x, points[p0].y); @@ -173,13 +173,13 @@ void VObjEngine::drawPath(const QPainterPath &path) if (skipFace == false ) { QPolygonF face; - for( int i = 0; i < num_verts; i++ ) + for ( int i = 0; i < num_verts; i++ ) { face << QPointF(pf[i]); } QPolygonF united = polygon.united(face); qint64 sqUnited = Square(united); - if(sqUnited <= sq) + if (sqUnited <= sq) {// This face incide our base polygon. drawPolygon(pf, num_verts, QPaintEngine::OddEvenMode); } @@ -289,7 +289,7 @@ QPolygonF VObjEngine::MakePointsUnique(const QPolygonF &polygon) const { QVector set; QPolygonF uniquePolygon; - for(int i=0; i < polygon.count(); i++) + for (int i=0; i < polygon.count(); i++) { if (set.contains(polygon.at(i)) == false) { @@ -310,7 +310,7 @@ qint64 VObjEngine::Square(const QPolygonF &poly) const qreal s, res = 0; qint64 sq = 0; - for(int i=0; i < n; i++) + for (int i=0; i < n; i++) { x.append(poly.at(i).x()); y.append(poly.at(i).y()); diff --git a/src/libs/vobj/vobjengine.h b/src/libs/vobj/vobjengine.h index 3d8fb3513..a93769195 100644 --- a/src/libs/vobj/vobjengine.h +++ b/src/libs/vobj/vobjengine.h @@ -34,13 +34,13 @@ class QTextStream; -#define MAX_POINTS 512 +#define MAX_POINTS 512 class VObjEngine : public QPaintEngine { public: VObjEngine(); - virtual ~VObjEngine(); + virtual ~VObjEngine(); virtual bool begin(QPaintDevice *pdev); virtual bool end(); @@ -67,7 +67,7 @@ private: QTextStream *stream; unsigned int globalPointsCount; QIODevice *outputDevice; - del_point2d_t points[MAX_POINTS]; + del_point2d_t points[MAX_POINTS]; unsigned int planeCount; QSize size; int resolution; diff --git a/src/libs/vobj/vobjpaintdevice.cpp b/src/libs/vobj/vobjpaintdevice.cpp index 3d5b7e021..597fe305e 100644 --- a/src/libs/vobj/vobjpaintdevice.cpp +++ b/src/libs/vobj/vobjpaintdevice.cpp @@ -160,5 +160,3 @@ int VObjPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const } return 0; } - - diff --git a/src/libs/vobj/vobjpaintdevice.h b/src/libs/vobj/vobjpaintdevice.h index 36f037252..661e07990 100644 --- a/src/libs/vobj/vobjpaintdevice.h +++ b/src/libs/vobj/vobjpaintdevice.h @@ -55,7 +55,7 @@ public: void setResolution(int dpi); protected: - virtual int metric(PaintDeviceMetric metric) const; + virtual int metric(PaintDeviceMetric metric) const; private: Q_DISABLE_COPY(VObjPaintDevice) VObjEngine *engine; diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.cpp b/src/libs/vpropertyexplorer/checkablemessagebox.cpp index df285e0b7..00747cce3 100644 --- a/src/libs/vpropertyexplorer/checkablemessagebox.cpp +++ b/src/libs/vpropertyexplorer/checkablemessagebox.cpp @@ -37,7 +37,8 @@ static const char kDoNotAskAgainKey[] = "DoNotAskAgain"; -namespace Utils { +namespace Utils +{ class CheckableMessageBoxPrivate { @@ -131,7 +132,9 @@ QAbstractButton *CheckableMessageBox::clickedButton() const QDialogButtonBox::StandardButton CheckableMessageBox::clickedStandardButton() const { if (d->clickedButton) + { return d->buttonBox->standardButton(d->clickedButton); + } return QDialogButtonBox::NoButton; } @@ -148,7 +151,9 @@ void CheckableMessageBox::setText(const QString &t) QPixmap CheckableMessageBox::iconPixmap() const { if (const QPixmap *p = d->pixmapLabel->pixmap()) + { return QPixmap(*p); + } return QPixmap(); } @@ -212,14 +217,19 @@ QDialogButtonBox::StandardButton CheckableMessageBox::defaultButton() const { foreach (QAbstractButton *b, d->buttonBox->buttons()) if (QPushButton *pb = qobject_cast(b)) + { if (pb->isDefault()) + { return d->buttonBox->standardButton(pb); + } + } return QDialogButtonBox::NoButton; } void CheckableMessageBox::setDefaultButton(QDialogButtonBox::StandardButton s) { - if (QPushButton *b = d->buttonBox->button(s)) { + if (QPushButton *b = d->buttonBox->button(s)) + { b->setDefault(true); b->setFocus(); } @@ -277,12 +287,15 @@ QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButt bool askAgain(QSettings *settings, const QString &settingsSubKey) { //QTC_CHECK(settings); - if (settings) { + if (settings) + { settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); bool shouldNotAsk = settings->value(settingsSubKey, false).toBool(); settings->endGroup(); if (shouldNotAsk) + { return false; + } } return true; } @@ -310,7 +323,9 @@ void initDoNotAskAgainMessageBox(CheckableMessageBox &messageBox, const QString void doNotAskAgain(QSettings *settings, const QString &settingsSubKey) { if (!settings) + { return; + } settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); settings->setValue(settingsSubKey, true); @@ -336,13 +351,17 @@ CheckableMessageBox::doNotAskAgainQuestion(QWidget *parent, const QString &title { if (!askAgain(settings, settingsSubKey)) + { return acceptButton; + } CheckableMessageBox messageBox(parent); initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Question); messageBox.exec(); if (messageBox.isChecked() && (messageBox.clickedStandardButton() == acceptButton)) + { doNotAskAgain(settings, settingsSubKey); + } return messageBox.clickedStandardButton(); } @@ -364,13 +383,17 @@ CheckableMessageBox::doNotShowAgainInformation(QWidget *parent, const QString &t { if (!askAgain(settings, settingsSubKey)) + { return defaultButton; + } CheckableMessageBox messageBox(parent); initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Information); messageBox.exec(); if (messageBox.isChecked()) + { doNotAskAgain(settings, settingsSubKey); + } return messageBox.clickedStandardButton(); } @@ -396,8 +419,10 @@ bool CheckableMessageBox::hasSuppressedQuestions(QSettings *settings) //Q_ASSERT(settings, return false); bool hasSuppressed = false; settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); - foreach (const QString &subKey, settings->childKeys()) { - if (settings->value(subKey, false).toBool()) { + foreach (const QString &subKey, settings->childKeys()) + { + if (settings->value(subKey, false).toBool()) + { hasSuppressed = true; break; } diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.h b/src/libs/vpropertyexplorer/checkablemessagebox.h index 5056f7947..29b148446 100644 --- a/src/libs/vpropertyexplorer/checkablemessagebox.h +++ b/src/libs/vpropertyexplorer/checkablemessagebox.h @@ -25,7 +25,8 @@ QT_BEGIN_NAMESPACE class QSettings; QT_END_NAMESPACE -namespace Utils { +namespace Utils +{ class CheckableMessageBoxPrivate;