diff options
Diffstat (limited to 'libkholidays/kholidays.cpp')
-rw-r--r-- | libkholidays/kholidays.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libkholidays/kholidays.cpp b/libkholidays/kholidays.cpp index 9bb5c1013..694a32dd5 100644 --- a/libkholidays/kholidays.cpp +++ b/libkholidays/kholidays.cpp @@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qfile.h> +#include <tqfile.h> #include <kapplication.h> #include <kstandarddirs.h> #include <kdebug.h> @@ -38,31 +38,31 @@ extern "C" { extern struct holiday holidays[366]; } -QStringList KHolidays::locations() +TQStringList KHolidays::locations() { - QStringList files = + TQStringList files = KGlobal::dirs()->findAllResources( "data", "libkholidays/" + generateFileName( "*" ), false, true ); - QStringList locs; + TQStringList locs; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = files.begin(); it != files.end(); ++it ) locs.append( (*it).mid((*it).findRev('_') + 1) ); return locs; } -QString KHolidays::fileForLocation( const QString &location ) +TQString KHolidays::fileForLocation( const TQString &location ) { return locate( "data", "libkholidays/" + generateFileName( location ) ); } -QString KHolidays::userPath( bool create ) +TQString KHolidays::userPath( bool create ) { return KGlobal::dirs()->saveLocation( "data", "libkholidays/", create ); } -QString KHolidays::generateFileName( const QString &location ) +TQString KHolidays::generateFileName( const TQString &location ) { return "holiday_" + location; } @@ -70,7 +70,7 @@ QString KHolidays::generateFileName( const QString &location ) -KHolidays::KHolidays( const QString& location ) +KHolidays::KHolidays( const TQString& location ) : mLocation( location ) { mHolidayFile = fileForLocation( location ); @@ -82,20 +82,20 @@ KHolidays::~KHolidays() { } -QString KHolidays::location() const +TQString KHolidays::location() const { return mLocation; } -QString KHolidays::shortText( const QDate &date ) +TQString KHolidays::shortText( const TQDate &date ) { - QValueList<KHoliday> lst = getHolidays( date ); + TQValueList<KHoliday> lst = getHolidays( date ); if ( !lst.isEmpty() ) return lst.first().text; - else return QString::null; + else return TQString::null; } -bool KHolidays::parseFile( const QDate &date ) +bool KHolidays::parseFile( const TQDate &date ) { // kdDebug()<<"KHolidays::parseFile( date=" << date << ")"<<endl; int lastYear = 0; //current year less 1900 @@ -107,29 +107,29 @@ bool KHolidays::parseFile( const QDate &date ) // kdDebug()<<kdBacktrace(); mYearLast = date.year(); lastYear = date.year() - 1900; // silly parse_year takes 2 digit year... - parse_holidays( QFile::encodeName( mHolidayFile ), lastYear, 1 ); + parse_holidays( TQFile::encodeName( mHolidayFile ), lastYear, 1 ); } return true; } -QString KHolidays::getHoliday( const QDate &date ) +TQString KHolidays::getHoliday( const TQDate &date ) { - QValueList<KHoliday> lst = getHolidays( date ); + TQValueList<KHoliday> lst = getHolidays( date ); if ( !lst.isEmpty() ) return lst.first().text; - else return QString::null; + else return TQString::null; } -QValueList<KHoliday> KHolidays::getHolidays( const QDate &date ) +TQValueList<KHoliday> KHolidays::getHolidays( const TQDate &date ) { - QValueList<KHoliday> list; + TQValueList<KHoliday> list; if ( !parseFile( date ) ) return list; struct holiday *hd = &holidays[date.dayOfYear()-1]; while ( hd ) { if ( hd->string ) { KHoliday holiday; - holiday.text = QString::fromUtf8( hd->string ); + holiday.text = TQString::fromUtf8( hd->string ); holiday.shortText = holiday.text; holiday.Category = (hd->color == 2/*red*/) || (hd->color == 9/*weekend*/) ? HOLIDAY : WORKDAY; list.append( holiday ); @@ -139,7 +139,7 @@ QValueList<KHoliday> KHolidays::getHolidays( const QDate &date ) return list; } -int KHolidays::category( const QDate &date ) +int KHolidays::category( const TQDate &date ) { if ( !parseFile(date) ) return WORKDAY; |