Version: (using KDE KDE 3.5.5) Installed from: Gentoo Packages Compiler: GCC 4.1.1 stable gentoo OS: Linux I have configured two resources in korganizer one regular local calendar and one exchange calendar. When I receive invites to meetings via email and press the accept button I get to choose which of the two resources the event should be saved to. If I select the local calendar the event is saved fine with the correct reminder. But if I instead select the exchange calendar the event is still saved but the type of the reminder of the event is set to "Unknown" which results in that I get no reminder at all.
Unfortunately, the problem is bigger than just the missing setting for the alarm type. The reminder process (icon in system tray) fetches alarms from a cache that is never updated. I am not a kde programmer, but the patch I attached works for me. It fetches all events since the last check and doesnt use the cache. I also attached a one-liner to set the alarm type to "display", also it is not neccessary if you just want to be reminded.
Created attachment 18903 [details] fixes missing reminders for events in an exchange resource When alarms are queried from an exchange resource, events will be fetched from the server. Previously, they were returned from the (always empty) cache.
Created attachment 18904 [details] one-liner to set alarm type of events fetched from an exchange server
What do I need to do to get these patches accepted into SVN?
SVN commit 614667 by winterz: Fix for "Reminders from outlook invites are set to unknown in exchange resources" Patch from Uli. Thanks! Approved by Reinhold. BUGS: 136954 M +20 -2 resourceexchange.cpp --- branches/KDE/3.5/kdepim/kresources/exchange/resourceexchange.cpp #614666:614667 @@ -403,12 +403,30 @@ return list; } +/* Invoked by korgac when checking alarms. Always updates the cache. */ Alarm::List ResourceExchange::alarms( const QDateTime &from, const QDateTime &to ) { kdDebug(5800) << "ResourceExchange::alarms(" << from.toString() << " - " << to.toString() << ")\n"; Alarm::List list; - if ( mCache ) - list = mCache->alarms( from, to ); + + QDate start = from.date(); + QDate end = to.date(); + + if ( mCache ) { + + /* Clear the cache */ + Event::List oldEvents = mCache->rawEvents( start, end, false ); + + Event::List::ConstIterator it; + for( it = oldEvents.begin(); it != oldEvents.end(); ++it ) { + mCache->deleteEvent( *it ); + } + + /* Fetch events */ + mClient->downloadSynchronous( mCache, start, end, false ); + + list = mCache->alarms( from, to ); + } return list; }
SVN commit 614668 by winterz: forgot this as part of the fix for the exhange alarms. CCBUGS: 136954 M +18 -17 exchangedownload.cpp --- branches/KDE/3.5/kdepim/libkpimexchange/core/exchangedownload.cpp #614667:614668 @@ -91,7 +91,7 @@ //kdDebug() << "Creating progress dialog" << endl; mProgress = new ExchangeProgress(); mProgress->show(); - + connect( this, SIGNAL( startDownload() ), mProgress, SLOT( slotTransferStarted() ) ); connect( this, SIGNAL(finishDownload() ), mProgress, @@ -100,7 +100,7 @@ } QString sql = dateSelectQuery( start, end.addDays( 1 ) ); - + kdDebug() << "Exchange download query: " << endl << sql << endl; increaseDownloads(); @@ -125,13 +125,13 @@ //kdDebug() << "Creating progress dialog" << endl; mProgress = new ExchangeProgress(); mProgress->show(); - + connect( this, SIGNAL(startDownload()), mProgress, SLOT(slotTransferStarted()) ); connect( this, SIGNAL(finishDownload()), mProgress, SLOT(slotTransferFinished()) ); } QString sql = dateSelectQuery( start, end.addDays( 1 ) ); - + increaseDownloads(); KIO::DavJob *job = KIO::davSearch( mAccount->calendarURL(), "DAV:", "sql", sql, false ); @@ -148,7 +148,7 @@ startString.sprintf("%04i/%02i/%02i",start.year(),start.month(),start.day()); QString endString; endString.sprintf("%04i/%02i/%02i",end.year(),end.month(),end.day()); - QString sql = + QString sql = "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\", \"urn:schemas:calendar:uid\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" "WHERE \"urn:schemas:calendar:dtend\" > '" + startString + "'\r\n" @@ -166,7 +166,7 @@ QString endString; endString.sprintf( "%04i-%02i-%02iT23:59:59Z", end.year(), end.month(), end.day() ); - QString sql = + QString sql = "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\", " "\"urn:schemas:calendar:uid\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" @@ -193,7 +193,7 @@ kdDebug() << "Search result: " << endl << response.toString() << endl; handleAppointments( response, true ); - + decreaseDownloads(); } @@ -210,7 +210,7 @@ kdDebug() << "Search (master) result: " << endl << response.toString() << endl; handleAppointments( response, false ); - + decreaseDownloads(); } @@ -231,7 +231,7 @@ item = item.nextSibling().toElement() ) { //kdDebug() << "Current item:" << item.tagName() << endl; QDomNodeList propstats = item.elementsByTagNameNS( "DAV:", "propstat" ); - // kdDebug() << "Item has " << propstats.count() << " propstat children" << endl; + // kdDebug() << "Item has " << propstats.count() << " propstat children" << endl; for( uint i=0; i < propstats.count(); i++ ) { QDomElement propstat = propstats.item(i).toElement(); QDomElement prop = propstat.namedItem( "prop" ).toElement(); @@ -247,7 +247,7 @@ } int instanceType = instancetypeElement.text().toInt(); //kdDebug() << "Instance type: " << instanceType << endl; - + if ( recurrence && instanceType > 0 ) { QDomElement uidElement = prop.namedItem( "uid" ).toElement(); if ( uidElement.isNull() ) { @@ -286,7 +286,7 @@ void ExchangeDownload::handleRecurrence( QString uid ) { // kdDebug() << "Handling recurrence info for uid=" << uid << endl; - QString query = + QString query = "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\"\r\n" "FROM Scope('shallow traversal of \"\"')\r\n" "WHERE \"urn:schemas:calendar:uid\" = '" + uid + "'\r\n" @@ -333,7 +333,7 @@ addElement( doc, prop, "urn:schemas:calendar:", "exdate" ); addElement( doc, prop, "urn:schemas:mailheader:", "sensitivity" ); addElement( doc, prop, "urn:schemas:calendar:", "reminderoffset" ); - + addElement( doc, prop, "urn:schemas-microsoft-com:office:office", "Keywords" ); @@ -357,7 +357,7 @@ { kdDebug() << "slotPropFindResult" << endl; - int error = job->error(); + int error = job->error(); if ( error ) { job->showErrorDialog( 0 ); finishUp( ExchangeClient::CommunicationError, job ); @@ -370,7 +370,7 @@ QDomElement prop = response.documentElement().namedItem( "response" ) .namedItem( "propstat" ).namedItem( "prop" ).toElement(); - + KCal::Event* event = new KCal::Event(); QDomElement uidElement = prop.namedItem( "uid" ).toElement(); @@ -485,7 +485,7 @@ QString rrule = prop.namedItem( "rrule" ).toElement().text(); kdDebug() << "Got rrule: " << rrule << endl; if ( !rrule.isEmpty() ) { - // Timezone should be handled automatically + // Timezone should be handled automatically // because we used mFormat->setTimeZone() earlier KCal::RecurrenceRule *rr = event->recurrence()->defaultRRule( true ); @@ -522,7 +522,7 @@ // 2 Private // 3 Company Confidential QString sensitivity = prop.namedItem( "sensitivity" ).toElement().text(); - if ( ! sensitivity.isNull() ) + if ( ! sensitivity.isNull() ) switch( sensitivity.toInt() ) { case 0: event->setSecrecy( KCal::Incidence::SecrecyPublic ); break; case 1: event->setSecrecy( KCal::Incidence::SecrecyPrivate ); break; @@ -540,6 +540,7 @@ KCal::Duration offset( - reminder.toInt() ); KCal::Alarm *alarm = event->newAlarm(); alarm->setStartOffset( offset ); + alarm->setDisplayAlarm(""); alarm->setEnabled( true ); // TODO: multiple alarms; alarm->setType( KCal::Alarm::xxxx ); } @@ -555,7 +556,7 @@ /** set the list of attachments/associated files for this event */ //void setAttachments(const QStringList &attachments); - + /** set resources used, such as Office, Car, etc. */ //void setResources(const QStringList &resources);