summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qcalendarbackend_p.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-01-08 14:17:09 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-01-30 17:58:40 +0100
commitc0f041fcdf9573c0777fd19a0ce012fedf83fec4 (patch)
treeac276ea9c200edf1b21b0133844b785cb1af2968 /src/corelib/time/qcalendarbackend_p.h
parent4e84a8b29f13169a75c734920e953d3157768bca (diff)
Refactor QLocale's data access to be less verbose
Add QLocaleData::DataRange and methods returning it, to package each of the m_*_idx, m_*_size pairs of data members, to simplify access to these data. This extends the experiment started in QCalendarLocale, which is now adapted to use the new DataRange also. Two static functions of qlocale.cpp are replaced by methods of DataRange, saving considerable duplication of long member names in callers. Change-Id: Iad9899ba72f00522594b55a0402baec47491999c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/time/qcalendarbackend_p.h')
-rw-r--r--src/corelib/time/qcalendarbackend_p.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/corelib/time/qcalendarbackend_p.h b/src/corelib/time/qcalendarbackend_p.h
index 21506e9e2c..843e42c584 100644
--- a/src/corelib/time/qcalendarbackend_p.h
+++ b/src/corelib/time/qcalendarbackend_p.h
@@ -56,23 +56,21 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qstring.h>
#include <QtCore/qmap.h>
+#include <QtCore/private/qlocale_p.h>
QT_BEGIN_NAMESPACE
// Locale-related parts, mostly handled in ../text/qlocale.cpp
-struct QLocaleDataEntry {
- quint16 index, size;
-};
struct QCalendarLocale {
quint16 m_language_id, m_script_id, m_country_id;
// Month name indexes:
- QLocaleDataEntry m_standalone_short;
- QLocaleDataEntry m_standalone_long;
- QLocaleDataEntry m_standalone_narrow;
- QLocaleDataEntry m_short;
- QLocaleDataEntry m_long;
- QLocaleDataEntry m_narrow;
+ QLocaleData::DataRange m_standalone_short;
+ QLocaleData::DataRange m_standalone_long;
+ QLocaleData::DataRange m_standalone_narrow;
+ QLocaleData::DataRange m_short;
+ QLocaleData::DataRange m_long;
+ QLocaleData::DataRange m_narrow;
};
// Partial implementation, of methods with common forms, in qcalendar.cpp