[Kde-bindings] KDE/kdepimlibs/kholidays
John Layt
john at layt.net
Tue Jun 1 08:58:19 UTC 2010
SVN commit 1133219 by jlayt:
BIC / API change to KHolidays (sorry, missed BIC Monday, couldn't wait)
Change regions() to regionCodes() to be clearer and keep regions() for a future
method returning a list of HolidayRegion objects.
CCMAIL: kde-bindings at kde.org
M +5 -5 holidayregion.cpp
M +1 -1 holidayregion.h
M +7 -7 tests/testholidayregion.cpp
--- trunk/KDE/kdepimlibs/kholidays/holidayregion.cpp #1133218:1133219
@@ -144,19 +144,19 @@
return d->mLocation;
}
-QStringList HolidayRegion::regions()
+QStringList HolidayRegion::regionCodes()
{
const QStringList files =
KGlobal::dirs()->findAllResources( "data", "libkholidays/plan2/holiday_*",
KStandardDirs::NoDuplicates );
- QStringList regions;
+ QStringList regionCodesList;
foreach ( const QString &filename, files ) {
- regions.append( filename.mid( filename.lastIndexOf( "holiday_" ) + 8 ) );
+ regionCodesList.append( filename.mid( filename.lastIndexOf( "holiday_" ) + 8 ) );
}
- qSort( regions );
- return regions;
+ qSort( regionCodesList );
+ return regionCodesList;
}
QString HolidayRegion::regionCode() const
--- trunk/KDE/kdepimlibs/kholidays/holidayregion.h #1133218:1133219
@@ -105,7 +105,7 @@
* @see name()
* @see languageCode()
*/
- static QStringList regions();
+ static QStringList regionCodes();
/**
* @since 4.5
--- trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.cpp #1133218:1133219
@@ -135,19 +135,19 @@
void HolidayRegionTest::testRegions()
{
- kDebug() << "Available regions:";
- QStringList regions = KHolidays::HolidayRegion::regions();
- foreach ( const QString ®ionCode, regions ) {
+ kDebug() << "Available region codes:";
+ QStringList regionCodes = KHolidays::HolidayRegion::regionCodes();
+ foreach ( const QString ®ionCode, regionCodes ) {
KHolidays::HolidayRegion testRegion( regionCode );
kDebug() << regionCode << " = " << testRegion.name();
}
kDebug() << "";
kDebug() << "This years holidays:";
- foreach ( const QString ®ionCode, regions ) {
- KHolidays::HolidayRegion region( regionCode );
- printMetadata( region );
- parseRegionCalendarYear( region, QDate::currentDate().year() );
+ foreach ( const QString ®ionCode, regionCodes ) {
+ KHolidays::HolidayRegion testRegion( regionCode );
+ printMetadata( testRegion );
+ parseRegionCalendarYear( testRegion, QDate::currentDate().year() );
kDebug() << "";
}
kDebug() << "";
More information about the Kde-bindings
mailing list