diff --git a/Valentina.pri b/Valentina.pri index c374c02c5..7d1a0fd8c 100644 --- a/Valentina.pri +++ b/Valentina.pri @@ -150,7 +150,7 @@ GCC_DEBUG_CXXFLAGS += \ -Wmissing-format-attribute \ -Wswitch-default \ -Wuninitialized \ - -Wno-variadic-macros \ + -Wvariadic-macros \ -Wlogical-op \ -Wnoexcept \ -Wmissing-noreturn \ diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index 9e2b51a36..92eb14068 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -211,7 +211,7 @@ void VContainer::UpdateObject(QHash &obj, const quint32 &id, val p */ void VContainer::Clear() { - qCDebug(vCon)<<"Clearing container data."; + qCDebug(vCon, "Clearing container data."); _id = NULL_ID; d->details.clear(); diff --git a/src/app/core/qcommandlineoption.cpp b/src/app/core/qcommandlineoption.cpp index 798c113ce..a063a1fea 100644 --- a/src/app/core/qcommandlineoption.cpp +++ b/src/app/core/qcommandlineoption.cpp @@ -21,10 +21,15 @@ #include "qcommandlineoption.h" -#include "qset.h" +#include #if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + class QCommandLineOptionPrivate : public QSharedData { public: @@ -51,6 +56,10 @@ public: bool hidden; }; +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + /*! \since 5.2 \class QCommandLineOption diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 742dfc208..22b1bd9bd 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -180,7 +180,7 @@ VApplication::VApplication(int &argc, char **argv) //--------------------------------------------------------------------------------------------------------------------- VApplication::~VApplication() { - qCDebug(vApp)<<"Application closing."; + qCDebug(vApp, "Application closing."); qInstallMessageHandler(0); // Resore the message handler delete out; @@ -199,31 +199,31 @@ VApplication::~VApplication() */ void VApplication::NewValentina(const QString &fileName) { - qCDebug(vApp)<<"Open new detached process."; + qCDebug(vApp, "Open new detached process."); if (fileName.isEmpty()) { - qCDebug(vApp)<<"New process without arguments. program ="<applicationFilePath(); + qCDebug(vApp, "New process without arguments. program = %s", qApp->applicationFilePath().toUtf8().constData()); // Path can contain spaces. if (QProcess::startDetached("\""+qApp->applicationFilePath()+"\"")) { - qCDebug(vApp)<<"The process was started successfully."; + qCDebug(vApp, "The process was started successfully."); } else { - qCWarning(vApp)<<"Could not run process. The operation timed out or an error occurred."; + qCWarning(vApp, "Could not run process. The operation timed out or an error occurred."); } } else { const QString run = QString("\"%1\" \"%2\"").arg(qApp->applicationFilePath()).arg(fileName); - qCDebug(vApp)<<"New process with arguments. program ="<setStaleLockTime(0); if (TryLock(logLock)) { - qCDebug(vApp) << "Log file"<error(); + qCDebug(vApp, "Failed to lock %s", LogPath().toUtf8().constData()); + qCDebug(vApp, "Error type: %d", logLock->error()); } } else { delete log; log = nullptr; - qCDebug(vApp) << "Error opening log file '" << LogPath() << "'. All debug output redirected to console."; + qCDebug(vApp, "Error opening log file \'%s\'. All debug output redirected to console.", + LogPath().toUtf8().constData()); } } @@ -496,27 +497,27 @@ void VApplication::ClearOldLogs() const const QStringList allFiles = logsDir.entryList(QDir::NoDotAndDotDot | QDir::Files); if (allFiles.isEmpty() == false) { - qCDebug(vApp) << "Clearing old logs"; + qCDebug(vApp, "Clearing old logs"); for (int i = 0; i < allFiles.size(); ++i) { QFileInfo info(allFiles.at(i)); QLockFile *lock = new QLockFile(info.absoluteFilePath() + ".lock"); if (TryLock(lock)) { - qCDebug(vApp) << "Locked file"<getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); - qCDebug(vDialog)<<"Showing variables."; + qCDebug(vDialog, "Showing variables."); if (qApp->patternType() == MeasurementsType::Individual) { - qCDebug(vDialog)<<"Pattern with individual measurements."; + qCDebug(vDialog, "Pattern with individual measurements."); const QString filePath = doc->MPath(); try { @@ -668,7 +668,7 @@ void DialogIncrements::OpenTable() */ void DialogIncrements::clickedToolButtonAdd() { - qCDebug(vDialog)<<"Add new increment"; + qCDebug(vDialog, "Add new increment"); ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason); ui->tableWidgetIncrement->blockSignals(true); qint32 currentRow = ui->tableWidgetIncrement->rowCount(); @@ -738,7 +738,7 @@ void DialogIncrements::clickedToolButtonRemove() qint32 row = item->row(); QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0); - qCDebug(vDialog)<<"Remove increment"<text(); + qCDebug(vDialog, "Remove increment %s", itemName->text().toUtf8().constData()); data->RemoveIncrement(itemName->text()); quint32 id = qvariant_cast(itemName->data(Qt::UserRole)); @@ -750,7 +750,7 @@ void DialogIncrements::clickedToolButtonRemove() } else { - qCDebug(vDialog)<<"Could not find object with id"<createElement(VPattern::TagIncrement); doc->SetAttribute(element, VDomDocument::AttrId, id); @@ -812,47 +812,47 @@ void DialogIncrements::HideColumns(QTableWidget *table) */ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column ) { - qCDebug(vDialog)<<"Increment changed."; + qCDebug(vDialog, "Increment changed."); const QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0); const QTableWidgetItem *item = ui->tableWidgetIncrement->item(row, column); const quint32 id = qvariant_cast(itemName->data(Qt::UserRole)); QDomElement domElement = doc->elementById(id); if (domElement.isElement() == false) { - qCDebug(vDialog)<<"Cant't find increment with id = "<row = row; switch (column) { case 0: // VPattern::IncrementName - qCDebug(vDialog)<<"Changed name to"<text(); + qCDebug(vDialog, "Changed name to %s", item->text().toUtf8().constData()); doc->SetAttribute(domElement, VPattern::IncrementName, item->text()); data->ClearVariables(VarType::Increment); this->column = 2; emit FullUpdateTree(Document::LiteParse); break; case 2: // VPattern::IncrementBase - qCDebug(vDialog)<<"Changed base to"<text(); + qCDebug(vDialog, "Changed base to %s", item->text().toUtf8().constData()); doc->SetAttribute(domElement, VPattern::IncrementBase, item->text()); this->column = 3; emit FullUpdateTree(Document::LiteParse); break; case 3: // VPattern::IncrementKsize - qCDebug(vDialog)<<"Changed ksize to"<text(); + qCDebug(vDialog, "Changed ksize to %s", item->text().toUtf8().constData()); doc->SetAttribute(domElement, VPattern::IncrementKsize, item->text()); this->column = 4; emit FullUpdateTree(Document::LiteParse); break; case 4: // VPattern::IncrementKgrowth - qCDebug(vDialog)<<"Changed kheight to"<text(); + qCDebug(vDialog, "Changed kheight to %s", item->text().toUtf8().constData()); doc->SetAttribute(domElement, VPattern::IncrementKgrowth, item->text()); this->column = 5; emit FullUpdateTree(Document::LiteParse); break; case 5: // VPattern::IncrementDescription { - qCDebug(vDialog)<<"Changed description to"<text(); + qCDebug(vDialog, "Changed description to %s", item->text().toUtf8().constData()); doc->SetAttribute(domElement, VPattern::IncrementDescription, item->text()); QSharedPointer incr = data->GetVariable(itemName->text()); incr->SetDescription(item->text()); @@ -873,7 +873,7 @@ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column ) //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) { - qCDebug(vDialog)<<"Measurement changed."; + qCDebug(vDialog, "Measurement changed."); switch (column) { case 2:// value column @@ -887,7 +887,7 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) QDomElement domElement = list.at(0).toElement(); if (domElement.isElement() == false) { - qCDebug(vDialog)<<"Can't find measurement "<SetBase(0); item->setText("0"); - qCDebug(vDialog)<<"Can't convert toDouble measurement value"<SetBase(base); } - qCDebug(vDialog)<<"Changed value to"<patternUnit(), m->MUnit()); diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index e8574de98..a136dcfe3 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -64,7 +64,7 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q connect(bCansel, &QPushButton::clicked, this, &DialogStandardMeasurements::DialogRejected); } - qCDebug(vStMeasur)<<"Pattern piece name"<<_name; + qCDebug(vStMeasur, "Pattern piece name %s", _name.toUtf8().constData()); ui->lineEditName->setText(_name); LoadStandardTables(); @@ -151,7 +151,7 @@ void DialogStandardMeasurements::CheckState() //--------------------------------------------------------------------------------------------------------------------- void DialogStandardMeasurements::LoadStandardTables() { - qCDebug(vStMeasur)<<"Loading standard table."; + qCDebug(vStMeasur, "Loading standard table."); QStringList filters{"*.vst"}; //Use standard path to standard measurements const QString path = qApp->getSettings()->GetPathStandardMeasurements(); @@ -162,13 +162,13 @@ void DialogStandardMeasurements::LoadStandardTables() const QStringList allFiles = tablesDir.entryList(QDir::NoDotAndDotDot | QDir::Files); if (allFiles.isEmpty() == true) { - qCDebug(vStMeasur)<<"Can't find standard measurements in path"<comboBoxTables->clear(); CheckState(); return; } - qCDebug(vStMeasur)<<"Was found"<comboBoxTables->addItem(desc, QVariant(fi.absoluteFilePath())); } } } catch (VException &e) { - qCDebug(vStMeasur)<<"File error."<count()+1); - qCDebug(vMainWindow)<<"Generated PP name:"<count() == 0) { - qCDebug(vMainWindow)<<"First PP"; + qCDebug(vMainWindow, "First PP"); DialogMeasurements measurements(this); if (measurements.exec() == QDialog::Rejected) { - qCDebug(vMainWindow)<<"Creation PP was canceled"; + qCDebug(vMainWindow, "Creation PP was canceled"); return; } if (measurements.type() == MeasurementsType::Standard) { - qCDebug(vMainWindow)<<"PP with standard measurements"; + qCDebug(vMainWindow, "PP with standard measurements"); qApp->setPatternType(MeasurementsType::Standard); DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this); if (stMeasurements.exec() == QDialog::Accepted) { patternPieceName = stMeasurements.name(); - qCDebug(vMainWindow)<<"PP name:"<count(); + qCDebug(vMainWindow, "PP count %d", comboBoxDraws->count()); patternPieceName = PatternPieceName(patternPieceName); - qCDebug(vMainWindow)<<"PP name:"<MPath(); } if (doc->appendPP(patternPieceName) == false) { - qCDebug(vMainWindow)<<"Error creating pattern piece with the name "<blockSignals(true); @@ -826,7 +826,7 @@ void MainWindow::showEvent( QShowEvent *event ) */ void MainWindow::closeEvent(QCloseEvent *event) { - qCDebug(vMainWindow)<<"Closing main window"; + qCDebug(vMainWindow, "Closing main window"); if (MaybeSave()) { FileClosedCorrect(); @@ -836,7 +836,7 @@ void MainWindow::closeEvent(QCloseEvent *event) } else { - qCDebug(vMainWindow)<<"Closing canceled."; + qCDebug(vMainWindow, "Closing canceled."); event->ignore(); } } @@ -1045,10 +1045,10 @@ void MainWindow::mouseMove(const QPointF &scenePos) */ void MainWindow::CancelTool() { - qCDebug(vMainWindow)<<"Canceling tool."; + qCDebug(vMainWindow, "Canceling tool."); delete dialogTool; dialogTool = nullptr; - qCDebug(vMainWindow)<<"Dialog closed."; + qCDebug(vMainWindow, "Dialog closed."); switch ( currentTool ) { case Tool::Arrow: @@ -1142,7 +1142,7 @@ void MainWindow::CancelTool() */ void MainWindow::ArrowTool() { - qCDebug(vMainWindow)<<"Arrow tool."; + qCDebug(vMainWindow, "Arrow tool."); CancelTool(); ui->actionArrowTool->setChecked(true); ui->actionStopTool->setEnabled(false); @@ -1152,7 +1152,7 @@ void MainWindow::ArrowTool() ui->view->setCursor(cur); helpLabel->setText(""); ui->view->setShowToolOptions(true); - qCDebug(vMainWindow)<<"Enabled arrow tool."; + qCDebug(vMainWindow, "Enabled arrow tool."); } //--------------------------------------------------------------------------------------------------------------------- @@ -1218,7 +1218,7 @@ void MainWindow::ActionDraw(bool checked) { if (checked) { - qCDebug(vMainWindow)<<"Show draw scene"; + qCDebug(vMainWindow, "Show draw scene"); ui->actionDetails->setChecked(false); SaveCurrentScene(); @@ -1256,7 +1256,7 @@ void MainWindow::ActionDetails(bool checked) { if (checked) { - qCDebug(vMainWindow)<<"Show details scene"; + qCDebug(vMainWindow, "Show details scene"); ui->actionDraw->setChecked(false); SaveCurrentScene(); @@ -1380,7 +1380,7 @@ bool MainWindow::Save() */ void MainWindow::Open() { - qCDebug(vMainWindow)<<"Openning new file."; + qCDebug(vMainWindow, "Openning new file."); const QString filter(tr("Pattern files (*.val)")); //Get list last open files const QStringList files = qApp->getSettings()->GetRecentFileList(); @@ -1394,7 +1394,7 @@ void MainWindow::Open() //Absolute path to last open file dir = QFileInfo(files.first()).absolutePath(); } - qCDebug(vMainWindow)<<"Run QFileDialog::getOpenFileName: dir ="<actionDetails->setChecked(false); ui->actionDraw->setChecked(true); ui->actionDraw->setEnabled(false); - qCDebug(vMainWindow)<<"Returned to Draw mode."; + qCDebug(vMainWindow, "Returned to Draw mode."); setCurrentFile(QString()); pattern->Clear(); - qCDebug(vMainWindow)<<"Clearing pattern."; + qCDebug(vMainWindow, "Clearing pattern."); doc->clear(); - qCDebug(vMainWindow)<<"Clearing scenes."; + qCDebug(vMainWindow, "Clearing scenes."); sceneDraw->clear(); sceneDetails->clear(); ArrowTool(); @@ -1501,7 +1501,7 @@ void MainWindow::FileClosedCorrect() { autofile.remove(); } - qCDebug(vMainWindow)<<"File"<ClearPropertyBrowser(); try @@ -1997,7 +1997,7 @@ void MainWindow::MinimumScrollBar() */ bool MainWindow::SavePattern(const QString &fileName, QString &error) { - qCDebug(vMainWindow)<<"Saving pattern file"<SaveDocument(fileName, error); if (result) @@ -2006,13 +2006,13 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error) { setCurrentFile(fileName); helpLabel->setText(tr("File saved")); - qCDebug(vMainWindow)<<"File"<isWindowModified() == true) { @@ -2041,7 +2041,7 @@ void MainWindow::AutoSavePattern() */ void MainWindow::setCurrentFile(const QString &fileName) { - qCDebug(vMainWindow)<<"Set current name to \""<getUndoStack()->setClean(); @@ -2052,7 +2052,7 @@ void MainWindow::setCurrentFile(const QString &fileName) } else { - qCDebug(vMainWindow)<<"Updating recent file list."; + qCDebug(vMainWindow, "Updating recent file list."); QStringList files = qApp->getSettings()->GetRecentFileList(); files.removeAll(fileName); files.prepend(fileName); @@ -2064,7 +2064,7 @@ void MainWindow::setCurrentFile(const QString &fileName) qApp->getSettings()->SetRecentFileList(files); UpdateRecentFileActions(); - qCDebug(vMainWindow)<<"Updating restore file list."; + qCDebug(vMainWindow, "Updating restore file list."); QStringList restoreFiles = qApp->getSettings()->GetRestoreFileList(); restoreFiles.removeAll(fileName); restoreFiles.prepend(fileName); @@ -2091,7 +2091,7 @@ QString MainWindow::strippedName(const QString &fullFileName) */ void MainWindow::ReadSettings() { - qCDebug(vMainWindow)<<"Reading settings."; + qCDebug(vMainWindow, "Reading settings."); restoreGeometry(qApp->getSettings()->GetGeometry()); restoreState(qApp->getSettings()->GetWindowState()); @@ -2142,7 +2142,7 @@ bool MainWindow::MaybeSave() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::UpdateRecentFileActions() { - qCDebug(vMainWindow)<<"Updating recent file actions."; + qCDebug(vMainWindow, "Updating recent file actions."); const QStringList files = qApp->getSettings()->GetRecentFileList(); const int numRecentFiles = qMin(files.size(), static_cast(MaxRecentFiles)); @@ -2323,7 +2323,7 @@ void MainWindow::AddDocks() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::PropertyBrowser() { - qCDebug(vMainWindow)<<"Initialization property browser."; + qCDebug(vMainWindow, "Initialization property browser."); toolOptions = new VToolOptionsPropertyBrowser(ui->dockWidgetToolOptions); connect(ui->view, &VMainGraphicsView::itemClicked, toolOptions, &VToolOptionsPropertyBrowser::itemClicked); @@ -2395,7 +2395,7 @@ void MainWindow::InitAutoSave() { const qint32 autoTime = qApp->getSettings()->GetAutosaveTime(); autoSaveTimer->start(autoTime*60000); - qCDebug(vMainWindow)<<"Autosaving each"<setAutoSaveTimer(autoSaveTimer); } @@ -2449,7 +2449,7 @@ MainWindow::~MainWindow() */ void MainWindow::LoadPattern(const QString &fileName) { - qCDebug(vMainWindow)<<"Loading new file"<setStaleLockTime(0); if (VApplication::TryLock(lock)) { - qCDebug(vMainWindow) << "Pattern file"<error(); + qCDebug(vMainWindow, "Failed to lock %s", fileName.toUtf8().constData()); + qCDebug(vMainWindow, "Error type: %d", lock->error()); if (lock->error() == QLockFile::LockFailedError) { - qCCritical(vMainWindow) << tr("This file already opened in another window."); + qCCritical(vMainWindow, "%s", tr("This file already opened in another window.").toUtf8().constData()); Clear(); return; } @@ -2520,7 +2520,7 @@ void MainWindow::LoadPattern(const QString &fileName) { QMessageBox::critical(this, tr("Wrong units."), tr("Application doesn't support standard table with inches.")); - qCDebug(vMainWindow)<<"Application doesn't support standard table with inches."; + qCDebug(vMainWindow, "Application doesn't support standard table with inches."); Clear(); return; } @@ -2556,7 +2556,7 @@ void MainWindow::LoadPattern(const QString &fileName) PatternWasModified(!patternModified); } helpLabel->setText(tr("File loaded")); - qCDebug(vMainWindow)<<"File loaded."; + qCDebug(vMainWindow, "File loaded."); qApp->setOpeningPattern();// End opening file @@ -2611,7 +2611,7 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args) const QStringList files = GetUnlokedRestoreFileList(); if (files.size() > 0) { - qCDebug(vMainWindow)<<"Reopen files after crash."; + qCDebug(vMainWindow, "Reopen files after crash."); QStringList restoreFiles; for (int i = 0; i < files.size(); ++i) @@ -2632,7 +2632,7 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args) QMessageBox::Yes); if (reply == QMessageBox::Yes) { - qCDebug(vMainWindow)<<"User said Yes."; + qCDebug(vMainWindow, "User said Yes."); for (int i = 0; i < restoreFiles.size(); ++i) { @@ -2646,8 +2646,9 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args) } else { - qCDebug(vMainWindow) << "Could not copy "<elementById(id); if (oldDomElement.isElement()) { @@ -126,7 +126,7 @@ void VDrawTool::SaveDialogChange() } else { - qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool, "Can't find tool with id = %u", id); } } @@ -156,7 +156,7 @@ void VDrawTool::RefreshDataInFile() } else { - qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool, "Can't find tool with id = %u", id); } } @@ -183,7 +183,7 @@ void VDrawTool::ReadAttributes() } else { - qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool, "Can't find tool with id = %u", id); } } diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 938ebb112..f5293b81d 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -90,7 +90,8 @@ QString VToolPoint::name() const } catch (const VExceptionBadId &e) { - qCDebug(vToolPoint)<<"Error!"<<"Couldn't get point name."< VAbstractTool::PointsList() const //--------------------------------------------------------------------------------------------------------------------- void VAbstractTool::SaveOption(QSharedPointer &obj) { - qCDebug(vTool)<<"Saving tool options"; + qCDebug(vTool, "Saving tool options"); QDomElement oldDomElement = doc->elementById(id); if (oldDomElement.isElement()) { @@ -343,7 +343,7 @@ void VAbstractTool::SaveOption(QSharedPointer &obj) } else { - qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool, "Can't find tool with id = %u", id); } } diff --git a/src/app/undocommands/adddet.cpp b/src/app/undocommands/adddet.cpp index 125cc5ae3..d522598f8 100644 --- a/src/app/undocommands/adddet.cpp +++ b/src/app/undocommands/adddet.cpp @@ -45,7 +45,7 @@ AddDet::~AddDet() // cppcheck-suppress unusedFunction void AddDet::undo() { - qCDebug(vUndo)<<"Undo."; + qCDebug(vUndo, "Undo."); QDomElement element; if (doc->GetActivNodeElement(VPattern::TagDetails, element)) @@ -55,19 +55,19 @@ void AddDet::undo() { if (element.removeChild(domElement).isNull()) { - qCDebug(vUndo)<<"Can't delete node"; + qCDebug(vUndo, "Can't delete node"); return; } } else { - qCDebug(vUndo)<<"Can't get node by id = "<GetActivNodeElement(VPattern::TagDetails, element)) @@ -86,7 +86,7 @@ void AddDet::redo() } else { - qCDebug(vUndo)<<"Can't find tag"<GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -54,19 +54,19 @@ void AddDetNode::undo() { if (modelingElement.removeChild(domElement).isNull()) { - qCDebug(vUndo)<<"Can't delete node."; + qCDebug(vUndo, "Can't delete node."); return; } } else { - qCDebug(vUndo)<<"Can't get node by id = "<GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -83,7 +83,7 @@ void AddDetNode::redo() } else { - qCDebug(vUndo)<<"Can't find tag"<CountPP() <= 1) { @@ -64,7 +64,7 @@ void AddPatternPiece::undo() //--------------------------------------------------------------------------------------------------------------------- void AddPatternPiece::redo() { - qCDebug(vUndo)<<"Redo."; + qCDebug(vUndo, "Redo."); if (doc->CountPP() == 0 && mPath.isEmpty() == false) { diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 47c35915f..276973914 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -48,7 +48,7 @@ AddToCalc::~AddToCalc() //--------------------------------------------------------------------------------------------------------------------- void AddToCalc::undo() { - qCDebug(vUndo)<<"Undo."; + qCDebug(vUndo, "Undo."); doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change doc->setCursor(cursor); @@ -61,19 +61,19 @@ void AddToCalc::undo() { if (calcElement.removeChild(domElement).isNull()) { - qCDebug(vUndo)<<"Can't delete node."; + qCDebug(vUndo, "Can't delete node."); return; } } else { - qCDebug(vUndo)<<"Can't get tool by id = "< 0) @@ -88,7 +88,7 @@ void AddToCalc::undo() //--------------------------------------------------------------------------------------------------------------------- void AddToCalc::redo() { - qCDebug(vUndo)<<"Redo."; + qCDebug(vUndo, "Redo."); doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change doc->setCursor(cursor); @@ -110,14 +110,14 @@ void AddToCalc::redo() } else { - qCDebug(vUndo)<<"Can not find the element after which you want to insert."; + qCDebug(vUndo, "Can not find the element after which you want to insert."); return; } } } else { - qCDebug(vUndo)<<"Can't find tag Calculation."; + qCDebug(vUndo, "Can't find tag Calculation."); return; } RedoFullParsing(); diff --git a/src/app/undocommands/adduniondetails.cpp b/src/app/undocommands/adduniondetails.cpp index bb58b6213..f04f1cce8 100644 --- a/src/app/undocommands/adduniondetails.cpp +++ b/src/app/undocommands/adduniondetails.cpp @@ -44,7 +44,7 @@ AddUnionDetails::~AddUnionDetails() //--------------------------------------------------------------------------------------------------------------------- void AddUnionDetails::undo() { - qCDebug(vUndo)<<"Undo."; + qCDebug(vUndo, "Undo."); QDomElement modelingElement; if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -54,19 +54,19 @@ void AddUnionDetails::undo() { if (modelingElement.removeChild(domElement).isNull()) { - qCDebug(vUndo)<<"Can't delete node."; + qCDebug(vUndo, "Can't delete node."); return; } } else { - qCDebug(vUndo)<<"Can't get node by id = "<GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -84,7 +84,7 @@ void AddUnionDetails::redo() } else { - qCDebug(vUndo)<<"Can't find tag"<elementById(nodeId); if (domElement.isElement()) @@ -94,7 +94,7 @@ void DeleteDetail::redo() } else { - qCDebug(vUndo)<<"Can't get detail by id = "<documentElement(); QDomNode previousPP = doc->GetPPElement(previousPPName); @@ -64,7 +64,7 @@ void DeletePatternPiece::undo() //--------------------------------------------------------------------------------------------------------------------- void DeletePatternPiece::redo() { - qCDebug(vUndo)<<"Redo."; + qCDebug(vUndo, "Redo."); QDomElement rootElement = doc->documentElement(); QDomElement patternPiece = doc->GetPPElement(namePP); diff --git a/src/app/undocommands/deltool.cpp b/src/app/undocommands/deltool.cpp index 1aff2a436..3d9455b9b 100644 --- a/src/app/undocommands/deltool.cpp +++ b/src/app/undocommands/deltool.cpp @@ -50,7 +50,7 @@ DelTool::~DelTool() //--------------------------------------------------------------------------------------------------------------------- void DelTool::undo() { - qCDebug(vUndo)<<"Undo."; + qCDebug(vUndo, "Undo."); UndoDeleteAfterSibling(parentNode, siblingId); emit NeedFullParsing(); @@ -61,7 +61,7 @@ void DelTool::undo() //--------------------------------------------------------------------------------------------------------------------- void DelTool::redo() { - qCDebug(vUndo)<<"Redo."; + qCDebug(vUndo, "Redo."); //Keep first! doc->SetCurrentPP(nameActivDraw);//Without this user will not see this change diff --git a/src/app/undocommands/movedetail.cpp b/src/app/undocommands/movedetail.cpp index ba847af69..5de78f1a1 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/app/undocommands/movedetail.cpp @@ -50,7 +50,7 @@ MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const qu } else { - qCDebug(vUndo)<<"Can't find detail with id ="<elementById(nodeId); if (domElement.isElement()) @@ -76,7 +76,7 @@ void MoveDetail::undo() } else { - qCDebug(vUndo)<<"Can't find detail with id ="<elementById(nodeId); if (domElement.isElement()) @@ -102,7 +102,7 @@ void MoveDetail::redo() } else { - qCDebug(vUndo)<<"Can't find detail with id ="<elementById(id); @@ -52,12 +52,12 @@ MoveLabel::MoveLabel(VPattern *doc, const double &x, const double &y, const quin oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")); oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0")); - qCDebug(vUndo)<<"Label old Mx"<getNewMx(); newMy = moveCommand->getNewMy(); - qCDebug(vUndo)<<"Label new Mx"<elementById(nodeId); if (domElement.isElement()) @@ -127,7 +127,7 @@ void MoveLabel::Do(double mx, double my) } else { - qCDebug(vUndo)<<"Can't find point with id ="<elementById(id); @@ -52,12 +52,12 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0")); oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrY, "0.0")); - qCDebug(vUndo)<<"SPoint oldX"<getSPointId(); - qCDebug(vUndo)<<"Mergin."; + qCDebug(vUndo, "Mergin."); if (id != nodeId) { - qCDebug(vUndo)<<"Merging canceled."; + qCDebug(vUndo, "Merging canceled."); return false; } - qCDebug(vUndo)<<"Mergin undo."; + qCDebug(vUndo, "Mergin undo."); newX = moveCommand->getNewX(); newY = moveCommand->getNewY(); - qCDebug(vUndo)<<"SPoint newX"<elementById(nodeId); if (domElement.isElement()) @@ -129,7 +129,7 @@ void MoveSPoint::Do(double x, double y) } else { - qCDebug(vUndo)<<"Can't find spoint with id ="<elementById(nodeId); if (domElement.isElement()) @@ -75,7 +75,7 @@ void SaveDetailOptions::undo() } else { - qCDebug(vUndo)<<"Can't find detail with id ="<elementById(nodeId); if (domElement.isElement()) @@ -112,7 +112,7 @@ void SaveDetailOptions::redo() } else { - qCDebug(vUndo)<<"Can't find detail with id ="<elementById(nodeId); if (domElement.isElement()) @@ -57,7 +57,7 @@ void SaveToolOptions::undo() } else { - qCDebug(vUndo)<<"Can't find tool with id ="<elementById(nodeId); if (domElement.isElement()) @@ -76,7 +76,7 @@ void SaveToolOptions::redo() } else { - qCDebug(vUndo)<<"Can't find tool with id ="< 1)//don't need upadate data if we have only one pattern piece { - qCDebug(vXML)<<"Setting current data"; - qCDebug(vXML)<<"Current PP name"<getData(); - qCDebug(vXML)<<"Data successfully updated."; + qCDebug(vXML, "Data successfully updated."); } else { - qCDebug(vXML)<<"List of tools is empty!"; + qCDebug(vXML, "List of tools is empty!"); } } } @@ -776,7 +777,7 @@ void VPattern::LiteParseTree(const Document &parse) Parse(parse); break; case Document::FullParse: - qCWarning(vXML)<<"Lite parsing doesn't support full parsing"; + qCWarning(vXML, "Lite parsing doesn't support full parsing"); break; default: break; @@ -836,13 +837,13 @@ void VPattern::LiteParseTree(const Document &parse) // Restore name current pattern piece nameActivPP = namePP; - qCDebug(vXML)<<"Current pattern piece"<getSceneView()); VAbstractTool::NewSceneRect(sceneDetail, qApp->getSceneView()); - qCDebug(vXML)<<"Scene size updated."; + qCDebug(vXML, "Scene size updated."); } //--------------------------------------------------------------------------------------------------------------------- @@ -906,20 +907,20 @@ void VPattern::ParseDrawElement(const QDomNode &node, const Document &parse) switch (tags.indexOf(domElement.tagName())) { case 0: // TagCalculation - qCDebug(vXML)<<"Tag calculation."; + qCDebug(vXML, "Tag calculation."); data->ClearCalculationGObjects(); ParseDrawMode(domElement, parse, Draw::Calculation); break; case 1: // TagModeling - qCDebug(vXML)<<"Tag modeling."; + qCDebug(vXML, "Tag modeling."); ParseDrawMode(domElement, parse, Draw::Modeling); break; case 2: // TagDetails - qCDebug(vXML)<<"Tag details."; + qCDebug(vXML, "Tag details."); ParseDetails(domElement, parse); break; default: - qCDebug(vXML)<<"Wrong tag name"; + qCDebug(vXML, "Wrong tag name"); break; } } @@ -959,27 +960,27 @@ void VPattern::ParseDrawMode(const QDomNode &node, const Document &parse, const switch (tags.indexOf(domElement.tagName())) { case 0: // TagPoint - qCDebug(vXML)<<"Tag point."; + qCDebug(vXML, "Tag point."); ParsePointElement(scene, domElement, parse, domElement.attribute(AttrType, "")); break; case 1: // TagLine - qCDebug(vXML)<<"Tag line."; + qCDebug(vXML, "Tag line."); ParseLineElement(scene, domElement, parse); break; case 2: // TagSpline - qCDebug(vXML)<<"Tag spline."; + qCDebug(vXML, "Tag spline."); ParseSplineElement(scene, domElement, parse, domElement.attribute(AttrType, "")); break; case 3: // TagArc - qCDebug(vXML)<<"Tag arc."; + qCDebug(vXML, "Tag arc."); ParseArcElement(scene, domElement, parse, domElement.attribute(AttrType, "")); break; case 4: // TagTools - qCDebug(vXML)<<"Tag tools."; + qCDebug(vXML, "Tag tools."); ParseToolsElement(scene, domElement, parse, domElement.attribute(AttrType, "")); break; default: - qCDebug(vXML)<<"Wrong tag name"; + qCDebug(vXML, "Wrong tag name"); break; } } @@ -1856,7 +1857,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & switch (splines.indexOf(type)) { case 0: //VToolSpline::ToolType - qCDebug(vXML)<<"VToolSpline."; + qCDebug(vXML, "VToolSpline."); try { ToolsCommonAttributes(domElement, id); @@ -1881,7 +1882,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; case 1: //VToolSplinePath::ToolType - qCDebug(vXML)<<"VToolSplinePath."; + qCDebug(vXML, "VToolSplinePath."); try { ToolsCommonAttributes(domElement, id); @@ -1928,7 +1929,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; case 2: //VNodeSpline::ToolType - qCDebug(vXML)<<"VNodeSpline."; + qCDebug(vXML, "VNodeSpline."); try { SplinesCommonAttributes(domElement, id, idObject, idTool); @@ -1946,7 +1947,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; case 3: //VNodeSplinePath::ToolType - qCDebug(vXML)<<"VNodeSplinePath."; + qCDebug(vXML, "VNodeSplinePath."); try { SplinesCommonAttributes(domElement, id, idObject, idTool); @@ -1964,7 +1965,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; default: - qCDebug(vXML) << "Illegal spline type in VDomDocument::ParseSplineElement()."; + qCDebug(vXML, "Illegal spline type in VDomDocument::ParseSplineElement()."); break; } } @@ -2487,7 +2488,7 @@ QString VPattern::GenerateLabel(const LabelType &type) const } ++i; } - qCDebug(vXML)<<"Point label:"<IsUnique(name) == false); - qCDebug(vXML)<<"Point label:"<(type); + qCDebug(vXML, "Got unknow type %d", static_cast(type)); return QString(); } diff --git a/src/libs/ifc/exception/vexception.cpp b/src/libs/ifc/exception/vexception.cpp index ba78fb87b..94dab8cfe 100644 --- a/src/libs/ifc/exception/vexception.cpp +++ b/src/libs/ifc/exception/vexception.cpp @@ -103,7 +103,8 @@ void VException::CriticalMessageBox(const QString &situation, QWidget * parent) #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif - qCDebug(vExcep)<<"Critical error!"< &vector) */ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName) { - qCDebug(vXML)<<"Validation xml file"<