Cppcheck warnings.
--HG-- branch : develop
This commit is contained in:
parent
31fa9785b9
commit
9035382238
|
@ -593,9 +593,7 @@ QStringList VApplication::LabelLanguages()
|
||||||
void VApplication::StartLogging()
|
void VApplication::StartLogging()
|
||||||
{
|
{
|
||||||
CreateLogDir();
|
CreateLogDir();
|
||||||
// cppcheck-suppress leakReturnValNotUsed
|
|
||||||
BeginLogging();
|
BeginLogging();
|
||||||
// cppcheck-suppress leakReturnValNotUsed
|
|
||||||
ClearOldLogs();
|
ClearOldLogs();
|
||||||
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
||||||
ClearOldReports();
|
ClearOldReports();
|
||||||
|
@ -853,7 +851,6 @@ void VApplication::CollectReport(const QString &reportName) const
|
||||||
reportFile.remove(); // Clear after yourself
|
reportFile.remove(); // Clear after yourself
|
||||||
|
|
||||||
filename = QString("%1/reports/log-%2.log").arg(qApp->applicationDirPath()).arg(timestamp);
|
filename = QString("%1/reports/log-%2.log").arg(qApp->applicationDirPath()).arg(timestamp);
|
||||||
// cppcheck-suppress leakReturnValNotUsed
|
|
||||||
GatherLogs();
|
GatherLogs();
|
||||||
QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
|
QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
|
||||||
logFile.copy(filename); // Collect log
|
logFile.copy(filename); // Collect log
|
||||||
|
@ -917,7 +914,6 @@ void VApplication::SendReport(const QString &reportName) const
|
||||||
content.append(QString("\r\n-------------------------------\r\n"));
|
content.append(QString("\r\n-------------------------------\r\n"));
|
||||||
content.append(QString("Log:")+"\r\n");
|
content.append(QString("Log:")+"\r\n");
|
||||||
|
|
||||||
// cppcheck-suppress leakReturnValNotUsed
|
|
||||||
GatherLogs();
|
GatherLogs();
|
||||||
QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
|
QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
|
||||||
if (logFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
if (logFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||||
|
|
|
@ -464,6 +464,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
|
||||||
{
|
{
|
||||||
qCDebug(vXML, "Validation xml file %s.", qUtf8Printable(fileName));
|
qCDebug(vXML, "Validation xml file %s.", qUtf8Printable(fileName));
|
||||||
QFile pattern(fileName);
|
QFile pattern(fileName);
|
||||||
|
// cppcheck-suppress ConfigurationNotChecked
|
||||||
if (pattern.open(QIODevice::ReadOnly) == false)
|
if (pattern.open(QIODevice::ReadOnly) == false)
|
||||||
{
|
{
|
||||||
const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(pattern.errorString()));
|
const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(pattern.errorString()));
|
||||||
|
@ -471,6 +472,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile fileSchema(schema);
|
QFile fileSchema(schema);
|
||||||
|
// cppcheck-suppress ConfigurationNotChecked
|
||||||
if (fileSchema.open(QIODevice::ReadOnly) == false)
|
if (fileSchema.open(QIODevice::ReadOnly) == false)
|
||||||
{
|
{
|
||||||
pattern.close();
|
pattern.close();
|
||||||
|
@ -521,6 +523,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
|
||||||
void VDomDocument::setXMLContent(const QString &fileName)
|
void VDomDocument::setXMLContent(const QString &fileName)
|
||||||
{
|
{
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
|
// cppcheck-suppress ConfigurationNotChecked
|
||||||
if (file.open(QIODevice::ReadOnly) == false)
|
if (file.open(QIODevice::ReadOnly) == false)
|
||||||
{
|
{
|
||||||
const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
const QString errorMsg(tr("Can't open file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||||
|
@ -659,6 +662,7 @@ bool VDomDocument::SaveDocument(const QString &fileName, QString &error) const
|
||||||
}
|
}
|
||||||
bool success = false;
|
bool success = false;
|
||||||
QSaveFile file(fileName);
|
QSaveFile file(fileName);
|
||||||
|
// cppcheck-suppress ConfigurationNotChecked
|
||||||
if (file.open(QIODevice::WriteOnly))
|
if (file.open(QIODevice::WriteOnly))
|
||||||
{
|
{
|
||||||
const int indent = 4;
|
const int indent = 4;
|
||||||
|
@ -792,6 +796,7 @@ bool VDomDocument::SafeCopy(const QString &source, const QString &destination, Q
|
||||||
|
|
||||||
QTemporaryFile destFile(destination + QLatin1String(".XXXXXX"));
|
QTemporaryFile destFile(destination + QLatin1String(".XXXXXX"));
|
||||||
destFile.setAutoRemove(false);
|
destFile.setAutoRemove(false);
|
||||||
|
// cppcheck-suppress ConfigurationNotChecked
|
||||||
if (not destFile.open())
|
if (not destFile.open())
|
||||||
{
|
{
|
||||||
error = destFile.errorString();
|
error = destFile.errorString();
|
||||||
|
@ -800,6 +805,7 @@ bool VDomDocument::SafeCopy(const QString &source, const QString &destination, Q
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QFile sourceFile(source);
|
QFile sourceFile(source);
|
||||||
|
// cppcheck-suppress ConfigurationNotChecked
|
||||||
if (sourceFile.open(QIODevice::ReadOnly))
|
if (sourceFile.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
result = true;
|
result = true;
|
||||||
|
|
|
@ -195,7 +195,6 @@ void QxtCsvModel::setSource(const QString &filename, bool withHeader, QChar sepa
|
||||||
void QxtCsvModel::setSource(QIODevice *file, bool withHeader, QChar separator, QTextCodec* codec)
|
void QxtCsvModel::setSource(QIODevice *file, bool withHeader, QChar separator, QTextCodec* codec)
|
||||||
{
|
{
|
||||||
QxtCsvModelPrivate* d_ptr = &qxt_d();
|
QxtCsvModelPrivate* d_ptr = &qxt_d();
|
||||||
// cppcheck-suppress unreadVariable
|
|
||||||
bool headerSet = !withHeader;
|
bool headerSet = !withHeader;
|
||||||
if (not file->isOpen())
|
if (not file->isOpen())
|
||||||
{
|
{
|
||||||
|
|
|
@ -645,7 +645,6 @@ bool VToolSplinePath::IsMovable(int index) const
|
||||||
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
|
const auto splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
|
||||||
|
|
||||||
//index == -1 - can delete, but decided to left
|
//index == -1 - can delete, but decided to left
|
||||||
// cppcheck-suppress redundantCondition
|
|
||||||
if (index == -1 || index < 1 || index > splPath->CountSubSpl())
|
if (index == -1 || index < 1 || index > splPath->CountSubSpl())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user