From f8841c92d5251f713eb7a025af8fdee52de45b3d Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 06 Nov 2004 14:30:14 +0000 Subject: category utf8 fixes --- (limited to 'libkcal/sharpformat.cpp') diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index b88e729..24b8349 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -64,7 +64,6 @@ class SharpParser : public QObject { public: SharpParser( Calendar *calendar ) : mCalendar( calendar ) { - oldCategories = 0; } bool startElement( Calendar *existingCalendar, const QStringList & attList, QString qName ) @@ -170,7 +169,7 @@ class SharpParser : public QObject } QString categoryList = attList[1] ; - event->setCategories( lookupCategories( categoryList ) ); + event->setCategories( categoryList ); // strange 0 semms to mean: alarm enabled if ( attList[8] == "0" ) { @@ -224,7 +223,7 @@ class SharpParser : public QObject todo->setPriority( priority ); QString categoryList = attList[1]; - todo->setCategories( lookupCategories( categoryList ) ); + todo->setCategories( categoryList ); @@ -271,11 +270,6 @@ class SharpParser : public QObject } - void setCategoriesList ( QStringList * c ) - { - oldCategories = c; - } - QDateTime fromString ( QString s, bool useTz = true ) { QDateTime dt; int y,m,t,h,min,sec; @@ -301,45 +295,14 @@ class SharpParser : public QObject return dt; } - QStringList lookupCategories( const QString &categoryList ) - { - QStringList categoryIds = QStringList::split( ";", categoryList ); - QStringList categories; - QStringList::ConstIterator it; - for( it = categoryIds.begin(); it != categoryIds.end(); ++it ) { - QString cate = category( *it ); - if ( oldCategories ) { - if ( ! oldCategories->contains( cate ) ) - oldCategories->append( cate ); - } - categories.append(cate ); - } - return categories; - } - private: Calendar *mCalendar; - QStringList * oldCategories; - static QString category( const QString &id ) - { - QMap::ConstIterator it = mCategoriesMap.find( id ); - if ( it == mCategoriesMap.end() ) return id; - else return *it; - } - - static void setCategory( const QString &id, const QString &name ) - { - mCategoriesMap.insert( id, name ); - } - - static QMap mCategoriesMap; }; -QMap SharpParser::mCategoriesMap; SharpFormat::SharpFormat() { - mCategories = 0; + } SharpFormat::~SharpFormat() @@ -1018,7 +981,7 @@ bool SharpFormat::fromString2Cal( Calendar *calendar,Calendar *existingCalendar, bool ok = true; start = end; SharpParser handler( calendar ); - handler.setCategoriesList( mCategories ); + // handler.setCategoriesList( mCategories ); while ( start > 0 ) { templist.clear(); ok = true; -- cgit v0.9.0.2