summaryrefslogtreecommitdiffabout
path: root/libkcal/sharpformat.cpp
authorzautrix <zautrix>2004-11-06 14:30:14 (UTC)
committer zautrix <zautrix>2004-11-06 14:30:14 (UTC)
commitf8841c92d5251f713eb7a025af8fdee52de45b3d (patch) (side-by-side diff)
tree29c3c48e5da5b5ce05126da46475de1a0a845428 /libkcal/sharpformat.cpp
parent71eeea80d9c449bd1983c1a9207c7123e919b55f (diff)
downloadkdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.zip
kdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.tar.gz
kdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.tar.bz2
category utf8 fixes
Diffstat (limited to 'libkcal/sharpformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/sharpformat.cpp45
1 files changed, 4 insertions, 41 deletions
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<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;
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;