From 3c0edb4b4c4a77b334331749dfde776911c3a3a0 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 29 Oct 2004 21:05:07 +0000 Subject: KO WN view fix --- diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 028d3bb..eec0f1f 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -324,7 +324,8 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) break; } } - if ( isSubSet && ! found ) + // if ( isSubSet && ! found ) + if ( ! found ) // LR try this one... mData->phoneNumbers.append( *phoneItAD ); } if ( isSubSet ) { diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 3d82553..abb3b3b 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp @@ -89,24 +89,19 @@ void PhoneNumber::simplifyType() } bool PhoneNumber::contains( const PhoneNumber &p ) { - QString Number; - QString Num; - uint i; - Number = mNumber.stripWhiteSpace (); - Num = ""; - for ( i = 0; i < Number.length(); ++i) { - if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) - Num += Number.at(i); - } - QString NumberR; - QString NumR; - NumberR = p.mNumber.stripWhiteSpace (); - NumR = ""; - for ( i = 0; i < NumberR.length(); ++i) { - if ( NumberR.at(i).isDigit() || NumberR.at(i) == '+'|| NumberR.at(i) == '*'|| NumberR.at(i) == '#' ) - NumR += NumberR.at(i); - } - return (Num == NumR); + PhoneNumber myself; + PhoneNumber other; + myself = *this; + other = p; + myself.simplifyNumber(); + other.simplifyNumber(); + if ( myself.number() != other.number ()) + return false; + myself.simplifyType(); + other.simplifyType(); + if ( myself.type() == other.type()) + return true; + return false; } void PhoneNumber::setId( const QString &id ) diff --git a/kabc/plugins/ldap/ldapE.pro b/kabc/plugins/ldap/ldapE.pro index df3c94c..57b6f84 100644 --- a/kabc/plugins/ldap/ldapE.pro +++ b/kabc/plugins/ldap/ldapE.pro @@ -7,7 +7,7 @@ INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kde OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib -LIBS += -lmicrokde -lkamicrokabc +LIBS += -lmicrokde -lmicrokabc LIBS += -L$(QPEDIR)/lib INTERFACES = \ diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index aa33588..2f7409d 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -70,10 +70,6 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); QStyleSheet* stsh = mView->styleSheet(); QStyleSheetItem * style ; - style = stsh->item ("a" ); - if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); - } style = stsh->item ("h2" ); if ( style ) { style->setMargin(QStyleSheetItem::MarginAll,0); @@ -82,10 +78,6 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, if ( style ) { style->setMargin(QStyleSheetItem::MarginAll,0); } - style = stsh->item ("table" ); - if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); - } mEventViewer = 0; QBoxLayout *topLayout = new QVBoxLayout(this); @@ -161,7 +153,7 @@ void KOWhatsNextView::updateView() QString ipath;// = new QString(); // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); //" + date + "\n"; - mText = "\n"; + mText = "
\n"; //mText += "

"; #ifdef DESKTOP_VERSION mText += "

"; @@ -216,14 +208,18 @@ void KOWhatsNextView::updateView() //mText += "\">"; if ( ! itemAdded ) { appendDay ( iii, mEventDate ); - itemAdded = true; } + // for first day (iii == 0) + // we may have syncevents, or events in the past, which maybe should nor be diaplayed + // for that reason we cannot append in appendDay () for iii == 0 + // we must append it in the first successful call of appendEvent() Event *ev = events.first(); while(ev) { //qDebug("+++++event append %s", ev->summary().latin1()); if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { - appendEvent(ev, false , iii!= 0 ); + if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) + itemAdded = true; } ev = events.next(); } @@ -242,14 +238,14 @@ void KOWhatsNextView::updateView() } todo = todos.next(); } - if ( !itemAdded && iii == 0 ) { + if ( !itemAdded && iii == 0 ) { // appendDay ( iii, mEventDate ); //mText += "
"; // mText += ""+i18n("No event, nothing to do.") +"\n"; mText += "

"+i18n("No event, nothing to do. ") +"

\n"; //mText +="
"; } - if ( itemAdded ) + if ( itemAdded ) mText += "

\n"; mEventDate = mEventDate.addDays( 1 ); } @@ -343,7 +339,7 @@ void KOWhatsNextView::updateView() if (replys > 0 ) mText += "\n"; - mText += "\n
\n"; + mText += "\n\n"; mView->setText(mText); mView->setFocus(); @@ -357,7 +353,7 @@ void KOWhatsNextView::updateView() // test->show(); // mView->setBackgroundMode(FixedPixmap ); // mView->setBackgroundPixmap ( bPix ); - // qDebug("%s ",mText.latin1()); + qDebug("%s ",mText.latin1()); } void KOWhatsNextView::appendDay( int i, QDate eventDate ) @@ -366,7 +362,7 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { if ( i == 0 ) { - mText += "\n"; + //mText += "
\n"; return;//date = "" + day+""; } else if ( i == 1 ) @@ -380,7 +376,7 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) } else { if ( i == 0 ) { - mText += "
\n"; + //mText += "
\n"; return;// date = "" +i18n("Today: ") +"" + day+""; } @@ -430,18 +426,21 @@ void KOWhatsNextView::changeEventDisplay(Event *, int action) } } -void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) +bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) { if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) - return; + return false; QDateTime cdt = QDateTime::currentDateTime(); QDateTime noc; QString tempText; + if ( appendTable && !notRed ) { + tempText = "
"; + } bool ok = true; if ( reply ) { noc = ev->getNextOccurence( cdt, &ok ); if (! ok && ev->type() == "Event") - return; + return false; } tempText += "\n"; mText += tempText; + return true; } bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index 1118bdd..9049268 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h @@ -70,7 +70,7 @@ class KOWhatsNextView : public KOrg::BaseView void changeEventDisplay(Event *, int); protected: - void appendEvent(Incidence *, bool reply=false, bool notRed = true); + bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false); bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); void appendDay( int i, QDate date ); QDate mEventDate; -- cgit v0.9.0.2
"; if (ev->type()=="Event") { @@ -486,7 +485,7 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) else { if ( end < cdt ) { if ( !KOPrefs::instance()->mWNViewShowsPast ) - return; + return false; tempText += "" + dateText + ""; } else if ( st < cdt ) @@ -575,6 +574,7 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) tempText += " ["+ev->relatedTo()->summary() +"]"; tempText += "