GCC warning “ISO C99 requires rest arguments to be used”.

For fixing use printf style.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-04-01 20:08:35 +03:00
parent 30f6aea194
commit ff44834417
29 changed files with 265 additions and 250 deletions

View File

@ -150,7 +150,7 @@ GCC_DEBUG_CXXFLAGS += \
-Wmissing-format-attribute \ -Wmissing-format-attribute \
-Wswitch-default \ -Wswitch-default \
-Wuninitialized \ -Wuninitialized \
-Wno-variadic-macros \ -Wvariadic-macros \
-Wlogical-op \ -Wlogical-op \
-Wnoexcept \ -Wnoexcept \
-Wmissing-noreturn \ -Wmissing-noreturn \

View File

@ -211,7 +211,7 @@ void VContainer::UpdateObject(QHash<quint32, val> &obj, const quint32 &id, val p
*/ */
void VContainer::Clear() void VContainer::Clear()
{ {
qCDebug(vCon)<<"Clearing container data."; qCDebug(vCon, "Clearing container data.");
_id = NULL_ID; _id = NULL_ID;
d->details.clear(); d->details.clear();

View File

@ -21,10 +21,15 @@
#include "qcommandlineoption.h" #include "qcommandlineoption.h"
#include "qset.h" #include <QSet>
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0) #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 class QCommandLineOptionPrivate : public QSharedData
{ {
public: public:
@ -51,6 +56,10 @@ public:
bool hidden; bool hidden;
}; };
#ifdef Q_CC_GNU
#pragma GCC diagnostic pop
#endif
/*! /*!
\since 5.2 \since 5.2
\class QCommandLineOption \class QCommandLineOption

View File

@ -180,7 +180,7 @@ VApplication::VApplication(int &argc, char **argv)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VApplication::~VApplication() VApplication::~VApplication()
{ {
qCDebug(vApp)<<"Application closing."; qCDebug(vApp, "Application closing.");
qInstallMessageHandler(0); // Resore the message handler qInstallMessageHandler(0); // Resore the message handler
delete out; delete out;
@ -199,31 +199,31 @@ VApplication::~VApplication()
*/ */
void VApplication::NewValentina(const QString &fileName) void VApplication::NewValentina(const QString &fileName)
{ {
qCDebug(vApp)<<"Open new detached process."; qCDebug(vApp, "Open new detached process.");
if (fileName.isEmpty()) if (fileName.isEmpty())
{ {
qCDebug(vApp)<<"New process without arguments. program ="<<qApp->applicationFilePath(); qCDebug(vApp, "New process without arguments. program = %s", qApp->applicationFilePath().toUtf8().constData());
// Path can contain spaces. // Path can contain spaces.
if (QProcess::startDetached("\""+qApp->applicationFilePath()+"\"")) if (QProcess::startDetached("\""+qApp->applicationFilePath()+"\""))
{ {
qCDebug(vApp)<<"The process was started successfully."; qCDebug(vApp, "The process was started successfully.");
} }
else 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 else
{ {
const QString run = QString("\"%1\" \"%2\"").arg(qApp->applicationFilePath()).arg(fileName); const QString run = QString("\"%1\" \"%2\"").arg(qApp->applicationFilePath()).arg(fileName);
qCDebug(vApp)<<"New process with arguments. program ="<<run; qCDebug(vApp, "New process with arguments. program = %s", run.toUtf8().constData());
if (QProcess::startDetached(run)) if (QProcess::startDetached(run))
{ {
qCDebug(vApp)<<"The process was started successfully."; qCDebug(vApp, "The process was started successfully.");
} }
else 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.");
} }
} }
} }
@ -469,19 +469,20 @@ void VApplication::BeginLogging()
logLock->setStaleLockTime(0); logLock->setStaleLockTime(0);
if (TryLock(logLock)) if (TryLock(logLock))
{ {
qCDebug(vApp) << "Log file"<<LogPath()<<"was locked."; qCDebug(vApp, "Log file %s was locked.", LogPath().toUtf8().constData());
} }
else else
{ {
qCDebug(vApp) << "Failed to lock" << LogPath(); qCDebug(vApp, "Failed to lock %s", LogPath().toUtf8().constData());
qCDebug(vApp) << "Error type:"<<logLock->error(); qCDebug(vApp, "Error type: %d", logLock->error());
} }
} }
else else
{ {
delete log; delete log;
log = nullptr; 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); const QStringList allFiles = logsDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
if (allFiles.isEmpty() == false) if (allFiles.isEmpty() == false)
{ {
qCDebug(vApp) << "Clearing old logs"; qCDebug(vApp, "Clearing old logs");
for (int i = 0; i < allFiles.size(); ++i) for (int i = 0; i < allFiles.size(); ++i)
{ {
QFileInfo info(allFiles.at(i)); QFileInfo info(allFiles.at(i));
QLockFile *lock = new QLockFile(info.absoluteFilePath() + ".lock"); QLockFile *lock = new QLockFile(info.absoluteFilePath() + ".lock");
if (TryLock(lock)) if (TryLock(lock))
{ {
qCDebug(vApp) << "Locked file"<<info.absoluteFilePath(); qCDebug(vApp, "Locked file %s", info.absoluteFilePath().toUtf8().constData());
QFile oldLog(allFiles.at(i)); QFile oldLog(allFiles.at(i));
if (oldLog.remove()) if (oldLog.remove())
{ {
qCDebug(vApp) << "Deleted"<<info.absoluteFilePath(); qCDebug(vApp, "Deleted %s", info.absoluteFilePath().toUtf8().constData());
} }
else else
{ {
qCDebug(vApp) << "Could not delete"<<info.absoluteFilePath(); qCDebug(vApp, "Could not delete %s", info.absoluteFilePath().toUtf8().constData());
} }
} }
else else
{ {
qCDebug(vApp) << "Failed to lock"<<info.absoluteFilePath(); qCDebug(vApp, "Failed to lock %s", info.absoluteFilePath().toUtf8().constData());
} }
delete lock; delete lock;
lock = nullptr; lock = nullptr;
@ -524,7 +525,7 @@ void VApplication::ClearOldLogs() const
} }
else else
{ {
qCDebug(vApp) << "There are no old logs."; qCDebug(vApp, "There are no old logs.");
} }
} }

View File

@ -58,10 +58,10 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
qCDebug(vDialog)<<"Showing variables."; qCDebug(vDialog, "Showing variables.");
if (qApp->patternType() == MeasurementsType::Individual) if (qApp->patternType() == MeasurementsType::Individual)
{ {
qCDebug(vDialog)<<"Pattern with individual measurements."; qCDebug(vDialog, "Pattern with individual measurements.");
const QString filePath = doc->MPath(); const QString filePath = doc->MPath();
try try
{ {
@ -668,7 +668,7 @@ void DialogIncrements::OpenTable()
*/ */
void DialogIncrements::clickedToolButtonAdd() void DialogIncrements::clickedToolButtonAdd()
{ {
qCDebug(vDialog)<<"Add new increment"; qCDebug(vDialog, "Add new increment");
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason); ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
ui->tableWidgetIncrement->blockSignals(true); ui->tableWidgetIncrement->blockSignals(true);
qint32 currentRow = ui->tableWidgetIncrement->rowCount(); qint32 currentRow = ui->tableWidgetIncrement->rowCount();
@ -738,7 +738,7 @@ void DialogIncrements::clickedToolButtonRemove()
qint32 row = item->row(); qint32 row = item->row();
QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0); QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0);
qCDebug(vDialog)<<"Remove increment"<<itemName->text(); qCDebug(vDialog, "Remove increment %s", itemName->text().toUtf8().constData());
data->RemoveIncrement(itemName->text()); data->RemoveIncrement(itemName->text());
quint32 id = qvariant_cast<quint32>(itemName->data(Qt::UserRole)); quint32 id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
@ -750,7 +750,7 @@ void DialogIncrements::clickedToolButtonRemove()
} }
else else
{ {
qCDebug(vDialog)<<"Could not find object with id"<<id; qCDebug(vDialog, "Could not find object with id %u", id);
return; return;
} }
@ -778,9 +778,9 @@ void DialogIncrements::clickedToolButtonRemove()
void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize, void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize,
const qreal &kheight, const QString &description) const qreal &kheight, const QString &description)
{ {
qCDebug(vDialog)<<"Saving new increment to file."; qCDebug(vDialog, "Saving new increment to file.");
qCDebug(vDialog)<<QString("Increment: id(%1), name(%2), base(%3), ksize(%4), kheight(%5), description(%6)") qCDebug(vDialog, "%s", QString("Increment: id(%1), name(%2), base(%3), ksize(%4), kheight(%5), description(%6)")
.arg(id).arg(name).arg(base).arg(ksize).arg(kheight).arg(description); .arg(id).arg(name).arg(base).arg(ksize).arg(kheight).arg(description).toUtf8().constData());
QDomElement element = doc->createElement(VPattern::TagIncrement); QDomElement element = doc->createElement(VPattern::TagIncrement);
doc->SetAttribute(element, VDomDocument::AttrId, id); doc->SetAttribute(element, VDomDocument::AttrId, id);
@ -812,47 +812,47 @@ void DialogIncrements::HideColumns(QTableWidget *table)
*/ */
void DialogIncrements::IncrementChanged ( qint32 row, qint32 column ) 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 *itemName = ui->tableWidgetIncrement->item(row, 0);
const QTableWidgetItem *item = ui->tableWidgetIncrement->item(row, column); const QTableWidgetItem *item = ui->tableWidgetIncrement->item(row, column);
const quint32 id = qvariant_cast<quint32>(itemName->data(Qt::UserRole)); const quint32 id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
QDomElement domElement = doc->elementById(id); QDomElement domElement = doc->elementById(id);
if (domElement.isElement() == false) if (domElement.isElement() == false)
{ {
qCDebug(vDialog)<<"Cant't find increment with id = "<<id<<Q_FUNC_INFO; qCDebug(vDialog, "Cant't find increment with id = %u", id);
return; return;
} }
this->row = row; this->row = row;
switch (column) switch (column)
{ {
case 0: // VPattern::IncrementName case 0: // VPattern::IncrementName
qCDebug(vDialog)<<"Changed name to"<<item->text(); qCDebug(vDialog, "Changed name to %s", item->text().toUtf8().constData());
doc->SetAttribute(domElement, VPattern::IncrementName, item->text()); doc->SetAttribute(domElement, VPattern::IncrementName, item->text());
data->ClearVariables(VarType::Increment); data->ClearVariables(VarType::Increment);
this->column = 2; this->column = 2;
emit FullUpdateTree(Document::LiteParse); emit FullUpdateTree(Document::LiteParse);
break; break;
case 2: // VPattern::IncrementBase case 2: // VPattern::IncrementBase
qCDebug(vDialog)<<"Changed base to"<<item->text(); qCDebug(vDialog, "Changed base to %s", item->text().toUtf8().constData());
doc->SetAttribute(domElement, VPattern::IncrementBase, item->text()); doc->SetAttribute(domElement, VPattern::IncrementBase, item->text());
this->column = 3; this->column = 3;
emit FullUpdateTree(Document::LiteParse); emit FullUpdateTree(Document::LiteParse);
break; break;
case 3: // VPattern::IncrementKsize case 3: // VPattern::IncrementKsize
qCDebug(vDialog)<<"Changed ksize to"<<item->text(); qCDebug(vDialog, "Changed ksize to %s", item->text().toUtf8().constData());
doc->SetAttribute(domElement, VPattern::IncrementKsize, item->text()); doc->SetAttribute(domElement, VPattern::IncrementKsize, item->text());
this->column = 4; this->column = 4;
emit FullUpdateTree(Document::LiteParse); emit FullUpdateTree(Document::LiteParse);
break; break;
case 4: // VPattern::IncrementKgrowth case 4: // VPattern::IncrementKgrowth
qCDebug(vDialog)<<"Changed kheight to"<<item->text(); qCDebug(vDialog, "Changed kheight to %s", item->text().toUtf8().constData());
doc->SetAttribute(domElement, VPattern::IncrementKgrowth, item->text()); doc->SetAttribute(domElement, VPattern::IncrementKgrowth, item->text());
this->column = 5; this->column = 5;
emit FullUpdateTree(Document::LiteParse); emit FullUpdateTree(Document::LiteParse);
break; break;
case 5: // VPattern::IncrementDescription case 5: // VPattern::IncrementDescription
{ {
qCDebug(vDialog)<<"Changed description to"<<item->text(); qCDebug(vDialog, "Changed description to %s", item->text().toUtf8().constData());
doc->SetAttribute(domElement, VPattern::IncrementDescription, item->text()); doc->SetAttribute(domElement, VPattern::IncrementDescription, item->text());
QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(itemName->text()); QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(itemName->text());
incr->SetDescription(item->text()); incr->SetDescription(item->text());
@ -873,7 +873,7 @@ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
{ {
qCDebug(vDialog)<<"Measurement changed."; qCDebug(vDialog, "Measurement changed.");
switch (column) switch (column)
{ {
case 2:// value column case 2:// value column
@ -887,7 +887,7 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
QDomElement domElement = list.at(0).toElement(); QDomElement domElement = list.at(0).toElement();
if (domElement.isElement() == false) if (domElement.isElement() == false)
{ {
qCDebug(vDialog)<<"Can't find measurement "<<tag<<Q_FUNC_INFO; qCDebug(vDialog, "Can't find measurement %s", tag.toUtf8().constData());
return; return;
} }
@ -897,13 +897,13 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
{ {
measur->SetBase(0); measur->SetBase(0);
item->setText("0"); item->setText("0");
qCDebug(vDialog)<<"Can't convert toDouble measurement value"<<Q_FUNC_INFO; qCDebug(vDialog, "Can't convert toDouble measurement value");
} }
else else
{ {
measur->SetBase(base); measur->SetBase(base);
} }
qCDebug(vDialog)<<"Changed value to"<<base; qCDebug(vDialog, "Changed value to %f", base);
// Convert value to measurements table unit // Convert value to measurements table unit
base = VAbstractMeasurements::UnitConvertor(base, qApp->patternUnit(), m->MUnit()); base = VAbstractMeasurements::UnitConvertor(base, qApp->patternUnit(), m->MUnit());

View File

@ -64,7 +64,7 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q
connect(bCansel, &QPushButton::clicked, this, &DialogStandardMeasurements::DialogRejected); 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); ui->lineEditName->setText(_name);
LoadStandardTables(); LoadStandardTables();
@ -151,7 +151,7 @@ void DialogStandardMeasurements::CheckState()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogStandardMeasurements::LoadStandardTables() void DialogStandardMeasurements::LoadStandardTables()
{ {
qCDebug(vStMeasur)<<"Loading standard table."; qCDebug(vStMeasur, "Loading standard table.");
QStringList filters{"*.vst"}; QStringList filters{"*.vst"};
//Use standard path to standard measurements //Use standard path to standard measurements
const QString path = qApp->getSettings()->GetPathStandardMeasurements(); const QString path = qApp->getSettings()->GetPathStandardMeasurements();
@ -162,13 +162,13 @@ void DialogStandardMeasurements::LoadStandardTables()
const QStringList allFiles = tablesDir.entryList(QDir::NoDotAndDotDot | QDir::Files); const QStringList allFiles = tablesDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
if (allFiles.isEmpty() == true) if (allFiles.isEmpty() == true)
{ {
qCDebug(vStMeasur)<<"Can't find standard measurements in path"<<path; qCDebug(vStMeasur, "Can't find standard measurements in path %s", path.toUtf8().constData());
ui->comboBoxTables->clear(); ui->comboBoxTables->clear();
CheckState(); CheckState();
return; return;
} }
qCDebug(vStMeasur)<<"Was found"<<allFiles.size()<<"tables."; qCDebug(vStMeasur, "Was found %d tables.", allFiles.size());
for (int i = 0; i < allFiles.size(); ++i) for (int i = 0; i < allFiles.size(); ++i)
{ {
QFileInfo fi(allFiles.at(i)); QFileInfo fi(allFiles.at(i));
@ -179,22 +179,23 @@ void DialogStandardMeasurements::LoadStandardTables()
m.setXMLContent(fi.absoluteFilePath()); m.setXMLContent(fi.absoluteFilePath());
if (m.MUnit() == Unit::Inch) if (m.MUnit() == Unit::Inch)
{ {
qCWarning(vStMeasur)<<"We do not support inches for standard table. Ignore table" qCWarning(vStMeasur, "We do not support inches for standard table. Ignore table %s .",
<<fi.absoluteFilePath()<<"."; fi.absoluteFilePath().toUtf8().constData());
} }
else else
{ {
const QString desc = m.TrDescription(); const QString desc = m.TrDescription();
if (desc.isEmpty() == false) if (desc.isEmpty() == false)
{ {
qCDebug(vStMeasur)<<"Adding table from"<<fi.absoluteFilePath(); qCDebug(vStMeasur, "Adding table from %s", fi.absoluteFilePath().toUtf8().constData());
ui->comboBoxTables->addItem(desc, QVariant(fi.absoluteFilePath())); ui->comboBoxTables->addItem(desc, QVariant(fi.absoluteFilePath()));
} }
} }
} }
catch (VException &e) catch (VException &e)
{ {
qCDebug(vStMeasur)<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO; qCDebug(vStMeasur, "File error. %s %s", e.ErrorMessage().toUtf8().constData(),
e.DetailedInformation().toUtf8().constData());
continue; continue;
} }
} }

View File

@ -143,30 +143,30 @@ MainWindow::MainWindow(QWidget *parent)
*/ */
void MainWindow::ActionNewPP() void MainWindow::ActionNewPP()
{ {
qCDebug(vMainWindow)<<"New PP."; qCDebug(vMainWindow, "New PP.");
QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1); QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1);
qCDebug(vMainWindow)<<"Generated PP name:"<<patternPieceName; qCDebug(vMainWindow, "Generated PP name: %s", patternPieceName.toUtf8().constData());
QString path; QString path;
if (comboBoxDraws->count() == 0) if (comboBoxDraws->count() == 0)
{ {
qCDebug(vMainWindow)<<"First PP"; qCDebug(vMainWindow, "First PP");
DialogMeasurements measurements(this); DialogMeasurements measurements(this);
if (measurements.exec() == QDialog::Rejected) if (measurements.exec() == QDialog::Rejected)
{ {
qCDebug(vMainWindow)<<"Creation PP was canceled"; qCDebug(vMainWindow, "Creation PP was canceled");
return; return;
} }
if (measurements.type() == MeasurementsType::Standard) if (measurements.type() == MeasurementsType::Standard)
{ {
qCDebug(vMainWindow)<<"PP with standard measurements"; qCDebug(vMainWindow, "PP with standard measurements");
qApp->setPatternType(MeasurementsType::Standard); qApp->setPatternType(MeasurementsType::Standard);
DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this); DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this);
if (stMeasurements.exec() == QDialog::Accepted) if (stMeasurements.exec() == QDialog::Accepted)
{ {
patternPieceName = stMeasurements.name(); patternPieceName = stMeasurements.name();
qCDebug(vMainWindow)<<"PP name:"<<patternPieceName; qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
path = stMeasurements.tablePath(); path = stMeasurements.tablePath();
qCDebug(vMainWindow)<<"Table path:"<<path; qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
VStandardMeasurements m(pattern); VStandardMeasurements m(pattern);
m.setXMLContent(path); m.setXMLContent(path);
m.SetSize(); m.SetSize();
@ -175,13 +175,13 @@ void MainWindow::ActionNewPP()
} }
else else
{ {
qCDebug(vMainWindow)<<"Selection standard measurements canceled."; qCDebug(vMainWindow, "Selection standard measurements canceled.");
return; return;
} }
} }
else else
{ {
qCDebug(vMainWindow)<<"PP with individual measurements."; qCDebug(vMainWindow, "PP with individual measurements.");
QMessageBox::StandardButton ret; QMessageBox::StandardButton ret;
ret = QMessageBox::question(this, tr("Individual measurements is under development"), ret = QMessageBox::question(this, tr("Individual measurements is under development"),
tr("There is no way create individual measurements file independent on the " tr("There is no way create individual measurements file independent on the "
@ -198,16 +198,16 @@ void MainWindow::ActionNewPP()
if (indMeasurements.exec() == QDialog::Accepted) if (indMeasurements.exec() == QDialog::Accepted)
{ {
patternPieceName = indMeasurements.name(); patternPieceName = indMeasurements.name();
qCDebug(vMainWindow)<<"PP name:"<<patternPieceName; qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
path = indMeasurements.tablePath(); path = indMeasurements.tablePath();
qCDebug(vMainWindow)<<"Table path:"<<path; qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
VIndividualMeasurements m(pattern); VIndividualMeasurements m(pattern);
m.setXMLContent(path); m.setXMLContent(path);
m.Measurements(); m.Measurements();
} }
else else
{ {
qCDebug(vMainWindow)<<"Selection individual measurements canceled."; qCDebug(vMainWindow, "Selection individual measurements canceled.");
return; return;
} }
} }
@ -219,19 +219,19 @@ void MainWindow::ActionNewPP()
} }
else else
{ {
qCDebug(vMainWindow)<<"PP count"<<comboBoxDraws->count(); qCDebug(vMainWindow, "PP count %d", comboBoxDraws->count());
patternPieceName = PatternPieceName(patternPieceName); patternPieceName = PatternPieceName(patternPieceName);
qCDebug(vMainWindow)<<"PP name:"<<patternPieceName; qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
if (patternPieceName.isEmpty()) if (patternPieceName.isEmpty())
{ {
qCDebug(vMainWindow)<<"Name empty."; qCDebug(vMainWindow, "Name empty.");
return; return;
} }
path = doc->MPath(); path = doc->MPath();
} }
if (doc->appendPP(patternPieceName) == false) if (doc->appendPP(patternPieceName) == false)
{ {
qCDebug(vMainWindow)<<"Error creating pattern piece with the name "<<patternPieceName<<"."; qCDebug(vMainWindow, "Error creating pattern piece with the name %s.", patternPieceName.toUtf8().constData());
return; return;
} }
comboBoxDraws->blockSignals(true); comboBoxDraws->blockSignals(true);
@ -826,7 +826,7 @@ void MainWindow::showEvent( QShowEvent *event )
*/ */
void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::closeEvent(QCloseEvent *event)
{ {
qCDebug(vMainWindow)<<"Closing main window"; qCDebug(vMainWindow, "Closing main window");
if (MaybeSave()) if (MaybeSave())
{ {
FileClosedCorrect(); FileClosedCorrect();
@ -836,7 +836,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
} }
else else
{ {
qCDebug(vMainWindow)<<"Closing canceled."; qCDebug(vMainWindow, "Closing canceled.");
event->ignore(); event->ignore();
} }
} }
@ -1045,10 +1045,10 @@ void MainWindow::mouseMove(const QPointF &scenePos)
*/ */
void MainWindow::CancelTool() void MainWindow::CancelTool()
{ {
qCDebug(vMainWindow)<<"Canceling tool."; qCDebug(vMainWindow, "Canceling tool.");
delete dialogTool; delete dialogTool;
dialogTool = nullptr; dialogTool = nullptr;
qCDebug(vMainWindow)<<"Dialog closed."; qCDebug(vMainWindow, "Dialog closed.");
switch ( currentTool ) switch ( currentTool )
{ {
case Tool::Arrow: case Tool::Arrow:
@ -1142,7 +1142,7 @@ void MainWindow::CancelTool()
*/ */
void MainWindow::ArrowTool() void MainWindow::ArrowTool()
{ {
qCDebug(vMainWindow)<<"Arrow tool."; qCDebug(vMainWindow, "Arrow tool.");
CancelTool(); CancelTool();
ui->actionArrowTool->setChecked(true); ui->actionArrowTool->setChecked(true);
ui->actionStopTool->setEnabled(false); ui->actionStopTool->setEnabled(false);
@ -1152,7 +1152,7 @@ void MainWindow::ArrowTool()
ui->view->setCursor(cur); ui->view->setCursor(cur);
helpLabel->setText(""); helpLabel->setText("");
ui->view->setShowToolOptions(true); 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) if (checked)
{ {
qCDebug(vMainWindow)<<"Show draw scene"; qCDebug(vMainWindow, "Show draw scene");
ui->actionDetails->setChecked(false); ui->actionDetails->setChecked(false);
SaveCurrentScene(); SaveCurrentScene();
@ -1256,7 +1256,7 @@ void MainWindow::ActionDetails(bool checked)
{ {
if (checked) if (checked)
{ {
qCDebug(vMainWindow)<<"Show details scene"; qCDebug(vMainWindow, "Show details scene");
ui->actionDraw->setChecked(false); ui->actionDraw->setChecked(false);
SaveCurrentScene(); SaveCurrentScene();
@ -1380,7 +1380,7 @@ bool MainWindow::Save()
*/ */
void MainWindow::Open() void MainWindow::Open()
{ {
qCDebug(vMainWindow)<<"Openning new file."; qCDebug(vMainWindow, "Openning new file.");
const QString filter(tr("Pattern files (*.val)")); const QString filter(tr("Pattern files (*.val)"));
//Get list last open files //Get list last open files
const QStringList files = qApp->getSettings()->GetRecentFileList(); const QStringList files = qApp->getSettings()->GetRecentFileList();
@ -1394,7 +1394,7 @@ void MainWindow::Open()
//Absolute path to last open file //Absolute path to last open file
dir = QFileInfo(files.first()).absolutePath(); dir = QFileInfo(files.first()).absolutePath();
} }
qCDebug(vMainWindow)<<"Run QFileDialog::getOpenFileName: dir ="<<dir<<"."; qCDebug(vMainWindow, "Run QFileDialog::getOpenFileName: dir = %s.", dir.toUtf8().constData());
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter); const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter);
if (filePath.isEmpty()) if (filePath.isEmpty())
{ {
@ -1421,14 +1421,14 @@ void MainWindow::Preferences()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::RepotBug() void MainWindow::RepotBug()
{ {
qCDebug(vMainWindow)<<"Reporting bug"; qCDebug(vMainWindow, "Reporting bug");
QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/issues/new")); QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/issues/new"));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::OnlineHelp() void MainWindow::OnlineHelp()
{ {
qCDebug(vMainWindow)<<"Showing online help"; qCDebug(vMainWindow, "Showing online help");
QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/wiki/manual/Content")); QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/wiki/manual/Content"));
} }
@ -1438,21 +1438,21 @@ void MainWindow::OnlineHelp()
*/ */
void MainWindow::Clear() void MainWindow::Clear()
{ {
qCDebug(vMainWindow)<<"Reseting main window."; qCDebug(vMainWindow, "Reseting main window.");
delete lock; // Unlock pattern file delete lock; // Unlock pattern file
lock = nullptr; lock = nullptr;
qCDebug(vMainWindow)<<"Unlocked pattern file."; qCDebug(vMainWindow, "Unlocked pattern file.");
ui->actionDetails->setChecked(false); ui->actionDetails->setChecked(false);
ui->actionDraw->setChecked(true); ui->actionDraw->setChecked(true);
ui->actionDraw->setEnabled(false); ui->actionDraw->setEnabled(false);
qCDebug(vMainWindow)<<"Returned to Draw mode."; qCDebug(vMainWindow, "Returned to Draw mode.");
setCurrentFile(QString()); setCurrentFile(QString());
pattern->Clear(); pattern->Clear();
qCDebug(vMainWindow)<<"Clearing pattern."; qCDebug(vMainWindow, "Clearing pattern.");
doc->clear(); doc->clear();
qCDebug(vMainWindow)<<"Clearing scenes."; qCDebug(vMainWindow, "Clearing scenes.");
sceneDraw->clear(); sceneDraw->clear();
sceneDetails->clear(); sceneDetails->clear();
ArrowTool(); ArrowTool();
@ -1501,7 +1501,7 @@ void MainWindow::FileClosedCorrect()
{ {
autofile.remove(); autofile.remove();
} }
qCDebug(vMainWindow)<<"File"<<curFile<<"closed correct."; qCDebug(vMainWindow, "File %s closed correct.", curFile.toUtf8().constData());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1521,7 +1521,7 @@ void MainWindow::ResetWindow()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::FullParseFile() void MainWindow::FullParseFile()
{ {
qCDebug(vMainWindow)<<"Full parsing file"; qCDebug(vMainWindow, "Full parsing file");
toolOptions->ClearPropertyBrowser(); toolOptions->ClearPropertyBrowser();
try try
@ -1997,7 +1997,7 @@ void MainWindow::MinimumScrollBar()
*/ */
bool MainWindow::SavePattern(const QString &fileName, QString &error) bool MainWindow::SavePattern(const QString &fileName, QString &error)
{ {
qCDebug(vMainWindow)<<"Saving pattern file"<<fileName<<"."; qCDebug(vMainWindow, "Saving pattern file %s.", fileName.toUtf8().constData());
QFileInfo tempInfo(fileName); QFileInfo tempInfo(fileName);
const bool result = doc->SaveDocument(fileName, error); const bool result = doc->SaveDocument(fileName, error);
if (result) if (result)
@ -2006,13 +2006,13 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error)
{ {
setCurrentFile(fileName); setCurrentFile(fileName);
helpLabel->setText(tr("File saved")); helpLabel->setText(tr("File saved"));
qCDebug(vMainWindow)<<"File"<<fileName<<"saved."; qCDebug(vMainWindow, "File %s saved.", fileName.toUtf8().constData());
PatternWasModified(result); PatternWasModified(result);
} }
} }
else else
{ {
qCDebug(vMainWindow)<<"Could not save file"<<fileName<<"."<<error<<"."; qCDebug(vMainWindow, "Could not save file %s. %s.", fileName.toUtf8().constData(), error.toUtf8().constData());
} }
return result; return result;
} }
@ -2023,7 +2023,7 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error)
*/ */
void MainWindow::AutoSavePattern() void MainWindow::AutoSavePattern()
{ {
qCDebug(vMainWindow)<<"Autosaving pattern."; qCDebug(vMainWindow, "Autosaving pattern.");
if (curFile.isEmpty() == false && this->isWindowModified() == true) if (curFile.isEmpty() == false && this->isWindowModified() == true)
{ {
@ -2041,7 +2041,7 @@ void MainWindow::AutoSavePattern()
*/ */
void MainWindow::setCurrentFile(const QString &fileName) void MainWindow::setCurrentFile(const QString &fileName)
{ {
qCDebug(vMainWindow)<<"Set current name to \""<<fileName<<"\""; qCDebug(vMainWindow, "Set current name to \"%s\"", fileName.toUtf8().constData());
curFile = fileName; curFile = fileName;
qApp->getUndoStack()->setClean(); qApp->getUndoStack()->setClean();
@ -2052,7 +2052,7 @@ void MainWindow::setCurrentFile(const QString &fileName)
} }
else else
{ {
qCDebug(vMainWindow)<<"Updating recent file list."; qCDebug(vMainWindow, "Updating recent file list.");
QStringList files = qApp->getSettings()->GetRecentFileList(); QStringList files = qApp->getSettings()->GetRecentFileList();
files.removeAll(fileName); files.removeAll(fileName);
files.prepend(fileName); files.prepend(fileName);
@ -2064,7 +2064,7 @@ void MainWindow::setCurrentFile(const QString &fileName)
qApp->getSettings()->SetRecentFileList(files); qApp->getSettings()->SetRecentFileList(files);
UpdateRecentFileActions(); UpdateRecentFileActions();
qCDebug(vMainWindow)<<"Updating restore file list."; qCDebug(vMainWindow, "Updating restore file list.");
QStringList restoreFiles = qApp->getSettings()->GetRestoreFileList(); QStringList restoreFiles = qApp->getSettings()->GetRestoreFileList();
restoreFiles.removeAll(fileName); restoreFiles.removeAll(fileName);
restoreFiles.prepend(fileName); restoreFiles.prepend(fileName);
@ -2091,7 +2091,7 @@ QString MainWindow::strippedName(const QString &fullFileName)
*/ */
void MainWindow::ReadSettings() void MainWindow::ReadSettings()
{ {
qCDebug(vMainWindow)<<"Reading settings."; qCDebug(vMainWindow, "Reading settings.");
restoreGeometry(qApp->getSettings()->GetGeometry()); restoreGeometry(qApp->getSettings()->GetGeometry());
restoreState(qApp->getSettings()->GetWindowState()); restoreState(qApp->getSettings()->GetWindowState());
@ -2142,7 +2142,7 @@ bool MainWindow::MaybeSave()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::UpdateRecentFileActions() void MainWindow::UpdateRecentFileActions()
{ {
qCDebug(vMainWindow)<<"Updating recent file actions."; qCDebug(vMainWindow, "Updating recent file actions.");
const QStringList files = qApp->getSettings()->GetRecentFileList(); const QStringList files = qApp->getSettings()->GetRecentFileList();
const int numRecentFiles = qMin(files.size(), static_cast<int>(MaxRecentFiles)); const int numRecentFiles = qMin(files.size(), static_cast<int>(MaxRecentFiles));
@ -2323,7 +2323,7 @@ void MainWindow::AddDocks()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::PropertyBrowser() void MainWindow::PropertyBrowser()
{ {
qCDebug(vMainWindow)<<"Initialization property browser."; qCDebug(vMainWindow, "Initialization property browser.");
toolOptions = new VToolOptionsPropertyBrowser(ui->dockWidgetToolOptions); toolOptions = new VToolOptionsPropertyBrowser(ui->dockWidgetToolOptions);
connect(ui->view, &VMainGraphicsView::itemClicked, toolOptions, &VToolOptionsPropertyBrowser::itemClicked); connect(ui->view, &VMainGraphicsView::itemClicked, toolOptions, &VToolOptionsPropertyBrowser::itemClicked);
@ -2395,7 +2395,7 @@ void MainWindow::InitAutoSave()
{ {
const qint32 autoTime = qApp->getSettings()->GetAutosaveTime(); const qint32 autoTime = qApp->getSettings()->GetAutosaveTime();
autoSaveTimer->start(autoTime*60000); autoSaveTimer->start(autoTime*60000);
qCDebug(vMainWindow)<<"Autosaving each"<<autoTime<<"minutes."; qCDebug(vMainWindow, "Autosaving each %d minutes.", autoTime);
} }
qApp->setAutoSaveTimer(autoSaveTimer); qApp->setAutoSaveTimer(autoSaveTimer);
} }
@ -2449,7 +2449,7 @@ MainWindow::~MainWindow()
*/ */
void MainWindow::LoadPattern(const QString &fileName) void MainWindow::LoadPattern(const QString &fileName)
{ {
qCDebug(vMainWindow)<<"Loading new file"<<fileName<<"."; qCDebug(vMainWindow, "Loading new file %s.", fileName.toUtf8().constData());
//We have unsaved changes or load more then one file per time //We have unsaved changes or load more then one file per time
if (OpenNewValentina(fileName)) if (OpenNewValentina(fileName))
@ -2459,25 +2459,25 @@ void MainWindow::LoadPattern(const QString &fileName)
if (fileName.isEmpty()) if (fileName.isEmpty())
{ {
qCDebug(vMainWindow) << "Got empty file."; qCDebug(vMainWindow, "Got empty file.");
Clear(); Clear();
return; return;
} }
qCDebug(vMainWindow)<<"Loking file"; qCDebug(vMainWindow, "Loking file");
lock = new QLockFile(fileName+".lock"); lock = new QLockFile(fileName+".lock");
lock->setStaleLockTime(0); lock->setStaleLockTime(0);
if (VApplication::TryLock(lock)) if (VApplication::TryLock(lock))
{ {
qCDebug(vMainWindow) << "Pattern file"<<fileName<<"was locked."; qCDebug(vMainWindow, "Pattern file %s was locked.", fileName.toUtf8().constData());
} }
else else
{ {
qCDebug(vMainWindow) << "Failed to lock" << fileName; qCDebug(vMainWindow, "Failed to lock %s", fileName.toUtf8().constData());
qCDebug(vMainWindow) << "Error type:"<<lock->error(); qCDebug(vMainWindow, "Error type: %d", lock->error());
if (lock->error() == QLockFile::LockFailedError) 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(); Clear();
return; return;
} }
@ -2520,7 +2520,7 @@ void MainWindow::LoadPattern(const QString &fileName)
{ {
QMessageBox::critical(this, tr("Wrong units."), QMessageBox::critical(this, tr("Wrong units."),
tr("Application doesn't support standard table with inches.")); 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(); Clear();
return; return;
} }
@ -2556,7 +2556,7 @@ void MainWindow::LoadPattern(const QString &fileName)
PatternWasModified(!patternModified); PatternWasModified(!patternModified);
} }
helpLabel->setText(tr("File loaded")); helpLabel->setText(tr("File loaded"));
qCDebug(vMainWindow)<<"File loaded."; qCDebug(vMainWindow, "File loaded.");
qApp->setOpeningPattern();// End opening file qApp->setOpeningPattern();// End opening file
@ -2611,7 +2611,7 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args)
const QStringList files = GetUnlokedRestoreFileList(); const QStringList files = GetUnlokedRestoreFileList();
if (files.size() > 0) if (files.size() > 0)
{ {
qCDebug(vMainWindow)<<"Reopen files after crash."; qCDebug(vMainWindow, "Reopen files after crash.");
QStringList restoreFiles; QStringList restoreFiles;
for (int i = 0; i < files.size(); ++i) for (int i = 0; i < files.size(); ++i)
@ -2632,7 +2632,7 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args)
QMessageBox::Yes); QMessageBox::Yes);
if (reply == QMessageBox::Yes) if (reply == QMessageBox::Yes)
{ {
qCDebug(vMainWindow)<<"User said Yes."; qCDebug(vMainWindow, "User said Yes.");
for (int i = 0; i < restoreFiles.size(); ++i) for (int i = 0; i < restoreFiles.size(); ++i)
{ {
@ -2646,8 +2646,9 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args)
} }
else else
{ {
qCDebug(vMainWindow) << "Could not copy "<<restoreFiles.at(i) +".autosave"<<"to" qCDebug(vMainWindow, "Could not copy %s.autosave to %s %s",
<<restoreFiles.at(i)<<error; restoreFiles.at(i).toUtf8().constData(), restoreFiles.at(i).toUtf8().constData(),
error.toUtf8().constData());
} }
} }
} }

View File

@ -113,7 +113,7 @@ void VDrawTool::FullUpdateFromGuiApply()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VDrawTool::SaveDialogChange() void VDrawTool::SaveDialogChange()
{ {
qCDebug(vTool)<<"Saving tool options after using dialog"; qCDebug(vTool, "Saving tool options after using dialog");
QDomElement oldDomElement = doc->elementById(id); QDomElement oldDomElement = doc->elementById(id);
if (oldDomElement.isElement()) if (oldDomElement.isElement())
{ {
@ -126,7 +126,7 @@ void VDrawTool::SaveDialogChange()
} }
else 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 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 else
{ {
qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; qCDebug(vTool, "Can't find tool with id = %u", id);
} }
} }

View File

@ -90,7 +90,8 @@ QString VToolPoint::name() const
} }
catch (const VExceptionBadId &e) catch (const VExceptionBadId &e)
{ {
qCDebug(vToolPoint)<<"Error!"<<"Couldn't get point name."<<e.ErrorMessage()<<e.DetailedInformation(); qCDebug(vToolPoint, "Error! Couldn't get point name. %s %s", e.ErrorMessage().toUtf8().constData(),
e.DetailedInformation().toUtf8().constData());
return QString("");// Return empty string for property browser return QString("");// Return empty string for property browser
} }
} }

View File

@ -329,7 +329,7 @@ QMap<QString, quint32> VAbstractTool::PointsList() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VAbstractTool::SaveOption(QSharedPointer<VGObject> &obj) void VAbstractTool::SaveOption(QSharedPointer<VGObject> &obj)
{ {
qCDebug(vTool)<<"Saving tool options"; qCDebug(vTool, "Saving tool options");
QDomElement oldDomElement = doc->elementById(id); QDomElement oldDomElement = doc->elementById(id);
if (oldDomElement.isElement()) if (oldDomElement.isElement())
{ {
@ -343,7 +343,7 @@ void VAbstractTool::SaveOption(QSharedPointer<VGObject> &obj)
} }
else else
{ {
qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; qCDebug(vTool, "Can't find tool with id = %u", id);
} }
} }

View File

@ -45,7 +45,7 @@ AddDet::~AddDet()
// cppcheck-suppress unusedFunction // cppcheck-suppress unusedFunction
void AddDet::undo() void AddDet::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
QDomElement element; QDomElement element;
if (doc->GetActivNodeElement(VPattern::TagDetails, element)) if (doc->GetActivNodeElement(VPattern::TagDetails, element))
@ -55,19 +55,19 @@ void AddDet::undo()
{ {
if (element.removeChild(domElement).isNull()) if (element.removeChild(domElement).isNull())
{ {
qCDebug(vUndo)<<"Can't delete node"; qCDebug(vUndo, "Can't delete node");
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't get node by id = "<<nodeId<<"."; qCDebug(vUndo, "Can't get node by id = %u.", nodeId);
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagDetails<<"."; qCDebug(vUndo, "Can't find tag %s.", VPattern::TagDetails.toUtf8().constData());
return; return;
} }
emit NeedFullParsing(); emit NeedFullParsing();
@ -77,7 +77,7 @@ void AddDet::undo()
// cppcheck-suppress unusedFunction // cppcheck-suppress unusedFunction
void AddDet::redo() void AddDet::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement element; QDomElement element;
if (doc->GetActivNodeElement(VPattern::TagDetails, element)) if (doc->GetActivNodeElement(VPattern::TagDetails, element))
@ -86,7 +86,7 @@ void AddDet::redo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagDetails<<"."; qCDebug(vUndo, "Can't find tag %s.", VPattern::TagDetails.toUtf8().constData());
return; return;
} }
RedoFullParsing(); RedoFullParsing();

View File

@ -44,7 +44,7 @@ AddDetNode::~AddDetNode()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddDetNode::undo() void AddDetNode::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
QDomElement modelingElement; QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -54,19 +54,19 @@ void AddDetNode::undo()
{ {
if (modelingElement.removeChild(domElement).isNull()) if (modelingElement.removeChild(domElement).isNull())
{ {
qCDebug(vUndo)<<"Can't delete node."; qCDebug(vUndo, "Can't delete node.");
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't get node by id = "<<nodeId<<"."; qCDebug(vUndo, "Can't get node by id = %u.", nodeId);
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<"."; qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData());
return; return;
} }
} }
@ -74,7 +74,7 @@ void AddDetNode::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddDetNode::redo() void AddDetNode::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement modelingElement; QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -83,7 +83,7 @@ void AddDetNode::redo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<"."; qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData());
return; return;
} }
} }

View File

@ -46,7 +46,7 @@ AddPatternPiece::~AddPatternPiece()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddPatternPiece::undo() void AddPatternPiece::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
if (doc->CountPP() <= 1) if (doc->CountPP() <= 1)
{ {
@ -64,7 +64,7 @@ void AddPatternPiece::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddPatternPiece::redo() void AddPatternPiece::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
if (doc->CountPP() == 0 && mPath.isEmpty() == false) if (doc->CountPP() == 0 && mPath.isEmpty() == false)
{ {

View File

@ -48,7 +48,7 @@ AddToCalc::~AddToCalc()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddToCalc::undo() void AddToCalc::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change
doc->setCursor(cursor); doc->setCursor(cursor);
@ -61,19 +61,19 @@ void AddToCalc::undo()
{ {
if (calcElement.removeChild(domElement).isNull()) if (calcElement.removeChild(domElement).isNull())
{ {
qCDebug(vUndo)<<"Can't delete node."; qCDebug(vUndo, "Can't delete node.");
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't get tool by id = "<<nodeId<<"."; qCDebug(vUndo, "Can't get tool by id = %u.", nodeId);
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag Calculation."; qCDebug(vUndo, "Can't find tag Calculation.");
return; return;
} }
if (cursor > 0) if (cursor > 0)
@ -88,7 +88,7 @@ void AddToCalc::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddToCalc::redo() void AddToCalc::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change doc->ChangeActivPP(nameActivDraw);//Without this user will not see this change
doc->setCursor(cursor); doc->setCursor(cursor);
@ -110,14 +110,14 @@ void AddToCalc::redo()
} }
else 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; return;
} }
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag Calculation."; qCDebug(vUndo, "Can't find tag Calculation.");
return; return;
} }
RedoFullParsing(); RedoFullParsing();

View File

@ -44,7 +44,7 @@ AddUnionDetails::~AddUnionDetails()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddUnionDetails::undo() void AddUnionDetails::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
QDomElement modelingElement; QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -54,19 +54,19 @@ void AddUnionDetails::undo()
{ {
if (modelingElement.removeChild(domElement).isNull()) if (modelingElement.removeChild(domElement).isNull())
{ {
qCDebug(vUndo)<<"Can't delete node."; qCDebug(vUndo, "Can't delete node.");
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't get node by id = "<<nodeId<<"."; qCDebug(vUndo, "Can't get node by id = %u.", nodeId);
return; return;
} }
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<"."; qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData());
return; return;
} }
emit NeedFullParsing(); emit NeedFullParsing();
@ -75,7 +75,7 @@ void AddUnionDetails::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void AddUnionDetails::redo() void AddUnionDetails::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement modelingElement; QDomElement modelingElement;
if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement))
@ -84,7 +84,7 @@ void AddUnionDetails::redo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagModeling<<"."; qCDebug(vUndo, "Can't find tag %s.", VPattern::TagModeling.toUtf8().constData());
return; return;
} }
RedoFullParsing(); RedoFullParsing();

View File

@ -54,7 +54,7 @@ DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent)
} }
else else
{ {
qCDebug(vUndo)<<"Can't get detail by id ="<<nodeId<<"."; qCDebug(vUndo, "Can't get detail by id = %u.", nodeId);
return; return;
} }
} }
@ -66,7 +66,7 @@ DeleteDetail::~DeleteDetail()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DeleteDetail::undo() void DeleteDetail::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
UndoDeleteAfterSibling(parentNode, siblingId); UndoDeleteAfterSibling(parentNode, siblingId);
emit NeedFullParsing(); emit NeedFullParsing();
@ -75,7 +75,7 @@ void DeleteDetail::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DeleteDetail::redo() void DeleteDetail::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -94,7 +94,7 @@ void DeleteDetail::redo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't get detail by id = "<<nodeId<<"."; qCDebug(vUndo, "Can't get detail by id = %u.", nodeId);
return; return;
} }
} }

View File

@ -51,7 +51,7 @@ DeletePatternPiece::~DeletePatternPiece()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DeletePatternPiece::undo() void DeletePatternPiece::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
QDomElement rootElement = doc->documentElement(); QDomElement rootElement = doc->documentElement();
QDomNode previousPP = doc->GetPPElement(previousPPName); QDomNode previousPP = doc->GetPPElement(previousPPName);
@ -64,7 +64,7 @@ void DeletePatternPiece::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DeletePatternPiece::redo() void DeletePatternPiece::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement rootElement = doc->documentElement(); QDomElement rootElement = doc->documentElement();
QDomElement patternPiece = doc->GetPPElement(namePP); QDomElement patternPiece = doc->GetPPElement(namePP);

View File

@ -50,7 +50,7 @@ DelTool::~DelTool()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DelTool::undo() void DelTool::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
UndoDeleteAfterSibling(parentNode, siblingId); UndoDeleteAfterSibling(parentNode, siblingId);
emit NeedFullParsing(); emit NeedFullParsing();
@ -61,7 +61,7 @@ void DelTool::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DelTool::redo() void DelTool::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
//Keep first! //Keep first!
doc->SetCurrentPP(nameActivDraw);//Without this user will not see this change doc->SetCurrentPP(nameActivDraw);//Without this user will not see this change

View File

@ -50,7 +50,7 @@ MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const qu
} }
else else
{ {
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return; return;
} }
} }
@ -62,7 +62,7 @@ MoveDetail::~MoveDetail()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveDetail::undo() void MoveDetail::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -76,7 +76,7 @@ void MoveDetail::undo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return; return;
} }
} }
@ -84,7 +84,7 @@ void MoveDetail::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveDetail::redo() void MoveDetail::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -102,7 +102,7 @@ void MoveDetail::redo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return; return;
} }
} }

