summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qcalendar.cpp
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-07-22 14:28:30 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-27 15:15:30 +0000
commite2309e5c48f822a7514afbebbb708ac1ed054bbc (patch)
tree149dd1cfd2db6a6891335a71aeceba0616cfe4aa /src/corelib/time/qcalendar.cpp
parente0bb7da53e7c8e6929ee5a96d5bbed18029ddeba (diff)
QCalendarBackend: Use QAnyStringView to create backends by name
Combine two implementations of QCalendarBackend::byName() accepting QStringView and QLatin1String arguments into one accepting QAnyStringView to reduce code duplication. Add a note to QCalendar constructors accepting strings to do the same for Qt 7. Change-Id: Idfc3b9c61e22712543c723bd94fcd788da52780a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 25170b324b7db872be2a2bde5c04eb0c1e3972e5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/time/qcalendar.cpp')
-rw-r--r--src/corelib/time/qcalendar.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/corelib/time/qcalendar.cpp b/src/corelib/time/qcalendar.cpp
index 4a245f6d3f..d3dada33b3 100644
--- a/src/corelib/time/qcalendar.cpp
+++ b/src/corelib/time/qcalendar.cpp
@@ -890,7 +890,7 @@ bool QCalendarBackend::registerAlias(const QString &name)
\sa availableCalendars(), registerAlias(), fromEnum(), fromId()
*/
-const QCalendarBackend *QCalendarBackend::fromName(QStringView name)
+const QCalendarBackend *QCalendarBackend::fromName(QAnyStringView name)
{
if (calendarRegistry.isDestroyed())
return nullptr;
@@ -902,20 +902,6 @@ const QCalendarBackend *QCalendarBackend::fromName(QStringView name)
/*!
\internal
- \overload
- */
-const QCalendarBackend *QCalendarBackend::fromName(QLatin1String name)
-{
- if (calendarRegistry.isDestroyed())
- return nullptr;
- calendarRegistry->populate();
- const auto registryLock = qt_scoped_lock(registryMutex);
- auto it = calendarRegistry->byName.find(QString(name));
- return it == calendarRegistry->byName.end() ? nullptr : *it;
-}
-
-/*!
- \internal
Returns a pointer to a calendar backend, specified by ID.
If a calendar with ID \a id is known to the calendar registry, the backend