OSDN Git Service

clean-up the interface for QDate
authorIvailo Monev <xakepa10@gmail.com>
Sat, 16 Jan 2016 13:20:25 +0000 (15:20 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 16 Jan 2016 13:20:25 +0000 (15:20 +0200)
some upstream changes have not been applied on purpose

upstream commits:
https://github.com/qtproject/qtbase/commit/84bd87353a3f092d00942e90aa20be3668a7456b

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/tools/qdatetime.cpp
src/core/tools/qdatetime.h

index 8474f98..a4909fb 100644 (file)
@@ -575,21 +575,6 @@ QString QDate::longMonthName(int month, MonthNameType type)
 }
 
 /*!
-    Returns the long version of the name of the \a month. The
-    returned name is in normal type which can be used for date formatting.
-
-    \sa toString(), shortMonthName(), shortDayName(), longDayName()
- */
-
-QString QDate::longMonthName(int month)
-{
-    if (month < 1 || month > 12) {
-        month = 1;
-    }
-    return QLocale::system().monthName(month, QLocale::LongFormat);
-}
-
-/*!
     \since 4.5
 
     Returns the short name of the \a weekday for the representation specified
@@ -630,21 +615,6 @@ QString QDate::shortDayName(int weekday, MonthNameType type)
 }
 
 /*!
-    Returns the short version of the name of the \a weekday. The
-    returned name is in normal type which can be used for date formatting.
-
-    \sa toString(), longDayName(), shortMonthName(), longMonthName()
- */
-
-QString QDate::shortDayName(int weekday)
-{
-    if (weekday < 1 || weekday > 7) {
-        weekday = 1;
-    }
-    return QLocale::system().dayName(weekday, QLocale::ShortFormat);
-}
-
-/*!
     \since 4.5
 
     Returns the long name of the \a weekday for the representation specified
@@ -683,21 +653,6 @@ QString QDate::longDayName(int weekday, MonthNameType type)
     }
     return QLocale::system().dayName(weekday, QLocale::LongFormat);
 }
-
-/*!
-    Returns the long version of the name of the \a weekday. The
-    returned name is in normal type which can be used for date formatting.
-
-    \sa toString(), shortDayName(), shortMonthName(), longMonthName()
- */
-
-QString QDate::longDayName(int weekday)
-{
-    if (weekday < 1 || weekday > 7) {
-        weekday = 1;
-    }
-    return QLocale::system().dayName(weekday, QLocale::LongFormat);
-}
 #endif //QT_NO_TEXTDATE
 
 #ifndef QT_NO_DATESTRING
index 8d64992..0130d3a 100644 (file)
@@ -75,14 +75,10 @@ public:
     int weekNumber(int *yearNum = 0) const;
 
 #ifndef QT_NO_TEXTDATE
-    // ### Qt 5: merge these functions.
     static QString shortMonthName(int month, MonthNameType type = QDate::DateFormat);
-    static QString shortDayName(int weekday);
-    static QString shortDayName(int weekday, MonthNameType type);
-    static QString longMonthName(int month);
-    static QString longMonthName(int month, MonthNameType type);
-    static QString longDayName(int weekday);
-    static QString longDayName(int weekday, MonthNameType type);
+    static QString shortDayName(int weekday, MonthNameType type = QDate::DateFormat);
+    static QString longMonthName(int month, MonthNameType type = QDate::DateFormat);
+    static QString longDayName(int weekday, MonthNameType type = QDate::DateFormat);
 #endif // QT_NO_TEXTDATE
 #ifndef QT_NO_DATESTRING
     QString toString(Qt::DateFormat f = Qt::TextDate) const;