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 \
-Wswitch-default \
-Wuninitialized \
-Wno-variadic-macros \
-Wvariadic-macros \
-Wlogical-op \
-Wnoexcept \
-Wmissing-noreturn \

View File

@ -211,7 +211,7 @@ void VContainer::UpdateObject(QHash<quint32, val> &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();

View File

@ -21,10 +21,15 @@
#include "qcommandlineoption.h"
#include "qset.h"
#include <QSet>
#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

View File

@ -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 ="<<qApp->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 ="<<run;
qCDebug(vApp, "New process with arguments. program = %s", run.toUtf8().constData());
if (QProcess::startDetached(run))
{
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.");
}
}
}
@ -469,19 +469,20 @@ void VApplication::BeginLogging()
logLock->setStaleLockTime(0);
if (TryLock(logLock))
{
qCDebug(vApp) << "Log file"<<LogPath()<<"was locked.";
qCDebug(vApp, "Log file %s was locked.", LogPath().toUtf8().constData());
}
else
{
qCDebug(vApp) << "Failed to lock" << LogPath();
qCDebug(vApp) << "Error type:"<<logLock->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"<<info.absoluteFilePath();
qCDebug(vApp, "Locked file %s", info.absoluteFilePath().toUtf8().constData());
QFile oldLog(allFiles.at(i));
if (oldLog.remove())
{
qCDebug(vApp) << "Deleted"<<info.absoluteFilePath();
qCDebug(vApp, "Deleted %s", info.absoluteFilePath().toUtf8().constData());
}
else
{
qCDebug(vApp) << "Could not delete"<<info.absoluteFilePath();
qCDebug(vApp, "Could not delete %s", info.absoluteFilePath().toUtf8().constData());
}
}
else
{
qCDebug(vApp) << "Failed to lock"<<info.absoluteFilePath();
qCDebug(vApp, "Failed to lock %s", info.absoluteFilePath().toUtf8().constData());
}
delete lock;
lock = nullptr;
@ -524,7 +525,7 @@ void VApplication::ClearOldLogs() const
}
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));
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"<<itemName->text();
qCDebug(vDialog, "Remove increment %s", itemName->text().toUtf8().constData());
data->RemoveIncrement(itemName->text());
quint32 id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
@ -750,7 +750,7 @@ void DialogIncrements::clickedToolButtonRemove()
}
else
{
qCDebug(vDialog)<<"Could not find object with id"<<id;
qCDebug(vDialog, "Could not find object with id %u", id);
return;
}
@ -778,9 +778,9 @@ void DialogIncrements::clickedToolButtonRemove()
void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize,
const qreal &kheight, const QString &description)
{
qCDebug(vDialog)<<"Saving new increment to file.";
qCDebug(vDialog)<<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);
qCDebug(vDialog, "Saving new increment to file.");
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).toUtf8().constData());
QDomElement element = doc->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<quint32>(itemName->data(Qt::UserRole));
QDomElement domElement = doc->elementById(id);
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;
}
this->row = row;
switch (column)
{
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());
data->ClearVariables(VarType::Increment);
this->column = 2;
emit FullUpdateTree(Document::LiteParse);
break;
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());
this->column = 3;
emit FullUpdateTree(Document::LiteParse);
break;
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());
this->column = 4;
emit FullUpdateTree(Document::LiteParse);
break;
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());
this->column = 5;
emit FullUpdateTree(Document::LiteParse);
break;
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());
QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(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 "<<tag<<Q_FUNC_INFO;
qCDebug(vDialog, "Can't find measurement %s", tag.toUtf8().constData());
return;
}
@ -897,13 +897,13 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
{
measur->SetBase(0);
item->setText("0");
qCDebug(vDialog)<<"Can't convert toDouble measurement value"<<Q_FUNC_INFO;
qCDebug(vDialog, "Can't convert toDouble measurement value");
}
else
{
measur->SetBase(base);
}
qCDebug(vDialog)<<"Changed value to"<<base;
qCDebug(vDialog, "Changed value to %f", base);
// Convert value to measurements table unit
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);
}
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"<<path;
qCDebug(vStMeasur, "Can't find standard measurements in path %s", path.toUtf8().constData());
ui->comboBoxTables->clear();
CheckState();
return;
}
qCDebug(vStMeasur)<<"Was found"<<allFiles.size()<<"tables.";
qCDebug(vStMeasur, "Was found %d tables.", allFiles.size());
for (int i = 0; i < allFiles.size(); ++i)
{
QFileInfo fi(allFiles.at(i));
@ -179,22 +179,23 @@ void DialogStandardMeasurements::LoadStandardTables()
m.setXMLContent(fi.absoluteFilePath());
if (m.MUnit() == Unit::Inch)
{
qCWarning(vStMeasur)<<"We do not support inches for standard table. Ignore table"
<<fi.absoluteFilePath()<<".";
qCWarning(vStMeasur, "We do not support inches for standard table. Ignore table %s .",
fi.absoluteFilePath().toUtf8().constData());
}
else
{
const QString desc = m.TrDescription();
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()));
}
}
}
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;
}
}