View File

@ -40,10 +40,10 @@ MoveLabel::MoveLabel(VPattern *doc, const double &x, const double &y, const quin
{ {
setText(tr("Move point label")); setText(tr("Move point label"));
nodeId = id; nodeId = id;
qCDebug(vUndo)<<"Point id"<<nodeId; qCDebug(vUndo, "Point id %u", nodeId);
qCDebug(vUndo)<<"Label new Mx"<<newMx; qCDebug(vUndo, "Label new Mx %f", newMx);
qCDebug(vUndo)<<"Label new My"<<newMy; qCDebug(vUndo, "Label new My %f", newMy);
SCASSERT(scene != nullptr); SCASSERT(scene != nullptr);
QDomElement domElement = doc->elementById(id); QDomElement domElement = doc->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")); oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0"));
oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0")); oldMy = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMy, "0.0"));
qCDebug(vUndo)<<"Label old Mx"<<oldMx; qCDebug(vUndo, "Label old Mx %f", oldMx);
qCDebug(vUndo)<<"Label old My"<<oldMy; qCDebug(vUndo, "Label old My %f", oldMy);
} }
else else
{ {
qCDebug(vUndo)<<"Can't find point with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find point with id = %u.", nodeId);
return; return;
} }
} }
@ -69,7 +69,7 @@ MoveLabel::~MoveLabel()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveLabel::undo() void MoveLabel::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
Do(oldMx, oldMy); Do(oldMx, oldMy);
} }
@ -77,7 +77,7 @@ void MoveLabel::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveLabel::redo() void MoveLabel::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
Do(newMx, newMy); Do(newMx, newMy);
} }
@ -94,11 +94,11 @@ bool MoveLabel::mergeWith(const QUndoCommand *command)
return false; return false;
} }
qCDebug(vUndo)<<"Mergin undo."; qCDebug(vUndo, "Mergin undo.");
newMx = moveCommand->getNewMx(); newMx = moveCommand->getNewMx();
newMy = moveCommand->getNewMy(); newMy = moveCommand->getNewMy();
qCDebug(vUndo)<<"Label new Mx"<<newMx; qCDebug(vUndo, "Label new Mx %f", newMx);
qCDebug(vUndo)<<"Label new My"<<newMy; qCDebug(vUndo, "Label new My %f", newMy);
return true; return true;
} }
@ -111,8 +111,8 @@ int MoveLabel::id() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveLabel::Do(double mx, double my) void MoveLabel::Do(double mx, double my)
{ {
qCDebug(vUndo)<<"New mx"<<mx; qCDebug(vUndo, "New mx %f", mx);
qCDebug(vUndo)<<"New my"<<my; qCDebug(vUndo, "New my %f", my);
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -127,7 +127,7 @@ void MoveLabel::Do(double mx, double my)
} }
else else
{ {
qCDebug(vUndo)<<"Can't find point with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find point with id = %u.", nodeId);
return; return;
} }
} }

