[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdepim/korganizer/plugins/hebrew
From: Meni Livne <livne () kde ! org>
Date: 2004-03-04 15:51:40
Message-ID: 20040304155140.A029B996F () office ! kde ! org
[Download RAW message or body]
CVS commit by livne:
Use KCalendarSystemHebrew for day numbers and month names, thus avoiding
unnecessary duplication and fixing a bug with displaying of Hebrew day numbers.
CCMAIL: kde-il@yahoogroups.com
M +0 -22 converter.cpp 1.3
M +0 -1 converter.h 1.3
M +5 -3 hebrew.cpp 1.5
--- kdepim/korganizer/plugins/hebrew/converter.cpp #1.2:1.3
@@ -12,7 +12,4 @@
#include <klocale.h>
-QStringList Converter::HebrewMonthNames;
-QStringList Converter::SecularMonthNames;
-
Converter::Converter()
{
@@ -335,18 +332,4 @@ void
struct DateResult *result)
{
-
- HebrewMonthNames << "" <<
- i18n
- ("These are months of the Jewish calendar and don't have translations. They may have \
different spellings in your language; otherwise just translate the sound to \
your characters",
- "Nissan") << i18n("Iyar") << i18n("Sivan") << i18n("Tammuz") <<
- i18n("Av") << i18n("Elul") << i18n("Tishrei") << i18n("Cheshvan")
- << i18n("Kislev") << i18n("Tevet") << i18n("Shvat") <<
- i18n("Adar I") << i18n("Adar II") << i18n("Adar");
-
- SecularMonthNames << "" << i18n("January") << i18n("February") <<
- i18n("March") << i18n("April") << i18n("May") << i18n("June") <<
- i18n("July") << i18n("August") << i18n("September") <<
- i18n("October") << i18n("November") << i18n("December");
-
result->hebrew_month_length = hebrew_month_length(hyear, hmonth);
result->secular_month_length = secular_month_length(syear, smonth);
@@ -354,9 +337,4 @@ void
result->secular_leap_year_p = gregorian_leap_year_p(syear);
result->kvia = (hebrew_year_length(hyear) % 10) - 3;
- result->hebrew_month_name = ((hmonth < 12)
- || result->
- hebrew_leap_year_p) ?
- HebrewMonthNames[hmonth] : HebrewMonthNames[14];
- result->secular_month_name = SecularMonthNames[smonth];
// absolute is -1 on 1/1/0001 Julian
result->day_of_week = (7 + absolute) % 7;
--- kdepim/korganizer/plugins/hebrew/converter.h #1.2:1.3
@@ -24,5 +24,4 @@ struct DateResult
int hebrew_month_length, secular_month_length;
bool hebrew_leap_year_p, secular_leap_year_p;
- QString hebrew_month_name, secular_month_name;
int kvia;
int hebrew_day_number;
--- kdepim/korganizer/plugins/hebrew/hebrew.cpp #1.4:1.5
@@ -22,4 +22,6 @@
#include <kstandarddirs.h>
#include <ksimpleconfig.h>
+#include <kcalendarsystem.h>
+#include <kcalendarsystemfactory.h>
#include "hebrew.h"
#include "configdialog.h"
@@ -74,5 +76,4 @@ QString Hebrew::shortText(const QDate &
int hebrew_year = result.year;
int hebrew_day_of_week = result.day_of_week;
- QString hebrew_month_name = result.hebrew_month_name;
bool hebrew_leap_year_p = result.hebrew_leap_year_p;
int hebrew_kvia = result.kvia;
@@ -85,6 +86,7 @@ QString Hebrew::shortText(const QDate &
hebrew_day_number, hebrew_year);
- label_text->setNum(hebrew_day);
- *label_text += " " + hebrew_month_name;
+ KCalendarSystem *cal = KCalendarSystemFactory::create("hebrew");
+ *label_text = QString("%1 %2").arg(cal->dayString(date, false))
+ .arg(cal->monthName(date));
if (holidays.count())
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic