summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-11-06 14:30:14 (UTC)
committer zautrix <zautrix>2004-11-06 14:30:14 (UTC)
commitf8841c92d5251f713eb7a025af8fdee52de45b3d (patch) (unidiff)
tree29c3c48e5da5b5ce05126da46475de1a0a845428
parent71eeea80d9c449bd1983c1a9207c7123e919b55f (diff)
downloadkdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.zip
kdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.tar.gz
kdepimpi-f8841c92d5251f713eb7a025af8fdee52de45b3d.tar.bz2
category utf8 fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp3
-rw-r--r--libkcal/sharpformat.cpp45
-rw-r--r--libkcal/sharpformat.h2
-rw-r--r--microkde/kconfig.cpp8
4 files changed, 10 insertions, 48 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f8d752a..2321087 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2305,3 +2305,4 @@ void CalendarView::manageCategories()
2305 writeSettings(); 2305 writeSettings();
2306 } 2306 } else
2307 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
2307 } else { 2308 } else {
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
66 SharpParser( Calendar *calendar ) : mCalendar( calendar ) { 66 SharpParser( Calendar *calendar ) : mCalendar( calendar ) {
67 oldCategories = 0;
68 } 67 }
@@ -172,3 +171,3 @@ class SharpParser : public QObject
172 QString categoryList = attList[1] ; 171 QString categoryList = attList[1] ;
173 event->setCategories( lookupCategories( categoryList ) ); 172 event->setCategories( categoryList );
174 173
@@ -226,3 +225,3 @@ class SharpParser : public QObject
226 QString categoryList = attList[1]; 225 QString categoryList = attList[1];
227 todo->setCategories( lookupCategories( categoryList ) ); 226 todo->setCategories( categoryList );
228 227
@@ -273,7 +272,2 @@ class SharpParser : public QObject
273 272
274 void setCategoriesList ( QStringList * c )
275 {
276 oldCategories = c;
277 }
278
279 QDateTime fromString ( QString s, bool useTz = true ) { 273 QDateTime fromString ( QString s, bool useTz = true ) {
@@ -303,37 +297,6 @@ class SharpParser : public QObject
303 297
304 QStringList lookupCategories( const QString &categoryList )
305 {
306 QStringList categoryIds = QStringList::split( ";", categoryList );
307 QStringList categories;
308 QStringList::ConstIterator it;
309 for( it = categoryIds.begin(); it != categoryIds.end(); ++it ) {
310 QString cate = category( *it );
311 if ( oldCategories ) {
312 if ( ! oldCategories->contains( cate ) )
313 oldCategories->append( cate );
314 }
315 categories.append(cate );
316 }
317 return categories;
318 }
319
320 private: 298 private:
321 Calendar *mCalendar; 299 Calendar *mCalendar;
322 QStringList * oldCategories;
323 static QString category( const QString &id )
324 {
325 QMap<QString,QString>::ConstIterator it = mCategoriesMap.find( id );
326 if ( it == mCategoriesMap.end() ) return id;
327 else return *it;
328 }
329
330 static void setCategory( const QString &id, const QString &name )
331 {
332 mCategoriesMap.insert( id, name );
333 }
334
335 static QMap<QString,QString> mCategoriesMap;
336}; 300};
337 301
338QMap<QString,QString> SharpParser::mCategoriesMap;
339 302
@@ -341,3 +304,3 @@ SharpFormat::SharpFormat()
341{ 304{
342 mCategories = 0; 305
343} 306}
@@ -1020,3 +983,3 @@ bool SharpFormat::fromString2Cal( Calendar *calendar,Calendar *existingCalendar,
1020 SharpParser handler( calendar ); 983 SharpParser handler( calendar );
1021 handler.setCategoriesList( mCategories ); 984 // handler.setCategoriesList( mCategories );
1022 while ( start > 0 ) { 985 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 {
42 bool save( Calendar * ); 42 bool save( Calendar * );
43 void setCategoriesList ( QStringList * cat ){ mCategories = cat; }
44 bool fromString2Cal( Calendar *, Calendar *, const QString & , const QString & ); 43 bool fromString2Cal( Calendar *, Calendar *, const QString & , const QString & );
@@ -53,3 +52,2 @@ class SharpFormat : public QObject {
53 52
54 QStringList *mCategories;
55 int getNumFromRecord( QString answer,Incidence* inc ) ; 53 int getNumFromRecord( QString answer,Incidence* inc ) ;
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp
index 5b685d3..862166d 100644
--- a/microkde/kconfig.cpp
+++ b/microkde/kconfig.cpp
@@ -108,3 +108,3 @@ QString KConfig::readEntry( const QString &key, const QString &def )
108 108
109 return *it; 109 return QString::fromUtf8((*it).latin1());
110} 110}
@@ -137,3 +137,3 @@ QStringList KConfig::readListEntry( const QString &key )
137 } 137 }
138 return QStringList::split(":", *it ); 138 return QStringList::split(":", QString::fromUtf8((*it).latin1()));
139 139
@@ -215,3 +215,3 @@ void KConfig::writeEntry( const QString &key, const QString &value )
215{ 215{
216 mStringMap.insert( mGroup + key, value ); 216 mStringMap.insert( mGroup + key, value.utf8() );
217 217
@@ -222,3 +222,3 @@ void KConfig::writeEntry( const QString &key, const QStringList &value )
222{ 222{
223 mStringMap.insert( mGroup + key, value.join(":") ); 223 mStringMap.insert( mGroup + key, value.join(":").utf8() );
224 224