View File

@ -50,7 +50,7 @@ MoveSpline::~MoveSpline()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveSpline::undo() void MoveSpline::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
Do(oldSpline); Do(oldSpline);
} }
@ -58,7 +58,7 @@ void MoveSpline::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveSpline::redo() void MoveSpline::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
Do(newSpline); Do(newSpline);
} }
@ -104,7 +104,7 @@ void MoveSpline::Do(const VSpline &spl)
} }
else else
{ {
qCDebug(vUndo)<<"Can't find spline with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find spline with id = %u.", nodeId);
return; return;
} }
} }

View File

@ -48,7 +48,7 @@ MoveSplinePath::~MoveSplinePath()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveSplinePath::undo() void MoveSplinePath::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
Do(oldSplinePath); Do(oldSplinePath);
} }
@ -56,7 +56,7 @@ void MoveSplinePath::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveSplinePath::redo() void MoveSplinePath::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
Do(newSplinePath); Do(newSplinePath);
} }
@ -99,7 +99,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath)
} }
else else
{ {
qCDebug(vUndo)<<"Can't find spline path with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find spline path with id = %u.", nodeId);
return; return;
} }
} }

View File

@ -40,10 +40,10 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu
{ {
setText(tr("Move single point")); setText(tr("Move single point"));
nodeId = id; nodeId = id;
qCDebug(vUndo)<<"SPoint id"<<nodeId; qCDebug(vUndo, "SPoint id %u", nodeId);
qCDebug(vUndo)<<"SPoint newX"<<newX; qCDebug(vUndo, "SPoint newX %f", newX);
qCDebug(vUndo)<<"SPoint newY"<<newY; qCDebug(vUndo, "SPoint newY %f", newY);
SCASSERT(scene != nullptr); SCASSERT(scene != nullptr);
QDomElement domElement = doc->elementById(id); QDomElement domElement = doc->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")); oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0"));
oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrY, "0.0")); oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrY, "0.0"));
qCDebug(vUndo)<<"SPoint oldX"<<oldX; qCDebug(vUndo, "SPoint oldX %f", oldX);
qCDebug(vUndo)<<"SPoint oldY"<<oldY; qCDebug(vUndo, "SPoint oldY %f", oldY);
} }
else else
{ {
qCDebug(vUndo)<<"Can't find spoint with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find spoint with id = %u.", nodeId);
return; return;
} }
} }
@ -69,7 +69,7 @@ MoveSPoint::~MoveSPoint()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveSPoint::undo() void MoveSPoint::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
Do(oldX, oldY); Do(oldX, oldY);
} }
@ -77,7 +77,7 @@ void MoveSPoint::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveSPoint::redo() void MoveSPoint::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
Do(newX, newY); Do(newX, newY);
} }
@ -89,18 +89,18 @@ bool MoveSPoint::mergeWith(const QUndoCommand *command)
SCASSERT(moveCommand != nullptr); SCASSERT(moveCommand != nullptr);
const quint32 id = moveCommand->getSPointId(); const quint32 id = moveCommand->getSPointId();
qCDebug(vUndo)<<"Mergin."; qCDebug(vUndo, "Mergin.");
if (id != nodeId) if (id != nodeId)
{ {
qCDebug(vUndo)<<"Merging canceled."; qCDebug(vUndo, "Merging canceled.");
return false; return false;
} }
qCDebug(vUndo)<<"Mergin undo."; qCDebug(vUndo, "Mergin undo.");
newX = moveCommand->getNewX(); newX = moveCommand->getNewX();
newY = moveCommand->getNewY(); newY = moveCommand->getNewY();
qCDebug(vUndo)<<"SPoint newX"<<newX; qCDebug(vUndo, "SPoint newX %f", newX);
qCDebug(vUndo)<<"SPoint newY"<<newY; qCDebug(vUndo, "SPoint newY %f", newY);
return true; return true;
} }
@ -113,8 +113,8 @@ int MoveSPoint::id() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MoveSPoint::Do(double x, double y) void MoveSPoint::Do(double x, double y)
{ {
qCDebug(vUndo)<<"Move to x"<<x; qCDebug(vUndo, "Move to x %f", x);
qCDebug(vUndo)<<"Move to y"<<y; qCDebug(vUndo, "Move to y %f", y);
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -129,7 +129,7 @@ void MoveSPoint::Do(double x, double y)
} }
else else
{ {
qCDebug(vUndo)<<"Can't find spoint with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find spoint with id = %u.", nodeId);
return; return;
} }
} }

View File

@ -48,7 +48,7 @@ RenamePP::~RenamePP()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void RenamePP::undo() void RenamePP::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
ChangeName(newPPname, oldPPname); ChangeName(newPPname, oldPPname);
} }
@ -56,7 +56,7 @@ void RenamePP::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void RenamePP::redo() void RenamePP::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
ChangeName(oldPPname, newPPname); ChangeName(oldPPname, newPPname);
} }
@ -92,6 +92,6 @@ void RenamePP::ChangeName(const QString &oldName, const QString &newName)
} }
else else
{ {
qCWarning(vUndo)<<"Can't change pattern piece name"; qCWarning(vUndo, "Can't change pattern piece name");
} }
} }

View File

@ -46,7 +46,7 @@ SaveDetailOptions::~SaveDetailOptions()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void SaveDetailOptions::undo() void SaveDetailOptions::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -75,7 +75,7 @@ void SaveDetailOptions::undo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return; return;
} }
} }
@ -83,7 +83,7 @@ void SaveDetailOptions::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void SaveDetailOptions::redo() void SaveDetailOptions::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -112,7 +112,7 @@ void SaveDetailOptions::redo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return; return;
} }
} }

View File

@ -46,7 +46,7 @@ SaveToolOptions::~SaveToolOptions()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void SaveToolOptions::undo() void SaveToolOptions::undo()
{ {
qCDebug(vUndo)<<"Undo."; qCDebug(vUndo, "Undo.");
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -57,7 +57,7 @@ void SaveToolOptions::undo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tool with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find tool with id = %u.", nodeId);
return; return;
} }
} }
@ -65,7 +65,7 @@ void SaveToolOptions::undo()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void SaveToolOptions::redo() void SaveToolOptions::redo()
{ {
qCDebug(vUndo)<<"Redo."; qCDebug(vUndo, "Redo.");
QDomElement domElement = doc->elementById(nodeId); QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement()) if (domElement.isElement())
@ -76,7 +76,7 @@ void SaveToolOptions::redo()
} }
else else
{ {
qCDebug(vUndo)<<"Can't find tool with id ="<<nodeId<<"."; qCDebug(vUndo, "Can't find tool with id = %u.", nodeId);
return; return;
} }
} }

View File

@ -300,17 +300,17 @@ bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName)
*/ */
void VPattern::Parse(const Document &parse) void VPattern::Parse(const Document &parse)
{ {
qCDebug(vXML)<<"Parsing pattern."; qCDebug(vXML, "Parsing pattern.");
switch (parse) switch (parse)
{ {
case Document::FullParse: case Document::FullParse:
qCDebug(vXML)<<"Full parse."; qCDebug(vXML, "Full parse.");
break; break;
case Document::LiteParse: case Document::LiteParse:
qCDebug(vXML)<<"Lite parse."; qCDebug(vXML, "Lite parse.");
break; break;
case Document::LitePPParse: case Document::LitePPParse:
qCDebug(vXML)<<"Lite pattern piece parse."; qCDebug(vXML, "Lite pattern piece parse.");
break; break;
default: default:
break; break;
@ -332,7 +332,7 @@ void VPattern::Parse(const Document &parse)
switch (tags.indexOf(domElement.tagName())) switch (tags.indexOf(domElement.tagName()))
{ {
case 0: // TagDraw case 0: // TagDraw
qCDebug(vXML)<<"Tag draw."; qCDebug(vXML, "Tag draw.");
if (parse == Document::FullParse) if (parse == Document::FullParse)
{ {
if (nameActivPP.isEmpty()) if (nameActivPP.isEmpty())
@ -352,29 +352,29 @@ void VPattern::Parse(const Document &parse)
ParseDrawElement(domElement, parse); ParseDrawElement(domElement, parse);
break; break;
case 1: // TagIncrements case 1: // TagIncrements
qCDebug(vXML)<<"Tag increments."; qCDebug(vXML, "Tag increments.");
ParseIncrementsElement(domElement); ParseIncrementsElement(domElement);
break; break;
case 2: // TagAuthor case 2: // TagAuthor
qCDebug(vXML)<<"Tag author."; qCDebug(vXML, "Tag author.");
break; break;
case 3: // TagDescription case 3: // TagDescription
qCDebug(vXML)<<"Tag description."; qCDebug(vXML, "Tag description.");
break; break;
case 4: // TagNotes case 4: // TagNotes
qCDebug(vXML)<<"Tag notes."; qCDebug(vXML, "Tag notes.");
break; break;
case 5: // TagMeasurements case 5: // TagMeasurements
qCDebug(vXML)<<"Tag measurements."; qCDebug(vXML, "Tag measurements.");
break; break;
case 6: // TagVersion case 6: // TagVersion
qCDebug(vXML)<<"Tag version."; qCDebug(vXML, "Tag version.");
break; break;
case 7: // TagGradation case 7: // TagGradation
qCDebug(vXML)<<"Tag gradation."; qCDebug(vXML, "Tag gradation.");
break; break;
default: default:
qCDebug(vXML)<<"Wrong tag name"<<domElement.tagName(); qCDebug(vXML, "Wrong tag name %s", domElement.tagName().toUtf8().constData());
break; break;
} }
} }
@ -433,14 +433,14 @@ void VPattern::setCurrentData()
{ {
if (CountPP() > 1)//don't need upadate data if we have only one pattern piece if (CountPP() > 1)//don't need upadate data if we have only one pattern piece
{ {
qCDebug(vXML)<<"Setting current data"; qCDebug(vXML, "Setting current data");
qCDebug(vXML)<<"Current PP name"<<nameActivPP; qCDebug(vXML, "Current PP name %s", nameActivPP.toUtf8().constData());
qCDebug(vXML)<<"PP count"<<CountPP(); qCDebug(vXML, "PP count %d", CountPP());
quint32 id = 0; quint32 id = 0;
if (history.size() == 0) if (history.size() == 0)
{ {
qCDebug(vXML)<<"History is empty!"; qCDebug(vXML, "History is empty!");
return; return;
} }
for (qint32 i = 0; i < history.size(); ++i) for (qint32 i = 0; i < history.size(); ++i)
@ -451,17 +451,18 @@ void VPattern::setCurrentData()
id = tool.getId(); id = tool.getId();
} }
} }
qCDebug(vXML)<<"Resoring data from tool with id"<<id; qCDebug(vXML, "Resoring data from tool with id %u", id);
if (id == NULL_ID) if (id == NULL_ID)
{ {
qCDebug(vXML)<<"Could not find record for this current pattern piece"<<nameActivPP; qCDebug(vXML, "Could not find record for this current pattern piece %s",
nameActivPP.toUtf8().constData());
const VToolRecord tool = history.at(history.size()-1); const VToolRecord tool = history.at(history.size()-1);
id = tool.getId(); id = tool.getId();
qCDebug(vXML)<<"Taking record with id"<<id<<"from PP"<<tool.getNameDraw(); qCDebug(vXML, "Taking record with id %u from PP %s", id, tool.getNameDraw().toUtf8().constData());
if (id == NULL_ID) if (id == NULL_ID)
{ {
qCDebug(vXML)<<"Bad id for last record in history."; qCDebug(vXML, "Bad id for last record in history.");
return; return;
} }
} }
@ -474,17 +475,17 @@ void VPattern::setCurrentData()
catch (VExceptionBadId &e) catch (VExceptionBadId &e)
{ {
Q_UNUSED(e) Q_UNUSED(e)
qCDebug(vXML)<<"List of tools doesn't containe id="<<id; qCDebug(vXML, "List of tools doesn't containe id= %u", id);
return; return;
} }
const VDataTool *vTool = tools.value(id); const VDataTool *vTool = tools.value(id);
*data = vTool->getData(); *data = vTool->getData();
qCDebug(vXML)<<"Data successfully updated."; qCDebug(vXML, "Data successfully updated.");
} }
else 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); Parse(parse);
break; break;
case Document::FullParse: case Document::FullParse:
qCWarning(vXML)<<"Lite parsing doesn't support full parsing"; qCWarning(vXML, "Lite parsing doesn't support full parsing");
break; break;
default: default:
break; break;
@ -836,13 +837,13 @@ void VPattern::LiteParseTree(const Document &parse)
// Restore name current pattern piece // Restore name current pattern piece
nameActivPP = namePP; nameActivPP = namePP;
qCDebug(vXML)<<"Current pattern piece"<<nameActivPP; qCDebug(vXML, "Current pattern piece %s", nameActivPP.toUtf8().constData());
setCurrentData(); setCurrentData();
emit FullUpdateFromFile(); emit FullUpdateFromFile();
// Recalculate scene rect // Recalculate scene rect
VAbstractTool::NewSceneRect(sceneDraw, qApp->getSceneView()); VAbstractTool::NewSceneRect(sceneDraw, qApp->getSceneView());
VAbstractTool::NewSceneRect(sceneDetail, qApp->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())) switch (tags.indexOf(domElement.tagName()))
{ {
case 0: // TagCalculation case 0: // TagCalculation
qCDebug(vXML)<<"Tag calculation."; qCDebug(vXML, "Tag calculation.");
data->ClearCalculationGObjects(); data->ClearCalculationGObjects();
ParseDrawMode(domElement, parse, Draw::Calculation); ParseDrawMode(domElement, parse, Draw::Calculation);
break; break;
case 1: // TagModeling case 1: // TagModeling
qCDebug(vXML)<<"Tag modeling."; qCDebug(vXML, "Tag modeling.");
ParseDrawMode(domElement, parse, Draw::Modeling); ParseDrawMode(domElement, parse, Draw::Modeling);
break; break;
case 2: // TagDetails case 2: // TagDetails
qCDebug(vXML)<<"Tag details."; qCDebug(vXML, "Tag details.");
ParseDetails(domElement, parse); ParseDetails(domElement, parse);
break; break;
default: default:
qCDebug(vXML)<<"Wrong tag name"; qCDebug(vXML, "Wrong tag name");
break; break;
} }
} }
@ -959,27 +960,27 @@ void VPattern::ParseDrawMode(const QDomNode &node, const Document &parse, const
switch (tags.indexOf(domElement.tagName())) switch (tags.indexOf(domElement.tagName()))
{ {
case 0: // TagPoint case 0: // TagPoint
qCDebug(vXML)<<"Tag point."; qCDebug(vXML, "Tag point.");
ParsePointElement(scene, domElement, parse, domElement.attribute(AttrType, "")); ParsePointElement(scene, domElement, parse, domElement.attribute(AttrType, ""));
break; break;
case 1: // TagLine case 1: // TagLine
qCDebug(vXML)<<"Tag line."; qCDebug(vXML, "Tag line.");
ParseLineElement(scene, domElement, parse); ParseLineElement(scene, domElement, parse);
break; break;
case 2: // TagSpline case 2: // TagSpline
qCDebug(vXML)<<"Tag spline."; qCDebug(vXML, "Tag spline.");
ParseSplineElement(scene, domElement, parse, domElement.attribute(AttrType, "")); ParseSplineElement(scene, domElement, parse, domElement.attribute(AttrType, ""));
break; break;
case 3: // TagArc case 3: // TagArc
qCDebug(vXML)<<"Tag arc."; qCDebug(vXML, "Tag arc.");
ParseArcElement(scene, domElement, parse, domElement.attribute(AttrType, "")); ParseArcElement(scene, domElement, parse, domElement.attribute(AttrType, ""));
break; break;
case 4: // TagTools case 4: // TagTools
qCDebug(vXML)<<"Tag tools."; qCDebug(vXML, "Tag tools.");
ParseToolsElement(scene, domElement, parse, domElement.attribute(AttrType, "")); ParseToolsElement(scene, domElement, parse, domElement.attribute(AttrType, ""));
break; break;
default: default:
qCDebug(vXML)<<"Wrong tag name"; qCDebug(vXML, "Wrong tag name");
break; break;
} }
} }
@ -1856,7 +1857,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &
switch (splines.indexOf(type)) switch (splines.indexOf(type))
{ {
case 0: //VToolSpline::ToolType case 0: //VToolSpline::ToolType
qCDebug(vXML)<<"VToolSpline."; qCDebug(vXML, "VToolSpline.");
try try
{ {
ToolsCommonAttributes(domElement, id); ToolsCommonAttributes(domElement, id);
@ -1881,7 +1882,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &
} }
break; break;
case 1: //VToolSplinePath::ToolType case 1: //VToolSplinePath::ToolType
qCDebug(vXML)<<"VToolSplinePath."; qCDebug(vXML, "VToolSplinePath.");
try try
{ {
ToolsCommonAttributes(domElement, id); ToolsCommonAttributes(domElement, id);
@ -1928,7 +1929,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &
} }
break; break;
case 2: //VNodeSpline::ToolType case 2: //VNodeSpline::ToolType
qCDebug(vXML)<<"VNodeSpline."; qCDebug(vXML, "VNodeSpline.");
try try
{ {
SplinesCommonAttributes(domElement, id, idObject, idTool); SplinesCommonAttributes(domElement, id, idObject, idTool);
@ -1946,7 +1947,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &
} }
break; break;
case 3: //VNodeSplinePath::ToolType case 3: //VNodeSplinePath::ToolType
qCDebug(vXML)<<"VNodeSplinePath."; qCDebug(vXML, "VNodeSplinePath.");
try try
{ {
SplinesCommonAttributes(domElement, id, idObject, idTool); SplinesCommonAttributes(domElement, id, idObject, idTool);
@ -1964,7 +1965,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &
} }
break; break;
default: default:
qCDebug(vXML) << "Illegal spline type in VDomDocument::ParseSplineElement()."; qCDebug(vXML, "Illegal spline type in VDomDocument::ParseSplineElement().");
break; break;
} }
} }
@ -2487,7 +2488,7 @@ QString VPattern::GenerateLabel(const LabelType &type) const
} }
++i; ++i;
} }
qCDebug(vXML)<<"Point label:"<<name; qCDebug(vXML, "Point label: %s", name.toUtf8().constData());
return name; return name;
} }
else if (type == LabelType::NewLabel) else if (type == LabelType::NewLabel)
@ -2495,7 +2496,7 @@ QString VPattern::GenerateLabel(const LabelType &type) const
if (drawList.isEmpty()) if (drawList.isEmpty())
{ {
const QString label = GetLabelBase(0); const QString label = GetLabelBase(0);
qCDebug(vXML)<<"Point label:"<<label; qCDebug(vXML, "Point label: %s", label.toUtf8().constData());
return label; return label;
} }
@ -2523,10 +2524,10 @@ QString VPattern::GenerateLabel(const LabelType &type) const
break; break;
} }
} while (data->IsUnique(name) == false); } while (data->IsUnique(name) == false);
qCDebug(vXML)<<"Point label:"<<name; qCDebug(vXML, "Point label: %s", name.toUtf8().constData());
return name; return name;
} }
qCDebug(vXML)<<"Got unknow type"<<static_cast<char>(type); qCDebug(vXML, "Got unknow type %d", static_cast<int>(type));
return QString(); return QString();
} }

