aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-06-19 18:49:17 +0200
committerhjk <hjk@qt.io>2020-06-22 06:43:39 +0000
commite6d1f08642eff25749b7e07c4e8589e4aa2513bf (patch)
treef4a55e37a7b24b67a0f1d9b813da8ab4db611e93
parent467fdead9fd7fcd81de9a6a10d380b59bc395e84 (diff)
Drop use of Qt::DefaultLocaleShortDate
Gone in Qt 6. Task-number: QTCREATORBUG-24098 Change-Id: Ie9fe1858406133fed6987de0e0a38fe86de15caf Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/plugins/coreplugin/coreplugin.cpp6
-rw-r--r--src/plugins/git/gerrit/gerritmodel.cpp2
-rw-r--r--src/plugins/projectexplorer/customwizard/customwizardparameters.cpp4
-rw-r--r--src/plugins/vcsbase/cleandialog.cpp3
4 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp
index bb63869fa8..b2a6155077 100644
--- a/src/plugins/coreplugin/coreplugin.cpp
+++ b/src/plugins/coreplugin/coreplugin.cpp
@@ -180,9 +180,11 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
expander->registerVariable("CurrentTime:RFC", tr("The current time (RFC2822)."),
[]() { return QTime::currentTime().toString(Qt::RFC2822Date); });
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)."),
- []() { 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."),
[]() { return DocumentManager::projectsDirectory().toString(); });
expander->registerVariable("Config:LastFileDialogDirectory", tr("The directory last visited in a file dialog."),
diff --git a/src/plugins/git/gerrit/gerritmodel.cpp b/src/plugins/git/gerrit/gerritmodel.cpp
index c5e346aaa6..a4e2ae8e1e 100644
--- a/src/plugins/git/gerrit/gerritmodel.cpp
+++ b/src/plugins/git/gerrit/gerritmodel.cpp
@@ -466,7 +466,7 @@ QString GerritModel::toHtml(const QModelIndex& index) const
<< dependencyHtml(dependsOnHeader, c->dependsOnNumber, serverPrefix)
<< dependencyHtml(neededByHeader, c->neededByNumber, serverPrefix)
<< "<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>"
<< c->currentPatchSet.approvalsToHtml()
<< "<tr><td>" << urlHeader << "</td><td><a href=\"" << c->url << "\">" << c->url << "</a></td></tr>"
diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
index 323c0d6100..da071f1192 100644
--- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
+++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
@@ -922,9 +922,9 @@ void CustomWizardContext::reset()
baseReplacements.insert(QLatin1String("CurrentTime:RFC"),
currentTime.toString(Qt::RFC2822Date));
baseReplacements.insert(QLatin1String("CurrentDate:Locale"),
- currentDate.toString(Qt::DefaultLocaleShortDate));
+ QLocale::system().toString(currentDate, QLocale::ShortFormat));
baseReplacements.insert(QLatin1String("CurrentTime:Locale"),
- currentTime.toString(Qt::DefaultLocaleShortDate));
+ QLocale::system().toString(currentTime, QLocale::ShortFormat));
replacements.clear();
path.clear();
targetPath.clear();
diff --git a/src/plugins/vcsbase/cleandialog.cpp b/src/plugins/vcsbase/cleandialog.cpp
index 0f358ab1de..46f3acb021 100644
--- a/src/plugins/vcsbase/cleandialog.cpp
+++ b/src/plugins/vcsbase/cleandialog.cpp
@@ -211,7 +211,8 @@ void CleanDialog::addFile(const QString &workingDirectory, QString fileName, boo
nameItem->setData(QVariant(isDir), Internal::isDirectoryRole);
// Tooltip with size information
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,
fi.size()).arg(lastModified));
}