-rw-r--r-- | libkcal/sharpformat.cpp | 45 | ||||
-rw-r--r-- | libkcal/sharpformat.h | 2 |
2 files changed, 4 insertions, 43 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index b88e729..24b8349 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -66,3 +66,2 @@ class SharpParser : public QObject SharpParser( Calendar *calendar ) : mCalendar( calendar ) { - oldCategories = 0; } @@ -172,3 +171,3 @@ class SharpParser : public QObject QString categoryList = attList[1] ; - event->setCategories( lookupCategories( categoryList ) ); + event->setCategories( categoryList ); @@ -226,3 +225,3 @@ class SharpParser : public QObject QString categoryList = attList[1]; - todo->setCategories( lookupCategories( categoryList ) ); + todo->setCategories( categoryList ); @@ -273,7 +272,2 @@ class SharpParser : public QObject - void setCategoriesList ( QStringList * c ) - { - oldCategories = c; - } - QDateTime fromString ( QString s, bool useTz = true ) { @@ -303,37 +297,6 @@ class SharpParser : public QObject - 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<QString,QString>::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<QString,QString> mCategoriesMap; }; -QMap<QString,QString> SharpParser::mCategoriesMap; @@ -341,3 +304,3 @@ SharpFormat::SharpFormat() { - mCategories = 0; + } @@ -1020,3 +983,3 @@ bool SharpFormat::fromString2Cal( Calendar *calendar,Calendar *existingCalendar, SharpParser handler( calendar ); - handler.setCategoriesList( mCategories ); + // handler.setCategoriesList( mCategories ); while ( start > 0 ) { diff --git a/libkcal/sharpformat.h b/libkcal/sharpformat.h index 0b13862..a71177d 100644 --- a/libkcal/sharpformat.h +++ b/libkcal/sharpformat.h @@ -42,3 +42,2 @@ class SharpFormat : public QObject { bool save( Calendar * ); - void setCategoriesList ( QStringList * cat ){ mCategories = cat; } bool fromString2Cal( Calendar *, Calendar *, const QString & , const QString & ); @@ -53,3 +52,2 @@ class SharpFormat : public QObject { - QStringList *mCategories; int getNumFromRecord( QString answer,Incidence* inc ) ; |