View File

@ -103,7 +103,8 @@ void VException::CriticalMessageBox(const QString &situation, QWidget * parent)
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
#endif #endif
qCDebug(vExcep)<<"Critical error!"<<situation<<ErrorMessage()<<DetailedInformation(); qCDebug(vExcep, "Critical error! %s %s %s", situation.toUtf8().constData(), ErrorMessage().toUtf8().constData(),
DetailedInformation().toUtf8().constData());
msgBox.exec(); msgBox.exec();
} }

View File

@ -425,7 +425,7 @@ void VDomDocument::CollectId(const QDomElement &node, QVector<quint32> &vector)
*/ */
void VDomDocument::ValidateXML(const QString &schema, const QString &fileName) void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
{ {
qCDebug(vXML)<<"Validation xml file"<<fileName<<"."; qCDebug(vXML, "Validation xml file %s.", fileName.toUtf8().constData());
QFile pattern(fileName); QFile pattern(fileName);
if (pattern.open(QIODevice::ReadOnly) == false) if (pattern.open(QIODevice::ReadOnly) == false)
{ {
@ -451,7 +451,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
const QString errorMsg(tr("Could not load schema file.").arg(fileSchema.fileName())); const QString errorMsg(tr("Could not load schema file.").arg(fileSchema.fileName()));
throw VException(errorMsg); throw VException(errorMsg);
} }
qCDebug(vXML)<<"Schema loaded."; qCDebug(vXML, "Schema loaded.");
bool errorOccurred = false; bool errorOccurred = false;
if (sch.isValid() == false) if (sch.isValid() == false)