-rw-r--r-- | korganizer/koeventviewer.cpp | 42 | ||||
-rw-r--r-- | korganizer/koeventviewer.h | 1 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 35 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.h | 1 |
4 files changed, 55 insertions, 24 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 44da058..135ca73 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -246,3 +246,3 @@ void KOEventViewer::appendEvent(Event *event, int mode ) if ( mode == 0 ) { - addTag("h2",event->summary()); + addTag("h2",deTag(event->summary())); } @@ -257,5 +257,5 @@ void KOEventViewer::appendEvent(Event *event, int mode ) if ( mode == 1 ) { - addTag("h2",i18n( "Local: " ) +event->summary()); + addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { - addTag("h2",i18n( "Remote: " ) +event->summary()); + addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } @@ -275,3 +275,3 @@ void KOEventViewer::appendEvent(Event *event, int mode ) addTag("b",i18n("Location: ")); - mText.append(event->location()+"<br>"); + mText.append(deTag(event->location())+"<br>"); mMailSubject += i18n(" at ") + event->location(); @@ -346,3 +346,3 @@ void KOEventViewer::appendEvent(Event *event, int mode ) addTag("p",i18n("<b>Details: </b>")); - addTag("p",event->description()); + addTag("p",deTag(event->description())); } @@ -376,3 +376,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) if (mode == 0 ) - addTag("h2",event->summary()); + addTag("h2",deTag(event->summary())); else { @@ -385,5 +385,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) if ( mode == 1 ) { - addTag("h2",i18n( "Local: " ) +event->summary()); + addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { - addTag("h2",i18n( "Remote: " ) +event->summary()); + addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } @@ -414,3 +414,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) addTag("b",i18n("Location: ")); - mText.append(event->location()+"<br>"); + mText.append(deTag(event->location())+"<br>"); mMailSubject += i18n(" at ") + event->location(); @@ -436,3 +436,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) addTag("p",i18n("<b>Details: </b>")); - addTag("p",event->description()); + addTag("p",deTag(event->description())); } @@ -449,3 +449,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) addTag("b",i18n("Parent todo:<br>")); - mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); + mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); } @@ -456,3 +456,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) for (to=Relations.first();to;to=Relations.next()) { - mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); + mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); @@ -625,3 +625,3 @@ void KOEventViewer::appendJournal(Journal *jour, int mode ) if (!jour->description().isEmpty()) { - addTag("p",jour->description()); + addTag("p",deTag(jour->description())); } @@ -641,3 +641,2 @@ void KOEventViewer::setSyncMode( bool b ) - void KOEventViewer::setTodo(Todo *event, bool clearV ) @@ -695,2 +694,17 @@ void KOEventViewer::addText(QString text) } +QString KOEventViewer::deTag(QString text) +{ +#if QT_VERSION >= 0x030000 + text.replace( '<' , "<" ); + text.replace( '>' , ">" ); +#else + if ( text.find ('<') > 0 ) { + text.replace( QRegExp("<") , "<" ); + } + if ( text.find ('>') > 0 ) { + text.replace( QRegExp(">") , ">" ); + } +#endif + return text; +} void KOEventViewer::keyPressEvent ( QKeyEvent * e ) diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 2d4a08e..47cc5e9 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h @@ -67,2 +67,3 @@ class KOEventViewer : public QTextBrowser { bool mSyncMode; + QString deTag(QString text); diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index 1751ae3..57a9ede 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -53,3 +53,3 @@ void KIncidenceFormatter::setEvent(Event *event) if ( mode == 0 ) { - addTag("h3",event->summary()); + addTag("h3",deTag(event->summary())); } @@ -64,5 +64,5 @@ void KIncidenceFormatter::setEvent(Event *event) if ( mode == 1 ) { - addTag("h2",i18n( "Local: " ) +event->summary()); + addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { - addTag("h2",i18n( "Remote: " ) +event->summary()); + addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } @@ -80,3 +80,3 @@ void KIncidenceFormatter::setEvent(Event *event) addTag("b",i18n("Location: ")); - mText.append(event->location()+"<br>"); + mText.append(deTag(event->location())+"<br>"); } @@ -146,3 +146,3 @@ void KIncidenceFormatter::setEvent(Event *event) addTag("p",i18n("<b>Details: </b>")); - addTag("p",event->description()); + addTag("p",deTag(event->description())); } @@ -172,3 +172,3 @@ void KIncidenceFormatter::setTodo(Todo *event ) if (mode == 0 ) - addTag("h3",event->summary()); + addTag("h3",deTag(event->summary())); else { @@ -181,5 +181,5 @@ void KIncidenceFormatter::setTodo(Todo *event ) if ( mode == 1 ) { - addTag("h2",i18n( "Local: " ) +event->summary()); + addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { - addTag("h2",i18n( "Remote: " ) +event->summary()); + addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } @@ -206,3 +206,3 @@ void KIncidenceFormatter::setTodo(Todo *event ) addTag("b",i18n("Location: ")); - mText.append(event->location()+"<br>"); + mText.append(deTag(event->location())+"<br>"); } @@ -231,3 +231,3 @@ void KIncidenceFormatter::setTodo(Todo *event ) addTag("p",i18n("<b>Details: </b>")); - addTag("p",event->description()); + addTag("p",deTag(event->description())); } @@ -378 +378,16 @@ void KIncidenceFormatter::formatReadOnly(Incidence *event) } +QString KIncidenceFormatter::deTag(QString text) +{ +#if QT_VERSION >= 0x030000 + text.replace( '<' , "<" ); + text.replace( '>' , ">" ); +#else + if ( text.find ('<') > 0 ) { + text.replace( QRegExp("<") , "<" ); + } + if ( text.find ('>') > 0 ) { + text.replace( QRegExp(">") , ">" ); + } +#endif + return text; +} diff --git a/libkcal/kincidenceformatter.h b/libkcal/kincidenceformatter.h index 068e6d2..b5603e0 100644 --- a/libkcal/kincidenceformatter.h +++ b/libkcal/kincidenceformatter.h @@ -34,2 +34,3 @@ class KIncidenceFormatter : public QObject private: + QString deTag(QString text); bool mSyncMode; |