From kde-devel Sun Aug 17 20:11:07 2003 From: Martin Koller Date: Sun, 17 Aug 2003 20:11:07 +0000 To: kde-devel Subject: [Patch] kcalendarsystem consistency X-MARC-Message: https://marc.info/?l=kde-devel&m=106115168710296 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_bF+P/I838XjY2bd" --Boundary-00=_bF+P/I838XjY2bd Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, the attached patch adds one non-virtual function to kcalendarsystem: weeksInYear(), which has now a QDate as Parameter, as all other query- functions (like monthsInYear(), etc.) in that class have. Therefore, you can use this class-methods in a more consistent way. If OK, please commit. Thanks. =2D --=20 Best regards/Sch=F6ne Gr=FC=DFe Martin Public key at: http://blackhole.pca.dfn.de:11371/pks/lookup?op=3Dget&search=3D0x8DFB0F86 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/P+FbHmdPoI37D4YRAmwtAKCD82DPE2OCGUabGeNpNfZB0IEvYACgzQrJ 0j3pkOvdywTmtWQkWvTFp1k=3D =3D9QUJ =2D----END PGP SIGNATURE----- --Boundary-00=_bF+P/I838XjY2bd Content-Type: text/x-diff; charset="us-ascii"; name="calsys.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="calsys.patch" Index: kcalendarsystem.cpp =================================================================== RCS file: /home/kde/kdelibs/kdecore/kcalendarsystem.cpp,v retrieving revision 1.2 diff -u -3 -p -r1.2 kcalendarsystem.cpp --- kcalendarsystem.cpp 3 Jan 2003 17:34:48 -0000 1.2 +++ kcalendarsystem.cpp 17 Aug 2003 20:06:53 -0000 @@ -50,3 +50,8 @@ const KLocale * KCalendarSystem::locale( return KGlobal::locale(); } + +int KCalendarSystem::weeksInYear(const QDate & date) const +{ + return weeksInYear(year(date)); +} Index: kcalendarsystem.h =================================================================== RCS file: /home/kde/kdelibs/kdecore/kcalendarsystem.h,v retrieving revision 1.4 diff -u -3 -p -r1.4 kcalendarsystem.h --- kcalendarsystem.h 1 Mar 2003 21:35:01 -0000 1.4 +++ kcalendarsystem.h 17 Aug 2003 20:06:54 -0000 @@ -160,9 +160,19 @@ public: virtual int daysInMonth (const QDate & date) const = 0; /** + * Gets specific calendar type number of weeks in year for a given date. + * This is the same as the method below, but has a QDate as parameter as + * all other methods here + * + * @param date Gregorian date equivalent to the specific one + * @return number of weeks in year + */ + int weeksInYear(const QDate & date) const; + + /** * Gets the number of weeks in year * - * @param year the year + * @param year the year in calendarsystem specific number * @return number of weeks in year */ virtual int weeksInYear(int year) const = 0; --Boundary-00=_bF+P/I838XjY2bd Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_bF+P/I838XjY2bd--