rev 16606 - in trunk/packages/kdepim/debian: . patches

Sune Vuorela pusling-guest at alioth.debian.org
Fri Jan 15 10:41:20 UTC 2010


Author: pusling-guest
Date: 2010-01-15 10:41:19 +0000 (Fri, 15 Jan 2010)
New Revision: 16606

Added:
   trunk/packages/kdepim/debian/patches/01_slox_fix.diff
Modified:
   trunk/packages/kdepim/debian/changelog
   trunk/packages/kdepim/debian/patches/series
Log:
add a fix to slox resources. patch by Tobias Koenig

Modified: trunk/packages/kdepim/debian/changelog
===================================================================
--- trunk/packages/kdepim/debian/changelog	2010-01-15 10:21:43 UTC (rev 16605)
+++ trunk/packages/kdepim/debian/changelog	2010-01-15 10:41:19 UTC (rev 16606)
@@ -1,10 +1,14 @@
 kdepim (4:4.3.4-2) UNRELEASED; urgency=low
 
+  [ Modestas Vainius ]
   * Change my email address to modax at debian.org in Uploaders field.
   * Fix Vcs-Browser URL.
 
- -- Modestas Vainius <modax at debian.org>  Sat, 12 Dec 2009 16:57:14 +0200
+  [ Sune Vuorela ]
+  * add a fix to slox resources. patch by Tobias Koenig
 
+ -- Sune Vuorela <debian at pusling.com>  Fri, 15 Jan 2010 11:40:51 +0100
+
 kdepim (4:4.3.4-1) unstable; urgency=low
 
   * New upstream release.

Added: trunk/packages/kdepim/debian/patches/01_slox_fix.diff
===================================================================
--- trunk/packages/kdepim/debian/patches/01_slox_fix.diff	                        (rev 0)
+++ trunk/packages/kdepim/debian/patches/01_slox_fix.diff	2010-01-15 10:41:19 UTC (rev 16606)
@@ -0,0 +1,157 @@
+Patch by tokoe, taken from usptreams.
+diff --exclude debian -ruN a/kresources/slox/kcalresourceslox.cpp b/kresources/slox/kcalresourceslox.cpp
+--- a/kresources/slox/kcalresourceslox.cpp
++++ b/kresources/slox/kcalresourceslox.cpp
+@@ -334,6 +334,11 @@
+   WebdavHandler::addSloxElement( this, doc, prop, fieldName( ClientId ),
+                                  mUploadedIncidence->uid() );
+ 
++  if ( type() == "ox" ) {
++    const QString lastModified = mUploadedIncidence->customProperty( "SLOX", "LastModified" );
++    WebdavHandler::addSloxElement( this, doc, prop, fieldName( LastModified ), lastModified );
++  }
++
+   if ( mUploadIsDelete ) {
+     if ( mUploadedIncidence->type() == "Event" ) {
+       url.setPath( "/servlet/webdav.calendar/" + sloxId );
+@@ -347,6 +352,10 @@
+ 
+     if ( type() == "ox" ) {
+       WebdavHandler::addSloxElement( this, doc, prop, "method", "DELETE" );
++      if ( mUploadedIncidence->type() == "Event" )
++        WebdavHandler::addSloxElement( this, doc, prop, fieldName( FolderId ), mPrefs->calendarFolderId() );
++      else if ( mUploadedIncidence->type() == "Todo" )
++        WebdavHandler::addSloxElement( this, doc, prop, fieldName( FolderId ), mPrefs->taskFolderId() );
+     } else {
+       QDomElement remove = WebdavHandler::addElement( doc, pu, "D:remove" );
+       QDomElement prop = WebdavHandler::addElement( doc, remove, "D:prop" );
+@@ -694,6 +703,8 @@
+     parseReadRightsAttribute( e, incidence );
+   } else if ( tag == fieldName( Categories ) ) {
+     incidence->setCategories( text.split( QRegExp(",\\s*") ) );
++  } else if ( tag == fieldName( LastModified ) && type() == "ox" ) {
++    incidence->setCustomProperty( "SLOX", "LastModified", text );
+   }
+ }
+ 
+@@ -1162,6 +1173,16 @@
+           i->setUid( uid );
+           i->setCustomProperty( "SLOX", "ID", sloxId );
+ 
++          if ( type() == "ox" ) {
++            // Update the last_modified property
++            const QDomNode lastModifiedNode = prop.namedItem( fieldName( LastModified ) );
++            if ( !lastModifiedNode.isNull() ) {
++              const QDomElement lastModifiedElement = lastModifiedNode.toElement();
++              const QString lastModified = lastModifiedElement.text();
++              i->setCustomProperty( "SLOX", "LastModified", lastModified );
++            }
++          }
++
+           disableChangeNotification();
+           calendar()->deleteIncidence( mUploadedIncidence );
+           calendar()->addIncidence( i );
+diff --exclude debian -ruN a/kresources/slox/sloxbase.cpp b/kresources/slox/sloxbase.cpp
+--- a/kresources/slox/sloxbase.cpp
++++ b/kresources/slox/sloxbase.cpp
+@@ -29,6 +29,7 @@
+   {"clientid", "client_id"},
+   {"folderid", "folder_id"},
+   {"lastsync", "lastsync"},
++  {"n/a", "last_modified"},
+   {"objecttype", "objectmode"},
+   {"sloxstatus", "object_status"},
+   {"createfrom", "created_by"},
+diff --exclude debian -ruN kdepim-4.3.2/kresources/slox/sloxbase.h ../kdepim-4.3.2/kresources/slox/sloxbase.h
+--- kdepim-4.3.2/kresources/slox/sloxbase.h	2009-06-23 13:15:33.000000000 +0200
++++ ../kdepim-4.3.2/kresources/slox/sloxbase.h	2009-11-27 13:50:05.000000000 +0100
+@@ -34,6 +34,7 @@
+       ClientId,
+       FolderId,
+       LastSync,
++      LastModified,
+       ObjectType,
+       ObjectStatus,
+       CreatedBy,
+--- kdepim-4.3.2/kresources/slox/webdavhandler.h	(revision 1069984)
++++ kdepim-4.3.2/kresources/slox/webdavhandler.h	(working copy)
+@@ -50,6 +50,7 @@
+     Status status;
+     QString response;
+     QString responseDescription;
++    QString lastModified;
+ };
+ 
+ class KSLOX_EXPORT WebdavHandler
+--- kdepim-4.3.2/kresources/slox/webdavhandler.cpp	(revision 1069984)
++++ kdepim-4.3.2/kresources/slox/webdavhandler.cpp	(working copy)
+@@ -141,6 +141,12 @@
+         }
+       }
+ 
++      QDomNode lastModified = prop.namedItem( res->fieldName( SloxBase::LastModified ) );
++      if ( !lastModified.isNull() ) {
++        QDomElement lastModifiedElement = lastModified.toElement();
++        item.lastModified = lastModifiedElement.text();
++      }
++
+       QDomNode status = propstat.namedItem( "status" );
+       if ( status.isNull() ) {
+         kError() <<"Unable to find WebDAV status";
+--- kdepim-4.3.2/kresources/slox/kabcresourceslox.cpp	(revision 1069984)
++++ kdepim-4.3.2/kresources/slox/kabcresourceslox.cpp	(working copy)
+@@ -257,6 +257,7 @@
+       } else if ( item.status == SloxItem::Create ) {
+         Addressee a;
+         a.setUid( uid );
++        a.insertCustom( "SLOX", "LastModified", item.lastModified );
+ 
+         mWebdavHandler.clearSloxAttributeStatus();
+ 
+@@ -313,19 +314,19 @@
+         savingError( this, item.response + '\n' + item.responseDescription );
+         continue;
+       }
+-      if ( item.status == SloxItem::New ) {
+-        QMap<QString,Addressee>::Iterator search_res;
+-        search_res = mAddrMap.find( item.clientId );
+-        if ( search_res != mAddrMap.end() ) {
+-          // use the id provided by the server
+-          Addressee a = *search_res;
+-          mAddrMap.erase( search_res );
+-          a.setUid( "kresources_slox_kabc_" + item.sloxId );
+-          a.setResource( this );
+-          a.setChanged( false );
+-          mAddrMap.insert( a.uid(), a );
+-          saveToCache();
+-        }
++
++      QMap<QString,Addressee>::Iterator search_res;
++      search_res = mAddrMap.find( mUploadAddressee.uid() );
++      if ( search_res != mAddrMap.end() ) {
++        // use the id provided by the server
++        Addressee a = *search_res;
++        mAddrMap.erase( search_res );
++        a.setUid( "kresources_slox_kabc_" + item.sloxId );
++        a.setResource( this );
++        a.setChanged( false );
++        a.insertCustom( "SLOX", "LastModified", item.lastModified );
++        mAddrMap.insert( a.uid(), a );
++        saveToCache();
+       }
+     }
+   }
+@@ -505,9 +506,13 @@
+ 
+   if ( !isDelete ) {
+     createAddresseeFields( doc, prop, mUploadAddressee );
++    if ( !mUploadAddressee.custom( "SLOX", "LastModified" ).isEmpty() )
++      WebdavHandler::addSloxElement( this, doc, prop, fieldName( LastModified ), mUploadAddressee.custom( "SLOX", "LastModified" ) );
+   } else {
+     QString tmp_uid = mUploadAddressee.uid().remove( 0, sizeof("kresources_slox_kabc_") - 1); // remove prefix from uid
+     WebdavHandler::addSloxElement( this, doc, prop, fieldName( ObjectId ), tmp_uid );
++    WebdavHandler::addSloxElement( this, doc, prop, fieldName( FolderId ), mPrefs->folderId() );
++    WebdavHandler::addSloxElement( this, doc, prop, fieldName( LastModified ), mUploadAddressee.custom( "SLOX", "LastModified" ) );
+     WebdavHandler::addSloxElement( this, doc, prop, "method", "DELETE" );
+   }
+ 

Modified: trunk/packages/kdepim/debian/patches/series
===================================================================
--- trunk/packages/kdepim/debian/patches/series	2010-01-15 10:21:43 UTC (rev 16605)
+++ trunk/packages/kdepim/debian/patches/series	2010-01-15 10:41:19 UTC (rev 16606)
@@ -1 +1,2 @@
+01_slox_fix.diff
 30_debianize_akregator_default.diff




More information about the pkg-kde-commits mailing list