Clean-up the interface for QDate.
Four overload functions removed while keeping source compatibility: - shortMonthName() - shortDayName() - longMonthName() - longDayName() Two functions removed since they have confusing names: - gregorianToJulian() - julianToGregorian() Change-Id: Iaaea066a3fb77b1ee3499d3049fcec5563054cdf Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>bb10
parent
7aeccb183a
commit
84bd87353a
|
|
@ -565,18 +565,6 @@ QString QDate::shortMonthName(int month, QDate::MonthNameType type)
|
|||
return QString();
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the short version of the name of the \a month. The
|
||||
returned name is in normal type which can be used for date formatting.
|
||||
|
||||
\sa toString(), longMonthName(), shortDayName(), longDayName()
|
||||
*/
|
||||
|
||||
QString QDate::shortMonthName(int month)
|
||||
{
|
||||
return shortMonthName(month, QDate::DateFormat);
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 4.5
|
||||
|
||||
|
|
@ -622,21 +610,6 @@ QString QDate::longMonthName(int month, MonthNameType type)
|
|||
return QString();
|
||||
}
|
||||
|
||||
/*!
|
||||
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
|
||||
|
||||
|
|
@ -677,21 +650,6 @@ QString QDate::shortDayName(int weekday, MonthNameType type)
|
|||
return QString();
|
||||
}
|
||||
|
||||
/*!
|
||||
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
|
||||
|
||||
|
|
@ -731,21 +689,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
|
||||
|
|
@ -1346,30 +1289,6 @@ bool QDate::isLeapYear(int y)
|
|||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
This function has a confusing name and shouldn't be part of the
|
||||
API anyway, since we have toJulian() and fromJulian().
|
||||
### Qt 5: remove it
|
||||
*/
|
||||
uint QDate::gregorianToJulian(int y, int m, int d)
|
||||
{
|
||||
return julianDayFromDate(y, m, d);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
This function has a confusing name and shouldn't be part of the
|
||||
API anyway, since we have toJulian() and fromJulian().
|
||||
### Qt 5: remove it
|
||||
*/
|
||||
void QDate::julianToGregorian(uint jd, int &y, int &m, int &d)
|
||||
{
|
||||
getDateFromJulianDay(jd, &y, &m, &d);
|
||||
}
|
||||
|
||||
/*! \fn static QDate QDate::fromJulianDay(int jd)
|
||||
|
||||
Converts the Julian day \a jd to a QDate.
|
||||
|
|
|
|||
|
|
@ -76,15 +76,10 @@ public:
|
|||
int weekNumber(int *yearNum = 0) const;
|
||||
|
||||
#ifndef QT_NO_TEXTDATE
|
||||
// ### Qt 5: merge these functions.
|
||||
static QString shortMonthName(int month);
|
||||
static QString shortMonthName(int month, MonthNameType type);
|
||||
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 shortMonthName(int month, MonthNameType type = DateFormat);
|
||||
static QString shortDayName(int weekday, MonthNameType type = DateFormat);
|
||||
static QString longMonthName(int month, MonthNameType type = DateFormat);
|
||||
static QString longDayName(int weekday, MonthNameType type = DateFormat);
|
||||
#endif // QT_NO_TEXTDATE
|
||||
#ifndef QT_NO_DATESTRING
|
||||
QString toString(Qt::DateFormat f = Qt::TextDate) const;
|
||||
|
|
@ -115,10 +110,6 @@ public:
|
|||
static bool isValid(int y, int m, int d);
|
||||
static bool isLeapYear(int year);
|
||||
|
||||
// ### Qt 5: remove these two functions
|
||||
static uint gregorianToJulian(int y, int m, int d);
|
||||
static void julianToGregorian(uint jd, int &y, int &m, int &d);
|
||||
|
||||
static inline QDate fromJulianDay(int jd) { QDate d; d.jd = jd; return d; }
|
||||
inline int toJulianDay() const { return jd; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue