SonarQube warnings.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2017-04-14 17:43:26 +03:00
parent 495397621d
commit a78b758226
8 changed files with 20 additions and 15 deletions

View File

@ -470,8 +470,8 @@ bool MApplication::event(QEvent *e)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MApplication::OpenSettings() void MApplication::OpenSettings()
{ {
settings = new VTapeSettings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(), settings = new VTapeSettings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(),
QApplication::applicationName(), this); QCoreApplication::applicationName(), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -459,7 +459,8 @@ QString VApplication::LogDirPath() const
QStandardPaths::LocateDirectory) + "Valentina"; QStandardPaths::LocateDirectory) + "Valentina";
#else #else
const QString logDirPath = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString(), const QString logDirPath = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString(),
QStandardPaths::LocateDirectory) + organizationName(); QStandardPaths::LocateDirectory)
+ QCoreApplication::organizationName();
#endif #endif
return logDirPath; return logDirPath;
} }
@ -674,8 +675,8 @@ bool VApplication::event(QEvent *e)
*/ */
void VApplication::OpenSettings() void VApplication::OpenSettings()
{ {
settings = new VSettings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(), settings = new VSettings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(),
QApplication::applicationName(), this); QCoreApplication::applicationName(), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -37,7 +37,6 @@
#include "vcmdexport.h" #include "vcmdexport.h"
class VApplication;// use in define class VApplication;// use in define
class VPattern;
#if defined(qApp) #if defined(qApp)
#undef qApp #undef qApp

View File

@ -53,7 +53,7 @@ VCommandLine::VCommandLine() : parser(), optionsUsed(), optionsIndex(), isGuiEna
VCommandLineOptions::const_iterator i = optionsUsed.constBegin(); VCommandLineOptions::const_iterator i = optionsUsed.constBegin();
while (i != optionsUsed.constEnd()) while (i != optionsUsed.constEnd())
{ {
parser.addOption(*((*i))); parser.addOption(*(*i));
++i; ++i;
} }
} }

View File

@ -159,7 +159,7 @@ void PreferencesConfigurationPage::Apply()
m_unitChanged = false; m_unitChanged = false;
const QString text = tr("The Default unit has been updated and will be used as the default for the next " const QString text = tr("The Default unit has been updated and will be used as the default for the next "
"pattern you create."); "pattern you create.");
QMessageBox::information(this, QApplication::applicationName(), text); QMessageBox::information(this, QCoreApplication::applicationName(), text);
} }
if (m_labelLangChanged) if (m_labelLangChanged)
{ {

View File

@ -57,7 +57,12 @@ PreferencesPathPage::~PreferencesPathPage()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void PreferencesPathPage::Apply() void PreferencesPathPage::Apply()
{ {
VSettings *settings = qApp->ValentinaSettings();
settings->SetPathIndividualMeasurements(ui->pathTable->item(0, 1)->text());
settings->SetPathStandardMeasurements(ui->pathTable->item(1, 1)->text());
settings->SetPathPattern(ui->pathTable->item(2, 1)->text());
settings->SetPathLayout(ui->pathTable->item(3, 1)->text());
settings->SetPathTemplate(ui->pathTable->item(4, 1)->text());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -49,7 +49,7 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
pSet->ClearUserDefinedMaterial(); pSet->ClearUserDefinedMaterial();
pSet->sync(); pSet->sync();
QString qsMsg = tr("All user defined materials have been deleted!"); QString qsMsg = tr("All user defined materials have been deleted!");
QMessageBox::information(this, QApplication::applicationName(), qsMsg); QMessageBox::information(this, QCoreApplication::applicationName(), qsMsg);
}); });
ui->forbidFlippingCheck->setChecked(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping()); ui->forbidFlippingCheck->setChecked(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping());

View File

@ -228,25 +228,25 @@ bool FvUpdater::CheckForUpdates(bool silentAsMuchAsItCouldGet)
// Check if application's organization name and domain are set, fail otherwise // Check if application's organization name and domain are set, fail otherwise
// (nowhere to store QSettings to) // (nowhere to store QSettings to)
if (QApplication::organizationName().isEmpty()) if (QCoreApplication::organizationName().isEmpty())
{ {
qCritical() << "QApplication::organizationName is not set. Please do that."; qCritical() << "QApplication::organizationName is not set. Please do that.";
return false; return false;
} }
if (QApplication::organizationDomain().isEmpty()) if (QCoreApplication::organizationDomain().isEmpty())
{ {
qCritical() << "QApplication::organizationDomain is not set. Please do that."; qCritical() << "QApplication::organizationDomain is not set. Please do that.";
return false; return false;
} }
// Set application name / version is not set yet // Set application name / version is not set yet
if (QApplication::applicationName().isEmpty()) if (QCoreApplication::applicationName().isEmpty())
{ {
qCritical() << "QApplication::applicationName is not set. Please do that."; qCritical() << "QApplication::applicationName is not set. Please do that.";
return false; return false;
} }
if (QApplication::applicationVersion().isEmpty()) if (QCoreApplication::applicationVersion().isEmpty())
{ {
qCritical() << "QApplication::applicationVersion is not set. Please do that."; qCritical() << "QApplication::applicationVersion is not set. Please do that.";
return false; return false;
@ -299,7 +299,7 @@ void FvUpdater::startDownloadFeed(const QUrl &url)
QNetworkRequest request; QNetworkRequest request;
request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/xml")); request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/xml"));
request.setHeader(QNetworkRequest::UserAgentHeader, QApplication::applicationName()); request.setHeader(QNetworkRequest::UserAgentHeader, QCoreApplication::applicationName());
request.setUrl(url); request.setUrl(url);
request.setSslConfiguration(QSslConfiguration::defaultConfiguration()); request.setSslConfiguration(QSslConfiguration::defaultConfiguration());