View File

@ -143,30 +143,30 @@ MainWindow::MainWindow(QWidget *parent)
*/
void MainWindow::ActionNewPP()
{
qCDebug(vMainWindow)<<"New PP.";
qCDebug(vMainWindow, "New PP.");
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;
if (comboBoxDraws->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:"<<patternPieceName;
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
path = stMeasurements.tablePath();
qCDebug(vMainWindow)<<"Table path:"<<path;
qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
VStandardMeasurements m(pattern);
m.setXMLContent(path);
m.SetSize();
@ -175,13 +175,13 @@ void MainWindow::ActionNewPP()
}
else
{
qCDebug(vMainWindow)<<"Selection standard measurements canceled.";
qCDebug(vMainWindow, "Selection standard measurements canceled.");
return;
}
}
else
{
qCDebug(vMainWindow)<<"PP with individual measurements.";
qCDebug(vMainWindow, "PP with individual measurements.");
QMessageBox::StandardButton ret;
ret = QMessageBox::question(this, tr("Individual measurements is under development"),
tr("There is no way create individual measurements file independent on the "
@ -198,16 +198,16 @@ void MainWindow::ActionNewPP()
if (indMeasurements.exec() == QDialog::Accepted)
{
patternPieceName = indMeasurements.name();
qCDebug(vMainWindow)<<"PP name:"<<patternPieceName;
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
path = indMeasurements.tablePath();
qCDebug(vMainWindow)<<"Table path:"<<path;
qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
VIndividualMeasurements m(pattern);
m.setXMLContent(path);
m.Measurements();
}
else
{
qCDebug(vMainWindow)<<"Selection individual measurements canceled.";
qCDebug(vMainWindow, "Selection individual measurements canceled.");
return;
}
}
@ -219,19 +219,19 @@ void MainWindow::ActionNewPP()
}
else
{
qCDebug(vMainWindow)<<"PP count"<<comboBoxDraws->count();
qCDebug(vMainWindow, "PP count %d", comboBoxDraws->count());
patternPieceName = PatternPieceName(patternPieceName);
qCDebug(vMainWindow)<<"PP name:"<<patternPieceName;
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
if (patternPieceName.isEmpty())
{
qCDebug(vMainWindow)<<"Name empty.";
qCDebug(vMainWindow, "Name empty.");
return;
}
path = doc->MPath();
}
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;
}
comboBoxDraws->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 ="<<dir<<".";
qCDebug(vMainWindow, "Run QFileDialog::getOpenFileName: dir = %s.", dir.toUtf8().constData());
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter);
if (filePath.isEmpty())
{
@ -1421,14 +1421,14 @@ void MainWindow::Preferences()
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::RepotBug()
{
qCDebug(vMainWindow)<<"Reporting bug";
qCDebug(vMainWindow, "Reporting bug");
QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/issues/new"));
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::OnlineHelp()
{
qCDebug(vMainWindow)<<"Showing online help";
qCDebug(vMainWindow, "Showing online help");
QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/wiki/manual/Content"));
}
@ -1438,21 +1438,21 @@ void MainWindow::OnlineHelp()
*/
void MainWindow::Clear()
{
qCDebug(vMainWindow)<<"Reseting main window.";
qCDebug(vMainWindow, "Reseting main window.");
delete lock; // Unlock pattern file
lock = nullptr;
qCDebug(vMainWindow)<<"Unlocked pattern file.";
qCDebug(vMainWindow, "Unlocked pattern file.");
ui->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"<<curFile<<"closed correct.";
qCDebug(vMainWindow, "File %s closed correct.", curFile.toUtf8().constData());
}
//---------------------------------------------------------------------------------------------------------------------
@ -1521,7 +1521,7 @@ void MainWindow::ResetWindow()
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::FullParseFile()
{
qCDebug(vMainWindow)<<"Full parsing file";
qCDebug(vMainWindow, "Full parsing file");
toolOptions->ClearPropertyBrowser();
try
@ -1997,7 +1997,7 @@ void MainWindow::MinimumScrollBar()
*/
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);
const bool result = doc->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"<<fileName<<"saved.";
qCDebug(vMainWindow, "File %s saved.", fileName.toUtf8().constData());
PatternWasModified(result);
}
}
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;
}
@ -2023,7 +2023,7 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error)
*/
void MainWindow::AutoSavePattern()
{
qCDebug(vMainWindow)<<"Autosaving pattern.";
qCDebug(vMainWindow, "Autosaving pattern.");
if (curFile.isEmpty() == false && this->isWindowModified() == true)
{
@ -2041,7 +2041,7 @@ void MainWindow::AutoSavePattern()
*/
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;
qApp->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<int>(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"<<autoTime<<"minutes.";
qCDebug(vMainWindow, "Autosaving each %d minutes.", autoTime);
}
qApp->setAutoSaveTimer(autoSaveTimer);
}
@ -2449,7 +2449,7 @@ MainWindow::~MainWindow()
*/
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
if (OpenNewValentina(fileName))
@ -2459,25 +2459,25 @@ void MainWindow::LoadPattern(const QString &fileName)
if (fileName.isEmpty())
{
qCDebug(vMainWindow) << "Got empty file.";
qCDebug(vMainWindow, "Got empty file.");
Clear();
return;
}
qCDebug(vMainWindow)<<"Loking file";
qCDebug(vMainWindow, "Loking file");
lock = new QLockFile(fileName+".lock");
lock->setStaleLockTime(0);
if (VApplication::TryLock(lock))
{
qCDebug(vMainWindow) << "Pattern file"<<fileName<<"was locked.";
qCDebug(vMainWindow, "Pattern file %s was locked.", fileName.toUtf8().constData());
}
else
{
qCDebug(vMainWindow) << "Failed to lock" << fileName;
qCDebug(vMainWindow) << "Error type:"<<lock->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 "<<restoreFiles.at(i) +".autosave"<<"to"
<<restoreFiles.at(i)<<error;
qCDebug(vMainWindow, "Could not copy %s.autosave to %s %s",
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()
{
qCDebug(vTool)<<"Saving tool options after using dialog";
qCDebug(vTool, "Saving tool options after using dialog");
QDomElement oldDomElement = doc->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);
}
}

View File

@ -90,7 +90,8 @@ QString VToolPoint::name() const
}
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
}
}

