Use QLocale::c() instead of QLocale(QLocale::C).
--HG-- branch : develop
This commit is contained in:
parent
f0cac1c191
commit
23d9898154
|
@ -47,7 +47,7 @@ DialogAboutTape::DialogAboutTape(QWidget *parent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
//mApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
//mApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
RetranslateUi();
|
RetranslateUi();
|
||||||
connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]()
|
connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]()
|
||||||
|
@ -126,7 +126,7 @@ void DialogAboutTape::RetranslateUi()
|
||||||
ui->labelBuildRevision->setText(tr("Build revision: %1").arg(BUILD_REVISION));
|
ui->labelBuildRevision->setText(tr("Build revision: %1").arg(BUILD_REVISION));
|
||||||
ui->label_QT_Version->setText(buildCompatibilityString());
|
ui->label_QT_Version->setText(buildCompatibilityString());
|
||||||
|
|
||||||
const QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
|
const QDate date = QLocale::c().toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
|
||||||
ui->label_Tape_Built->setText(tr("Built on %1 at %2").arg(date.toString()).arg(__TIME__));
|
ui->label_Tape_Built->setText(tr("Built on %1 at %2").arg(date.toString()).arg(__TIME__));
|
||||||
|
|
||||||
ui->label_Legal_Stuff->setText(QApplication::translate("InternalStrings",
|
ui->label_Legal_Stuff->setText(QApplication::translate("InternalStrings",
|
||||||
|
|
|
@ -105,7 +105,7 @@ TapeConfigDialog::TapeConfigDialog(QWidget *parent)
|
||||||
|
|
||||||
setWindowTitle(tr("Config Dialog"));
|
setWindowTitle(tr("Config Dialog"));
|
||||||
|
|
||||||
qApp->TapeSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->TapeSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -201,7 +201,7 @@ void TapeConfigDialog::Apply()
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
qApp->TapeSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->TapeSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
emit UpdateProperties();
|
emit UpdateProperties();
|
||||||
setResult(QDialog::Accepted);
|
setResult(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) :
|
||||||
|
|
||||||
setWindowTitle(tr("Config Dialog"));
|
setWindowTitle(tr("Config Dialog"));
|
||||||
|
|
||||||
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -208,7 +208,7 @@ void ConfigDialog::Apply()
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
emit UpdateProperties();
|
emit UpdateProperties();
|
||||||
setResult(QDialog::Accepted);
|
setResult(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,13 +45,13 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) :
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION_STR));
|
ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION_STR));
|
||||||
ui->labelBuildRevision->setText(QString("Build revision: %1").arg(BUILD_REVISION));
|
ui->labelBuildRevision->setText(QString("Build revision: %1").arg(BUILD_REVISION));
|
||||||
ui->label_QT_Version->setText(buildCompatibilityString());
|
ui->label_QT_Version->setText(buildCompatibilityString());
|
||||||
|
|
||||||
QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
|
QDate date = QLocale::c().toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
|
||||||
ui->label_Valentina_Built->setText(tr("Built on %1 at %2").arg(date.toString()).arg(__TIME__));
|
ui->label_Valentina_Built->setText(tr("Built on %1 at %2").arg(date.toString()).arg(__TIME__));
|
||||||
|
|
||||||
ui->label_Legal_Stuff->setText(QApplication::translate("InternalStrings",
|
ui->label_Legal_Stuff->setText(QApplication::translate("InternalStrings",
|
||||||
|
|
|
@ -53,7 +53,7 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||||
connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted);
|
connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted);
|
||||||
|
|
|
@ -75,7 +75,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
formulaBaseHeight = ui->plainTextEditFormula->height();
|
formulaBaseHeight = ui->plainTextEditFormula->height();
|
||||||
ui->plainTextEditFormula->installEventFilter(this);
|
ui->plainTextEditFormula->installEventFilter(this);
|
||||||
|
|
||||||
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
qCDebug(vDialog, "Showing variables.");
|
qCDebug(vDialog, "Showing variables.");
|
||||||
ShowUnits();
|
ShowUnits();
|
||||||
|
|
|
@ -42,7 +42,7 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
ui->progressBar->setMaximum(maxCount);
|
ui->progressBar->setMaximum(maxCount);
|
||||||
ui->progressBar->setValue(0);
|
ui->progressBar->setValue(0);
|
||||||
|
|
|
@ -60,7 +60,7 @@ DialogLayoutSettings::DialogLayoutSettings(VLayoutGenerator *generator, QWidget
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
//moved from ReadSettings - well...it seems it can be done once only (i.e. constructor) because Init funcs dont
|
//moved from ReadSettings - well...it seems it can be done once only (i.e. constructor) because Init funcs dont
|
||||||
//even cleanse lists before adding
|
//even cleanse lists before adding
|
||||||
|
|
|
@ -49,7 +49,7 @@ DialogNewPattern::DialogNewPattern(VContainer *data, const QString &patternPiece
|
||||||
ui->lineEditName->setClearButtonEnabled(true);
|
ui->lineEditName->setClearButtonEnabled(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
QRect position = this->frameGeometry();
|
QRect position = this->frameGeometry();
|
||||||
position.moveCenter(QDesktopWidget().availableGeometry().center());
|
position.moveCenter(QDesktopWidget().availableGeometry().center());
|
||||||
|
|
|
@ -71,7 +71,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
|
||||||
|
|
||||||
SCASSERT(doc != nullptr);
|
SCASSERT(doc != nullptr);
|
||||||
|
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
if (m_filePath.isEmpty())
|
if (m_filePath.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,7 @@ DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
this->xmlmodel = new VXMLTreeView();
|
this->xmlmodel = new VXMLTreeView();
|
||||||
this->doc=xmldoc;
|
this->doc=xmldoc;
|
||||||
|
|
|
@ -55,7 +55,7 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *
|
||||||
ui->lineEditFileName->setClearButtonEnabled(true);
|
ui->lineEditFileName->setClearButtonEnabled(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||||
SCASSERT(bOk != nullptr);
|
SCASSERT(bOk != nullptr);
|
||||||
|
|
|
@ -3914,7 +3914,7 @@ QStringList MainWindow::GetUnlokedRestoreFileList() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::WindowsLocale()
|
void MainWindow::WindowsLocale()
|
||||||
{
|
{
|
||||||
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -157,7 +157,7 @@ template <typename T>
|
||||||
inline QString VAbstractApplication::LocaleToString(const T &value)
|
inline QString VAbstractApplication::LocaleToString(const T &value)
|
||||||
{
|
{
|
||||||
QLocale loc;
|
QLocale loc;
|
||||||
qApp->Settings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale(QLocale::C);
|
qApp->Settings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale::c();
|
||||||
return loc.toString(value);
|
return loc.toString(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -779,7 +779,7 @@ QString VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator
|
||||||
}
|
}
|
||||||
|
|
||||||
QLocale loc = QLocale::system(); // User locale
|
QLocale loc = QLocale::system(); // User locale
|
||||||
if (loc != QLocale(QLocale::C) && osSeparator)
|
if (loc != QLocale::c() && osSeparator)
|
||||||
{// User want use Os separator
|
{// User want use Os separator
|
||||||
QList<int> nKeys = numbers.keys();// Positions for all numbers in expression
|
QList<int> nKeys = numbers.keys();// Positions for all numbers in expression
|
||||||
QList<QString> nValues = numbers.values();
|
QList<QString> nValues = numbers.values();
|
||||||
|
@ -794,7 +794,7 @@ QString VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator
|
||||||
continue;//Leave with out translation
|
continue;//Leave with out translation
|
||||||
}
|
}
|
||||||
|
|
||||||
loc = QLocale(QLocale::C);// To internal locale
|
loc = QLocale::c();// To internal locale
|
||||||
const QString dStr = loc.toString(d);// Internal look for number
|
const QString dStr = loc.toString(d);// Internal look for number
|
||||||
newFormula.replace(nKeys.at(i), nValues.at(i).length(), dStr);
|
newFormula.replace(nKeys.at(i), nValues.at(i).length(), dStr);
|
||||||
const int bias = nValues.at(i).length() - dStr.length();
|
const int bias = nValues.at(i).length() - dStr.length();
|
||||||
|
@ -922,7 +922,7 @@ QString VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator)
|
||||||
QList<QString> nValues = numbers.values();
|
QList<QString> nValues = numbers.values();
|
||||||
for (int i = 0; i < nKeys.size(); ++i)
|
for (int i = 0; i < nKeys.size(); ++i)
|
||||||
{
|
{
|
||||||
loc = QLocale(QLocale::C);// From pattern locale
|
loc = QLocale::c();// From pattern locale
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const qreal d = loc.toDouble(nValues.at(i), &ok);
|
const qreal d = loc.toDouble(nValues.at(i), &ok);
|
||||||
if (ok == false)
|
if (ok == false)
|
||||||
|
|
|
@ -46,7 +46,7 @@ DialogUndo::DialogUndo(QWidget *parent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
|
|
||||||
bool opening = qApp->getOpeningPattern();
|
bool opening = qApp->getOpeningPattern();
|
||||||
if (opening)
|
if (opening)
|
||||||
|
|
|
@ -342,7 +342,7 @@ inline void DialogTool::InitOkCancel(T *ui)
|
||||||
SCASSERT(bCancel != nullptr);
|
SCASSERT(bCancel != nullptr);
|
||||||
connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
|
connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
|
||||||
|
|
||||||
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user