summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp5
-rw-r--r--korganizer/koeventviewer.cpp4
-rw-r--r--libkcal/kincidenceformatter.cpp4
3 files changed, 7 insertions, 6 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 493382d..a776cb6 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -154,103 +154,104 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
QString text;
int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
if (event->isMultiDay()) {
QString prefix = "<->";multiday = 2;
QString time;
if ( event->doesRecur() ) {
if ( event->recursOn( mDate) ) {
prefix ="->" ;multiday = 1;
}
else {
int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
if ( event->recursOn( mDate.addDays( -days)) ) {
prefix ="<-" ;multiday = 3;
}
}
} else {
if (mDate == event->dtStart().date()) {
prefix ="->" ;multiday = 1;
} else if (mDate == event->dtEnd().date()) {
prefix ="<-" ;multiday = 3;
}
}
if ( !event->doesFloat() ) {
if ( mDate == event->dtStart().date () )
time = KGlobal::locale()->formatTime(event->dtStart().time())+" ";
else if ( mDate == event->dtEnd().date () )
time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
}
text = time + event->summary();
mToolTipText += prefix + text;
} else {
if (event->doesFloat()) {
text = event->summary();
mToolTipText += text;
}
else {
text = KGlobal::locale()->formatTime(event->dtStart().time());
text += " " + event->summary();
mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
}
}
if ( !event->location().isEmpty() )
mToolTipText += " (" + event->location() + ")";
#if QT_VERSION >= 0x030000
mToolTipText.replace( '<' , "&lt;" );
mToolTipText.replace( '>' , "&gt;" );
#else
- if ( mToolTipText.find ('<') > 0 ) {
+ if ( mToolTipText.find ('<') >= 0 ) {
mToolTipText.replace( QRegExp("<") , "&lt;" );
}
- if ( mToolTipText.find ('>') > 0 ) {
+ if ( mToolTipText.find ('>') >= 0 ) {
mToolTipText.replace( QRegExp(">") , "&gt;" );
}
#endif
+ //qDebug("TTT: %s ", mToolTipText.latin1());
mToolTip.append( mToolTipText );
}
mToolTip.sort();
return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>");
}
void KODayMatrix::setCalendar( Calendar *cal )
{
mCalendar = cal;
setAcceptDrops( mCalendar );
updateEvents();
}
QColor KODayMatrix::getShadedColor(QColor color)
{
QColor shaded;
int h=0;
int s=0;
int v=0;
color.hsv(&h,&s,&v);
s = s/4;
v = 192+v/4;
shaded.setHsv(h,s,v);
return shaded;
}
KODayMatrix::~KODayMatrix()
{
// delete mKODaymatrixWhatsThis;
delete [] days;
delete [] daylbls;
delete [] events;
delete mToolTip;
}
/*
void KODayMatrix::setStartDate(QDate start)
{
updateView(start);
}
*/
void KODayMatrix::addSelectedDaysTo(DateList& selDays)
{
if (mSelStart == NOSELECTION) {
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 135ca73..1508638 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -653,69 +653,69 @@ void KOEventViewer::setTodo(Todo *event, bool clearV )
}
void KOEventViewer::setJournal(Journal *event, bool clearV )
{
if ( clearV )
clearEvents();
if ( mSyncMode ) {
if ( clearV )
appendJournal(event, 1);
else
appendJournal(event, 2);
} else
appendJournal(event);
}
void KOEventViewer::setEvent(Event *event)
{
clearEvents();
if ( mSyncMode )
appendEvent(event, 1);
else
appendEvent(event);
}
void KOEventViewer::addEvent(Event *event)
{
if ( mSyncMode )
appendEvent(event, 2);
else
appendEvent(event);
}
void KOEventViewer::clearEvents(bool now)
{
mText = "";
if (now) setText(mText);
}
void KOEventViewer::addText(QString text)
{
mText.append(text);
setText(mText);
}
QString KOEventViewer::deTag(QString text)
{
#if QT_VERSION >= 0x030000
text.replace( '<' , "&lt;" );
text.replace( '>' , "&gt;" );
#else
- if ( text.find ('<') > 0 ) {
+ if ( text.find ('<') >= 0 ) {
text.replace( QRegExp("<") , "&lt;" );
}
- if ( text.find ('>') > 0 ) {
+ if ( text.find ('>') >= 0 ) {
text.replace( QRegExp(">") , "&gt;" );
}
#endif
return text;
}
void KOEventViewer::keyPressEvent ( QKeyEvent * e )
{
switch ( e->key() ) {
case Qt::Key_Return:
case Qt::Key_Enter :
e->ignore();
break;
default:
QTextBrowser::keyPressEvent ( e );
break;
}
}
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 57a9ede..e506a96 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -337,57 +337,57 @@ void KIncidenceFormatter::formatAttendees(Incidence *event)
mText.append(a->email());
mText += "\n";
}
} else {
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
}
#else
//qDebug("nokabc ");
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#endif
if (!a->email().isEmpty()) {
if (iconPath) {
mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">";
if ( a->RSVP() )
mText += "<IMG src=\"" + iconPath + "\">";
else
mText += "<IMG src=\"" + NOiconPath + "\">";
mText += "</a>\n";
}
}
if (a->status() != Attendee::NeedsAction )
mText +="[" + a->statusStr() + "] ";
if (a->role() == Attendee::Chair )
mText +="(" + a->roleStr().left(1) + ".)";
}
mText.append("</li></ul>");
}
}
void KIncidenceFormatter::formatReadOnly(Incidence *event)
{
if (event->isReadOnly()) {
addTag("p","<em>(" + i18n("read-only") + ")</em>");
}
}
QString KIncidenceFormatter::deTag(QString text)
{
#if QT_VERSION >= 0x030000
text.replace( '<' , "&lt;" );
text.replace( '>' , "&gt;" );
#else
- if ( text.find ('<') > 0 ) {
+ if ( text.find ('<') >= 0 ) {
text.replace( QRegExp("<") , "&lt;" );
}
- if ( text.find ('>') > 0 ) {
+ if ( text.find ('>') >= 0 ) {
text.replace( QRegExp(">") , "&gt;" );
}
#endif
return text;
}