View File

@ -329,7 +329,7 @@ QMap<QString, quint32> VAbstractTool::PointsList() const
//---------------------------------------------------------------------------------------------------------------------
void VAbstractTool::SaveOption(QSharedPointer<VGObject> &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<VGObject> &obj)
}
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
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 = "<<nodeId<<".";
qCDebug(vUndo, "Can't get node by id = %u.", nodeId);
return;
}
}
else
{
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagDetails<<".";
qCDebug(vUndo, "Can't find tag %s.", VPattern::TagDetails.toUtf8().constData());
return;
}
emit NeedFullParsing();
@ -77,7 +77,7 @@ void AddDet::undo()
// cppcheck-suppress unusedFunction
void AddDet::redo()
{
qCDebug(vUndo)<<"Redo.";
qCDebug(vUndo, "Redo.");
QDomElement element;
if (doc->GetActivNodeElement(VPattern::TagDetails, element))
@ -86,7 +86,7 @@ void AddDet::redo()
}
else
{
qCDebug(vUndo)<<"Can't find tag"<<VPattern::TagDetails<<".";
qCDebug(vUndo, "Can't find tag %s.", VPattern::TagDetails.toUtf8().constData());
return;
}
RedoFullParsing();

View File

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

View File

@ -46,7 +46,7 @@ AddPatternPiece::~AddPatternPiece()
//---------------------------------------------------------------------------------------------------------------------
void AddPatternPiece::undo()
{
qCDebug(vUndo)<<"Undo.";
qCDebug(vUndo, "Undo.");
if (doc->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)
{

View File

@ -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 = "<<nodeId<<".";
qCDebug(vUndo, "Can't get tool by id = %u.", nodeId);
return;
}
}
else
{
qCDebug(vUndo)<<"Can't find tag Calculation.";
qCDebug(vUndo, "Can't find tag Calculation.");
return;
}
if (cursor > 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();

View File

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

View File

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

View File

@ -51,7 +51,7 @@ DeletePatternPiece::~DeletePatternPiece()
//---------------------------------------------------------------------------------------------------------------------
void DeletePatternPiece::undo()
{
qCDebug(vUndo)<<"Undo.";
qCDebug(vUndo, "Undo.");
QDomElement rootElement = doc->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);

View File

@ -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

View File

@ -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 ="<<nodeId<<".";
qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return;
}
}
@ -62,7 +62,7 @@ MoveDetail::~MoveDetail()
//---------------------------------------------------------------------------------------------------------------------
void MoveDetail::undo()
{
qCDebug(vUndo)<<"Undo.";
qCDebug(vUndo, "Undo.");
QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement())
@ -76,7 +76,7 @@ void MoveDetail::undo()
}
else
{
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return;
}
}
@ -84,7 +84,7 @@ void MoveDetail::undo()
//---------------------------------------------------------------------------------------------------------------------
void MoveDetail::redo()
{
qCDebug(vUndo)<<"Redo.";
qCDebug(vUndo, "Redo.");
QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement())
@ -102,7 +102,7 @@ void MoveDetail::redo()
}
else
{
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return;
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -48,7 +48,7 @@ RenamePP::~RenamePP()
//---------------------------------------------------------------------------------------------------------------------
void RenamePP::undo()
{
qCDebug(vUndo)<<"Undo.";
qCDebug(vUndo, "Undo.");
ChangeName(newPPname, oldPPname);
}
@ -56,7 +56,7 @@ void RenamePP::undo()
//---------------------------------------------------------------------------------------------------------------------
void RenamePP::redo()
{
qCDebug(vUndo)<<"Redo.";
qCDebug(vUndo, "Redo.");
ChangeName(oldPPname, newPPname);
}
@ -92,6 +92,6 @@ void RenamePP::ChangeName(const QString &oldName, const QString &newName)
}
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()
{
qCDebug(vUndo)<<"Undo.";
qCDebug(vUndo, "Undo.");
QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement())
@ -75,7 +75,7 @@ void SaveDetailOptions::undo()
}
else
{
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return;
}
}
@ -83,7 +83,7 @@ void SaveDetailOptions::undo()
//---------------------------------------------------------------------------------------------------------------------
void SaveDetailOptions::redo()
{
qCDebug(vUndo)<<"Redo.";
qCDebug(vUndo, "Redo.");
QDomElement domElement = doc->elementById(nodeId);
if (domElement.isElement())
@ -112,7 +112,7 @@ void SaveDetailOptions::redo()
}
else
{
qCDebug(vUndo)<<"Can't find detail with id ="<<nodeId<<".";
qCDebug(vUndo, "Can't find detail with id = %u.", nodeId);
return;
}
}

