[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim
From:       Volker Krause <vkrause () kde ! org>
Date:       2008-08-18 16:30:46
Message-ID: 1219077046.849130.19948.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 848878 by vkrause:

Merged revisions 780286-780298 via svnmerge from 
https://vkrause@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim

........
  r780286 | vkrause | 2008-02-28 18:05:09 +0100 (Thu, 28 Feb 2008) | 5 lines
  
  Try to ignore incidences in shared calendars, they are most likely
  events created by other users who got the same invitation.
  
  Kolab issue 2312
........
  r780297 | vkrause | 2008-02-28 19:09:04 +0100 (Thu, 28 Feb 2008) | 6 lines
  
  Disable calendar lookup when we have multiple active Kolab resources
  because it's impossible to determine in which one we should search for
  an already existing previous version of the current invitation.
  
  Kolab issue 2312
........
  r780298 | vkrause | 2008-02-28 19:11:56 +0100 (Thu, 28 Feb 2008) | 5 lines
  
  Always show the action links when we cannot lookup the current incidence
  in the calendar.
  
  Kolab issue 2312
........


 _M            . (directory)  
 M  +19 -2     libkcal/incidenceformatter.cpp  
 M  +21 -0     plugins/kmail/bodypartformatter/text_calendar.cpp  


** branches/KDE/3.5/kdepim #property svnmerge-integrated
   - /branches/kdepim/enterprise/kdepim:1-767022,767033,767233-767554,767556,767558-767946,76794 \
8-769318,769320-769354,769356-771105,771107-771251,771253-772311,772313-772316,772318-775194,775 \
196-775202,775204,775207-775211,775213-778001,778003-778004,778007,778010-778011,778013-778029,7 \
78031-778727,778729-779448,779450-779482,779484-779505,779507-779852,779854-779994,780211,780250 \
-780285,780287-780296,780299-780452,780454-780495,780497,780499-780529,780531-782028,782030-7831 \
27,783129-783243,783245,783248-783477,783479-784380,784382-784426,784428-784691,784693-785478,78 \
5480-785558,787827,788634,789925,790349-790352,793296,794734,800441,817568,817604,817710-818288, \
818312-819076,819078-820073,820075-821035,821037-821124,821126-821378,821380-821648,821650-82181 \
3,821815-821835,821837-822268,822270-823864,823866-824217,824219-824277,824279-824285,824287-824 \
288,824290-824805,824807-825075,825077-825083,825085-826354,826356-827491,830100,830443  + \
/branches/kdepim/enterprise/kdepim:1-767022,767033,767233-767554,767556,767558-767946,767948-769 \
318,769320-769354,769356-771105,771107-771251,771253-772311,772313-772316,772318-775194,775196-7 \
75202,775204,775207-775211,775213-778001,778003-778004,778007,778010-778011,778013-778029,778031 \
-778727,778729-779448,779450-779482,779484-779505,779507-779852,779854-779994,780211,780250-7804 \
52,780454-780495,780497,780499-780529,780531-782028,782030-783127,783129-783243,783245,783248-78 \
3477,783479-784380,784382-784426,784428-784691,784693-785478,785480-785558,787827,788634,789925, \
790349-790352,793296,794734,800441,817568,817604,817710-818288,818312-819076,819078-820073,82007 \
5-821035,821037-821124,821126-821378,821380-821648,821650-821813,821815-821835,821837-822268,822 \
270-823864,823866-824217,824219-824277,824279-824285,824287-824288,824290-824805,824807-825075,825077-825083,825085-826354,826356-827491,830100,830443
                
--- branches/KDE/3.5/kdepim/libkcal/incidenceformatter.cpp #848877:848878
@@ -1201,6 +1201,21 @@
   return res;
 }
 
+// Check if the given incidence is likely one that we own instead one from
+// a shared calendar (Kolab-specific)
+static bool incidenceOwnedByMe( Calendar* calendar, Incidence *incidence )
+{
+  CalendarResources* cal = dynamic_cast<CalendarResources*>( calendar );
+  if ( !cal || !incidence )
+    return true;
+  ResourceCalendar* res = cal->resource( incidence );
+  if ( !res )
+    return true;
+  const QString subRes = res->subresourceIdentifier( incidence );
+  if ( !subRes.contains( "/.INBOX.directory/" ) )
+    return false;
+  return true;
+}
 
 QString IncidenceFormatter::formatICalInvitation( QString invitation, Calendar *mCalendar,
     InvitationFormatterHelper *helper )
@@ -1223,10 +1238,12 @@
   Incidence* existingIncidence = 0;
   if ( helper->calendar() ) {
     existingIncidence = helper->calendar()->incidence( incBase->uid() );
+    if ( !incidenceOwnedByMe( helper->calendar(), existingIncidence ) )
+      existingIncidence = 0;
     if ( !existingIncidence ) {
       const Incidence::List list = helper->calendar()->incidences();
       for ( Incidence::List::ConstIterator it = list.begin(), end = list.end(); it != end; \
                ++it ) {
-        if ( (*it)->schedulingID() == incBase->uid() ) {
+        if ( (*it)->schedulingID() == incBase->uid() && incidenceOwnedByMe( \
helper->calendar(), *it ) ) {  existingIncidence = *it;
           break;
         }
@@ -1293,7 +1310,7 @@
         }
         html += "<td>";
 
-        if ( helper->calendar() && !existingIncidence ) {
+        if ( !existingIncidence ) {
           // Accept
           html += helper->makeLink( "accept", i18n( "[Accept]" ) );
           html += "</td><td> &nbsp; </td><td>";
--- branches/KDE/3.5/kdepim/plugins/kmail/bodypartformatter/text_calendar.cpp #848877:848878
@@ -101,6 +101,27 @@
   mCalendar = new CalendarResources( KPimPrefs::timezone() );
   mCalendar->readConfig();
   mCalendar->load();
+  bool multipleKolabResources = false;
+  CalendarResourceManager *mgr = mCalendar->resourceManager();
+  for ( CalendarResourceManager::ActiveIterator it = mgr->activeBegin(); it != \
mgr->activeEnd(); ++it ) { +    if ( (*it)->type() == "imap" || (*it)->type() == "kolab" ) {
+      const QStringList subResources = (*it)->subresources();
+      QMap<QString, int> prefixSet; // KDE4: QSet
+      for ( QStringList::ConstIterator subIt = subResources.begin(); subIt != \
subResources.end(); ++subIt ) { +        if ( !(*subIt).contains( "/.INBOX.directory/" ) )
+          // we don't care about shared folders
+          continue;
+        prefixSet.insert( (*subIt).left( (*subIt).find( "/.INBOX.directory/" ) ), 0 );
+      }
+      if ( prefixSet.count() > 1 )
+        multipleKolabResources = true;
+    }
+  }
+  if ( multipleKolabResources ) {
+    kdDebug() << k_funcinfo << "disabling calendar lookup because multiple active Kolab \
resources" << endl; +    delete mCalendar;
+    mCalendar = 0;
+  }
 }
 
 CalendarManager::~CalendarManager()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic