diff options
author | Alexander V. Wolf <aw@altspu.ru> | 2022-02-01 15:25:45 +0700 |
---|---|---|
committer | Alexander V. Wolf <aw@altspu.ru> | 2022-02-01 15:25:45 +0700 |
commit | 78d24f7c07f5fb64adc23d3274e80d8e66f89e32 (patch) | |
tree | 726a9de1bc3b3a1c9cd21e4c8ec8685f0b89b8ba | |
parent | 1d5729a5cfc12bb05807e3cf0618788443ace8a1 (diff) |
Removed unneeded code
-rw-r--r-- | plugins/Calendars/src/RevisedJulianCalendar.cpp | 64 | ||||
-rw-r--r-- | plugins/Calendars/src/RevisedJulianCalendar.hpp | 16 |
2 files changed, 0 insertions, 80 deletions
diff --git a/plugins/Calendars/src/RevisedJulianCalendar.cpp b/plugins/Calendars/src/RevisedJulianCalendar.cpp index 0381b6daf9..c00d924cf5 100644 --- a/plugins/Calendars/src/RevisedJulianCalendar.cpp +++ b/plugins/Calendars/src/RevisedJulianCalendar.cpp @@ -24,70 +24,6 @@ RevisedJulianCalendar::RevisedJulianCalendar(double jd): JulianCalendar(jd) { - RevisedJulianCalendar::retranslate(); -} - -QMap<int, QString> RevisedJulianCalendar::weekDayNames; -QMap<int, QString> RevisedJulianCalendar::monthNames; - -void RevisedJulianCalendar::retranslate() -{ - // fill the name lists with translated month and day names - weekDayNames={ - {0, qc_("Sunday" , "long day name")}, - {1, qc_("Monday" , "long day name")}, - {2, qc_("Tuesday" , "long day name")}, - {3, qc_("Wednesday", "long day name")}, - {4, qc_("Thursday" , "long day name")}, - {5, qc_("Friday" , "long day name")}, - {6, qc_("Saturday" , "long day name")}}; - monthNames={ - { 1, qc_("January" , "long month name")}, - { 2, qc_("February" , "long month name")}, - { 3, qc_("March" , "long month name")}, - { 4, qc_("April" , "long month name")}, - { 5, qc_("May" , "long month name")}, - { 6, qc_("June" , "long month name")}, - { 7, qc_("July" , "long month name")}, - { 8, qc_("August" , "long month name")}, - { 9, qc_("September", "long month name")}, - {10, qc_("October" , "long month name")}, - {11, qc_("November" , "long month name")}, - {12, qc_("December" , "long month name")}}; -} - -// get a stringlist of calendar date elements sorted from the largest to the smallest. -// Year, Month, MonthName, Day, DayName -// Again, in this plugin only, note no year zero, and AD/BC counting. -QStringList RevisedJulianCalendar::getDateStrings() const -{ - QStringList list; - list << QString("%1 %2").arg(abs(parts.at(0))).arg(parts.at(0)>0 ? q_("A.D.") : q_("B.C.")); - list << QString::number(parts.at(1)); - list << QString::number(parts.at(2)); - list << weekday(JD); - - return list; -} - -// get a formatted complete string for a date -QString RevisedJulianCalendar::getFormattedDateString() const -{ - QStringList str=getDateStrings(); - // TODO: Maybe use QDate with user's localisation here? Weekday has to be taken from our results, though. - return QString("%1, %2 - %3 (%4) - %5").arg( - str.at(3), // weekday - str.at(2), // day - str.at(1), // month, numerical - monthNames.value(parts.at(1)), // month, name - str.at(0));// year -} - -// return name of week day -QString RevisedJulianCalendar::weekday(double jd) -{ - const int dow = StelUtils::getDayOfWeek(jd+StelApp::getInstance().getCore()->getUTCOffset(jd)/24.); - return weekDayNames.value(dow); } // Set a calendar date from the Julian day number diff --git a/plugins/Calendars/src/RevisedJulianCalendar.hpp b/plugins/Calendars/src/RevisedJulianCalendar.hpp index 0574ed5f38..9b43ba1306 100644 --- a/plugins/Calendars/src/RevisedJulianCalendar.hpp +++ b/plugins/Calendars/src/RevisedJulianCalendar.hpp @@ -38,8 +38,6 @@ public: virtual ~RevisedJulianCalendar() Q_DECL_OVERRIDE {} public slots: - virtual void retranslate() Q_DECL_OVERRIDE; - //! Set a calendar date from the Julian day number virtual void setJD(double JD) Q_DECL_OVERRIDE; @@ -47,17 +45,7 @@ public slots: //! Year-Month[1...12]-Day[1...31] virtual void setDate(QVector<int> parts) Q_DECL_OVERRIDE; - //! get a stringlist of calendar date elements sorted from the largest to the smallest. - //! Year, Month, MonthName, Day, DayName - virtual QStringList getDateStrings() const Q_DECL_OVERRIDE; - - //! get a formatted complete string for a date - virtual QString getFormattedDateString() const Q_DECL_OVERRIDE; - public: - //! return name of week day. This is actually independent from any calendar, just a modulo of JD. - static QString weekday(double jd); - //! returns true for leap years. We handle years prior to 325 like in the regular Julian calendar. static bool isLeap(int year); @@ -68,10 +56,6 @@ public: static QVector<int> revisedJulianFromFixed(int rd); constexpr static const int revisedJulianEpoch=1; //! RD of January 1, AD1. - -protected: - static QMap<int, QString> weekDayNames; - static QMap<int, QString> monthNames; }; #endif |