summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show 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
@@ -2304,5 +2304,6 @@ void CalendarView::manageCategories()
topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
writeSettings();
- }
+ } else
+ topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
} else {
removeCategories();
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index b88e729..24b8349 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -65,5 +65,4 @@ class SharpParser : public QObject
public:
SharpParser( Calendar *calendar ) : mCalendar( calendar ) {
- oldCategories = 0;
}
@@ -171,5 +170,5 @@ class SharpParser : public QObject
QString categoryList = attList[1] ;
- event->setCategories( lookupCategories( categoryList ) );
+ event->setCategories( categoryList );
// strange 0 semms to mean: alarm enabled
@@ -225,5 +224,5 @@ class SharpParser : public QObject
QString categoryList = attList[1];
- todo->setCategories( lookupCategories( categoryList ) );
+ todo->setCategories( categoryList );
@@ -272,9 +271,4 @@ class SharpParser : public QObject
- void setCategoriesList ( QStringList * c )
- {
- oldCategories = c;
- }
-
QDateTime fromString ( QString s, bool useTz = true ) {
QDateTime dt;
@@ -302,43 +296,12 @@ 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;
SharpFormat::SharpFormat()
{
- mCategories = 0;
+
}
@@ -1019,5 +982,5 @@ bool SharpFormat::fromString2Cal( Calendar *calendar,Calendar *existingCalendar,
start = end;
SharpParser handler( calendar );
- handler.setCategoriesList( mCategories );
+ // handler.setCategoriesList( mCategories );
while ( start > 0 ) {
templist.clear();
diff --git a/libkcal/sharpformat.h b/libkcal/sharpformat.h
index 0b13862..a71177d 100644
--- a/libkcal/sharpformat.h
+++ b/libkcal/sharpformat.h
@@ -41,5 +41,4 @@ class SharpFormat : public QObject {
bool load( Calendar * ,Calendar *);
bool save( Calendar * );
- void setCategoriesList ( QStringList * cat ){ mCategories = cat; }
bool fromString2Cal( Calendar *, Calendar *, const QString & , const QString & );
bool fromString( Calendar *, const QString & );
@@ -52,5 +51,4 @@ class SharpFormat : public QObject {
QString dtToString( const QDateTime& dt, bool useTZ = true );
- QStringList *mCategories;
int getNumFromRecord( QString answer,Incidence* inc ) ;
QString getPart( const QString & text, bool &ok, int &start );
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp
index 5b685d3..862166d 100644
--- a/microkde/kconfig.cpp
+++ b/microkde/kconfig.cpp
@@ -107,5 +107,5 @@ QString KConfig::readEntry( const QString &key, const QString &def )
}
- return *it;
+ return QString::fromUtf8((*it).latin1());
}
@@ -136,5 +136,5 @@ QStringList KConfig::readListEntry( const QString &key )
return QStringList();
}
- return QStringList::split(":", *it );
+ return QStringList::split(":", QString::fromUtf8((*it).latin1()));
}
@@ -214,5 +214,5 @@ void KConfig::writeEntry( const QString & key , int num )
void KConfig::writeEntry( const QString &key, const QString &value )
{
- mStringMap.insert( mGroup + key, value );
+ mStringMap.insert( mGroup + key, value.utf8() );
mDirty = true;
@@ -221,5 +221,5 @@ void KConfig::writeEntry( const QString &key, const QString &value )
void KConfig::writeEntry( const QString &key, const QStringList &value )
{
- mStringMap.insert( mGroup + key, value.join(":") );
+ mStringMap.insert( mGroup + key, value.join(":").utf8() );
mDirty = true;