Drop use of Qt::DefaultLocaleShortDate

Gone in Qt 6.

Task-number: QTCREATORBUG-24098
Change-Id: Ie9fe1858406133fed6987de0e0a38fe86de15caf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-06-19 18:49:17 +02:00
parent 467fdead9f
commit e6d1f08642
4 changed files with 9 additions and 6 deletions

View File

@@ -180,9 +180,11 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
expander->registerVariable("CurrentTime:RFC", tr("The current time (RFC2822)."), expander->registerVariable("CurrentTime:RFC", tr("The current time (RFC2822)."),
[]() { return QTime::currentTime().toString(Qt::RFC2822Date); }); []() { return QTime::currentTime().toString(Qt::RFC2822Date); });
expander->registerVariable("CurrentDate:Locale", tr("The current date (Locale)."), expander->registerVariable("CurrentDate:Locale", tr("The current date (Locale)."),
[]() { return QDate::currentDate().toString(Qt::DefaultLocaleShortDate); }); []() { return QLocale::system()
.toString(QDate::currentDate(), QLocale::ShortFormat); });
expander->registerVariable("CurrentTime:Locale", tr("The current time (Locale)."), expander->registerVariable("CurrentTime:Locale", tr("The current time (Locale)."),
[]() { return QTime::currentTime().toString(Qt::DefaultLocaleShortDate); }); []() { return QLocale::system()
.toString(QTime::currentTime(), QLocale::ShortFormat); });
expander->registerVariable("Config:DefaultProjectDirectory", tr("The configured default directory for projects."), expander->registerVariable("Config:DefaultProjectDirectory", tr("The configured default directory for projects."),
[]() { return DocumentManager::projectsDirectory().toString(); }); []() { return DocumentManager::projectsDirectory().toString(); });
expander->registerVariable("Config:LastFileDialogDirectory", tr("The directory last visited in a file dialog."), expander->registerVariable("Config:LastFileDialogDirectory", tr("The directory last visited in a file dialog."),

View File

@@ -466,7 +466,7 @@ QString GerritModel::toHtml(const QModelIndex& index) const
<< dependencyHtml(dependsOnHeader, c->dependsOnNumber, serverPrefix) << dependencyHtml(dependsOnHeader, c->dependsOnNumber, serverPrefix)
<< dependencyHtml(neededByHeader, c->neededByNumber, serverPrefix) << dependencyHtml(neededByHeader, c->neededByNumber, serverPrefix)
<< "<tr><td>" << statusHeader << "</td><td>" << c->status << "<tr><td>" << statusHeader << "</td><td>" << c->status
<< ", " << c->lastUpdated.toString(Qt::DefaultLocaleShortDate) << "</td></tr>" << ", " << QLocale::system().toString(c->lastUpdated, QLocale::ShortFormat) << "</td></tr>"
<< "<tr><td>" << patchSetHeader << "</td><td>" << "</td></tr>" << c->currentPatchSet.patchSetNumber << "</td></tr>" << "<tr><td>" << patchSetHeader << "</td><td>" << "</td></tr>" << c->currentPatchSet.patchSetNumber << "</td></tr>"
<< c->currentPatchSet.approvalsToHtml() << c->currentPatchSet.approvalsToHtml()
<< "<tr><td>" << urlHeader << "</td><td><a href=\"" << c->url << "\">" << c->url << "</a></td></tr>" << "<tr><td>" << urlHeader << "</td><td><a href=\"" << c->url << "\">" << c->url << "</a></td></tr>"

View File

@@ -922,9 +922,9 @@ void CustomWizardContext::reset()
baseReplacements.insert(QLatin1String("CurrentTime:RFC"), baseReplacements.insert(QLatin1String("CurrentTime:RFC"),
currentTime.toString(Qt::RFC2822Date)); currentTime.toString(Qt::RFC2822Date));
baseReplacements.insert(QLatin1String("CurrentDate:Locale"), baseReplacements.insert(QLatin1String("CurrentDate:Locale"),
currentDate.toString(Qt::DefaultLocaleShortDate)); QLocale::system().toString(currentDate, QLocale::ShortFormat));
baseReplacements.insert(QLatin1String("CurrentTime:Locale"), baseReplacements.insert(QLatin1String("CurrentTime:Locale"),
currentTime.toString(Qt::DefaultLocaleShortDate)); QLocale::system().toString(currentTime, QLocale::ShortFormat));
replacements.clear(); replacements.clear();
path.clear(); path.clear();
targetPath.clear(); targetPath.clear();

View File

@@ -211,7 +211,8 @@ void CleanDialog::addFile(const QString &workingDirectory, QString fileName, boo
nameItem->setData(QVariant(isDir), Internal::isDirectoryRole); nameItem->setData(QVariant(isDir), Internal::isDirectoryRole);
// Tooltip with size information // Tooltip with size information
if (fi.isFile()) { if (fi.isFile()) {
const QString lastModified = fi.lastModified().toString(Qt::DefaultLocaleShortDate); const QString lastModified =
QLocale::system().toString(fi.lastModified(), QLocale::ShortFormat);
nameItem->setToolTip(tr("%n bytes, last modified %1.", nullptr, nameItem->setToolTip(tr("%n bytes, last modified %1.", nullptr,
fi.size()).arg(lastModified)); fi.size()).arg(lastModified));
} }