View File

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

View File

@ -300,17 +300,17 @@ bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName)
*/
void VPattern::Parse(const Document &parse)
{
qCDebug(vXML)<<"Parsing pattern.";
qCDebug(vXML, "Parsing pattern.");
switch (parse)
{
case Document::FullParse:
qCDebug(vXML)<<"Full parse.";
qCDebug(vXML, "Full parse.");
break;
case Document::LiteParse:
qCDebug(vXML)<<"Lite parse.";
qCDebug(vXML, "Lite parse.");
break;
case Document::LitePPParse:
qCDebug(vXML)<<"Lite pattern piece parse.";
qCDebug(vXML, "Lite pattern piece parse.");
break;
default:
break;
@ -332,7 +332,7 @@ void VPattern::Parse(const Document &parse)
switch (tags.indexOf(domElement.tagName()))
{
case 0: // TagDraw
qCDebug(vXML)<<"Tag draw.";
qCDebug(vXML, "Tag draw.");
if (parse == Document::FullParse)
{
if (nameActivPP.isEmpty())
@ -352,29 +352,29 @@ void VPattern::Parse(const Document &parse)
ParseDrawElement(domElement, parse);
break;
case 1: // TagIncrements
qCDebug(vXML)<<"Tag increments.";
qCDebug(vXML, "Tag increments.");
ParseIncrementsElement(domElement);
break;
case 2: // TagAuthor
qCDebug(vXML)<<"Tag author.";
qCDebug(vXML, "Tag author.");
break;
case 3: // TagDescription
qCDebug(vXML)<<"Tag description.";
qCDebug(vXML, "Tag description.");
break;
case 4: // TagNotes
qCDebug(vXML)<<"Tag notes.";
qCDebug(vXML, "Tag notes.");
break;
case 5: // TagMeasurements
qCDebug(vXML)<<"Tag measurements.";
qCDebug(vXML, "Tag measurements.");
break;
case 6: // TagVersion
qCDebug(vXML)<<"Tag version.";
qCDebug(vXML, "Tag version.");
break;
case 7: // TagGradation
qCDebug(vXML)<<"Tag gradation.";
qCDebug(vXML, "Tag gradation.");
break;
default:
qCDebug(vXML)<<"Wrong tag name"<<domElement.tagName();
qCDebug(vXML, "Wrong tag name %s", domElement.tagName().toUtf8().constData());
break;
}
}
@ -433,14 +433,14 @@ void VPattern::setCurrentData()
{
if (CountPP() > 1)//don't need upadate data if we have only one pattern piece
{
qCDebug(vXML)<<"Setting current data";
qCDebug(vXML)<<"Current PP name"<<nameActivPP;
qCDebug(vXML)<<"PP count"<<CountPP();
qCDebug(vXML, "Setting current data");
qCDebug(vXML, "Current PP name %s", nameActivPP.toUtf8().constData());
qCDebug(vXML, "PP count %d", CountPP());
quint32 id = 0;
if (history.size() == 0)
{
qCDebug(vXML)<<"History is empty!";
qCDebug(vXML, "History is empty!");
return;
}
for (qint32 i = 0; i < history.size(); ++i)
@ -451,17 +451,18 @@ void VPattern::setCurrentData()
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)
{
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);
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)
{
qCDebug(vXML)<<"Bad id for last record in history.";
qCDebug(vXML, "Bad id for last record in history.");
return;
}
}
@ -474,17 +475,17 @@ void VPattern::setCurrentData()
catch (VExceptionBadId &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;
}
const VDataTool *vTool = tools.value(id);
*data = vTool->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"<<nameActivPP;
qCDebug(vXML, "Current pattern piece %s", nameActivPP.toUtf8().constData());
setCurrentData();
emit FullUpdateFromFile();
// Recalculate scene rect
VAbstractTool::NewSceneRect(sceneDraw, 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()))
{
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:"<<name;
qCDebug(vXML, "Point label: %s", name.toUtf8().constData());
return name;
}
else if (type == LabelType::NewLabel)
@ -2495,7 +2496,7 @@ QString VPattern::GenerateLabel(const LabelType &type) const
if (drawList.isEmpty())
{
const QString label = GetLabelBase(0);
qCDebug(vXML)<<"Point label:"<<label;
qCDebug(vXML, "Point label: %s", label.toUtf8().constData());
return label;
}
@ -2523,10 +2524,10 @@ QString VPattern::GenerateLabel(const LabelType &type) const
break;
}
} while (data->IsUnique(name) == false);
qCDebug(vXML)<<"Point label:"<<name;
qCDebug(vXML, "Point label: %s", name.toUtf8().constData());
return name;
}
qCDebug(vXML)<<"Got unknow type"<<static_cast<char>(type);
qCDebug(vXML, "Got unknow type %d", static_cast<int>(type));
return QString();
}

View File

@ -103,7 +103,8 @@ void VException::CriticalMessageBox(const QString &situation, QWidget * parent)
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#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();
}

View File

@ -425,7 +425,7 @@ void VDomDocument::CollectId(const QDomElement &node, QVector<quint32> &vector)
*/
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);
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()));
throw VException(errorMsg);
}
qCDebug(vXML)<<"Schema loaded.";
qCDebug(vXML, "Schema loaded.");
bool errorOccurred = false;
if (sch.isValid() == false)