tools/shared/qtpropertybrowser/qtpropertymanager.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 7 3f74d0d4af4c
--- a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp	Fri Feb 19 23:40:16 2010 +0200
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -1553,6 +1553,7 @@
     QtDatePropertyManager *q_ptr;
     Q_DECLARE_PUBLIC(QtDatePropertyManager)
 public:
+    explicit QtDatePropertyManagerPrivate(QtDatePropertyManager *q);
 
     struct Data
     {
@@ -1573,6 +1574,12 @@
     QMap<const QtProperty *, Data> m_values;
 };
 
+QtDatePropertyManagerPrivate::QtDatePropertyManagerPrivate(QtDatePropertyManager *q) :
+    q_ptr(q),
+    m_format(QtPropertyBrowserUtils::dateFormat())
+{
+}
+
 /*!
     \class QtDatePropertyManager
     \internal
@@ -1622,12 +1629,8 @@
     Creates a manager with the given \a parent.
 */
 QtDatePropertyManager::QtDatePropertyManager(QObject *parent)
-    : QtAbstractPropertyManager(parent), d_ptr(new QtDatePropertyManagerPrivate)
-{
-    d_ptr->q_ptr = this;
-
-    QLocale loc;
-    d_ptr->m_format = loc.dateFormat(QLocale::ShortFormat);
+    : QtAbstractPropertyManager(parent), d_ptr(new QtDatePropertyManagerPrivate(this))
+{
 }
 
 /*!
@@ -1786,13 +1789,20 @@
     QtTimePropertyManager *q_ptr;
     Q_DECLARE_PUBLIC(QtTimePropertyManager)
 public:
-
-    QString m_format;
+    explicit QtTimePropertyManagerPrivate(QtTimePropertyManager *q);
+
+    const QString m_format;
 
     typedef QMap<const QtProperty *, QTime> PropertyValueMap;
     PropertyValueMap m_values;
 };
 
+QtTimePropertyManagerPrivate::QtTimePropertyManagerPrivate(QtTimePropertyManager *q) :
+    q_ptr(q),
+    m_format(QtPropertyBrowserUtils::timeFormat())
+{
+}
+
 /*!
     \class QtTimePropertyManager
     \internal
@@ -1825,12 +1835,8 @@
     Creates a manager with the given \a parent.
 */
 QtTimePropertyManager::QtTimePropertyManager(QObject *parent)
-    : QtAbstractPropertyManager(parent), d_ptr(new QtTimePropertyManagerPrivate)
-{
-    d_ptr->q_ptr = this;
-
-    QLocale loc;
-    d_ptr->m_format = loc.timeFormat(QLocale::ShortFormat);
+    : QtAbstractPropertyManager(parent), d_ptr(new QtTimePropertyManagerPrivate(this))
+{
 }
 
 /*!
@@ -1903,13 +1909,20 @@
     QtDateTimePropertyManager *q_ptr;
     Q_DECLARE_PUBLIC(QtDateTimePropertyManager)
 public:
-
-    QString m_format;
+    explicit QtDateTimePropertyManagerPrivate(QtDateTimePropertyManager *q);
+
+    const QString m_format;
 
     typedef QMap<const QtProperty *, QDateTime> PropertyValueMap;
     PropertyValueMap m_values;
 };
 
+QtDateTimePropertyManagerPrivate::QtDateTimePropertyManagerPrivate(QtDateTimePropertyManager *q) :
+    q_ptr(q),
+    m_format(QtPropertyBrowserUtils::dateTimeFormat())
+{
+}
+
 /*! \class QtDateTimePropertyManager
     \internal
     \inmodule QtDesigner
@@ -1938,14 +1951,8 @@
     Creates a manager with the given \a parent.
 */
 QtDateTimePropertyManager::QtDateTimePropertyManager(QObject *parent)
-    : QtAbstractPropertyManager(parent), d_ptr(new QtDateTimePropertyManagerPrivate)
-{
-    d_ptr->q_ptr = this;
-
-    QLocale loc;
-    d_ptr->m_format = loc.dateFormat(QLocale::ShortFormat);
-    d_ptr->m_format += QLatin1Char(' ');
-    d_ptr->m_format += loc.timeFormat(QLocale::ShortFormat);
+    : QtAbstractPropertyManager(parent), d_ptr(new QtDateTimePropertyManagerPrivate(this))
+{
 }
 
 /*!