Hello community,

here is the log from the commit of package kdepim4-runtime for openSUSE:Factory 
checked in at 2013-10-04 10:25:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdepim4-runtime (Old)
 and      /work/SRC/openSUSE:Factory/.kdepim4-runtime.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdepim4-runtime"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdepim4-runtime/kdepim4-runtime.changes  
2013-10-03 15:55:01.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kdepim4-runtime.new/kdepim4-runtime.changes     
2013-10-04 10:25:41.000000000 +0200
@@ -1,0 +2,7 @@
+Thu Oct  3 22:09:22 UTC 2013 - [email protected]
+
+- Added two patches from upstream:
+  0001-Don-t-bother-IMAP-servers-with-not-supported-flags.patch (kde#278082)
+  0002-Disconnect-session-pool-manually-in-ImapResource-des.patch (kde#325443)
+
+-------------------------------------------------------------------

New:
----
  0001-Don-t-bother-IMAP-servers-with-not-supported-flags.patch
  0002-Disconnect-session-pool-manually-in-ImapResource-des.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdepim4-runtime.spec ++++++
--- /var/tmp/diff_new_pack.b5i9jJ/_old  2013-10-04 10:25:41.000000000 +0200
+++ /var/tmp/diff_new_pack.b5i9jJ/_new  2013-10-04 10:25:41.000000000 +0200
@@ -26,6 +26,10 @@
 Source0:        kdepim-runtime-%{version}.tar.xz
 Source1:        akonadi.png
 Patch1:         disable-knut.diff
+# PATCH-FIX-UPSTREAM 
0001-Don-t-bother-IMAP-servers-with-not-supported-flags.patch -- kde#278082
+Patch1000:      0001-Don-t-bother-IMAP-servers-with-not-supported-flags.patch
+# PATCH-FIX-UPSTREAM 
0002-Disconnect-session-pool-manually-in-ImapResource-des.patch -- kde#325443
+Patch1001:      0002-Disconnect-session-pool-manually-in-ImapResource-des.patch
 BuildRequires:  fdupes
 BuildRequires:  libkdepimlibs4-devel >= %{version}
 BuildRequires:  libkfbapi-devel
@@ -51,6 +55,8 @@
 %prep
 %setup -q -n kdepim-runtime-%{version}
 %patch1
+%patch1000 -p1
+%patch1001 -p1
 
 %build
 %ifarch ppc64

++++++ 0001-Don-t-bother-IMAP-servers-with-not-supported-flags.patch ++++++
>From c561149538336804f212f5a12ea6cf3d1a3a19f5 Mon Sep 17 00:00:00 2001
From: Andre Woebbeking <[email protected]>
Date: Fri, 27 Sep 2013 22:19:42 +0200
Subject: [PATCH 1/2] Don't bother IMAP servers with not supported flags

Created a new method ResourceTask::fromAkonadiToSupportedImapFlags() to convert
Akonadi to IMAP flags supported by the server and use it everywhere instead of
fromAkonadiFlags().

fromAkonadiFlags() was made private to make it impossible to call it by 
accident.

BUG:278082
FIXED-IN: 4.11.3
REVIEW:112724

CCBUG:287356

This also reduces the risk to trigger 287356 as the insert on the IMAP server
doesn't fail due to unsupported IMAP flags.
---
 resources/imap/additemtask.cpp          |  2 +-
 resources/imap/changeitemsflagstask.cpp |  4 ++--
 resources/imap/changeitemtask.cpp       | 17 ++---------------
 resources/imap/resourcetask.cpp         | 21 +++++++++++++++++++++
 resources/imap/resourcetask.h           |  5 +++++
 5 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/resources/imap/additemtask.cpp b/resources/imap/additemtask.cpp
index da965a1..af427ff 100644
--- a/resources/imap/additemtask.cpp
+++ b/resources/imap/additemtask.cpp
@@ -64,7 +64,7 @@ void AddItemTask::doStart( KIMAP::Session *session )
   KIMAP::AppendJob *job = new KIMAP::AppendJob( session );
   job->setMailBox( mailBox );
   job->setContent( msg->encodedContent( true ) );
-  job->setFlags( fromAkonadiFlags( item().flags().toList() ) );
+  job->setFlags( fromAkonadiToSupportedImapFlags( item().flags().toList() ) );
   connect( job, SIGNAL(result(KJob*)), SLOT(onAppendMessageDone(KJob*)) );
   job->start();
 }
diff --git a/resources/imap/changeitemsflagstask.cpp 
b/resources/imap/changeitemsflagstask.cpp
index 1c7f415..d7eb183 100644
--- a/resources/imap/changeitemsflagstask.cpp
+++ b/resources/imap/changeitemsflagstask.cpp
@@ -91,7 +91,7 @@ KIMAP::StoreJob* ChangeItemsFlagsTask::prepareJob( 
KIMAP::Session *session )
 void ChangeItemsFlagsTask::triggerAppendFlagsJob(KIMAP::Session* session)
 {
   KIMAP::StoreJob *store = prepareJob( session );
-  store->setFlags( fromAkonadiFlags( addedFlags().toList() ) );
+  store->setFlags( fromAkonadiToSupportedImapFlags( addedFlags().toList() ) );
   store->setMode( KIMAP::StoreJob::AppendFlags );
   connect( store, SIGNAL(result(KJob*)), SLOT(onAppendFlagsDone(KJob*)) );
   store->start();
@@ -100,7 +100,7 @@ void 
ChangeItemsFlagsTask::triggerAppendFlagsJob(KIMAP::Session* session)
 void ChangeItemsFlagsTask::triggerRemoveFlagsJob(KIMAP::Session* session)
 {
   KIMAP::StoreJob *store = prepareJob( session );
-  store->setFlags( fromAkonadiFlags( removedFlags().toList() ) );
+  store->setFlags( fromAkonadiToSupportedImapFlags( removedFlags().toList() ) 
);
   store->setMode( KIMAP::StoreJob::RemoveFlags );
   connect( store, SIGNAL(result(KJob*)), SLOT(onRemoveFlagsDone(KJob*)) );
   store->start();
diff --git a/resources/imap/changeitemtask.cpp 
b/resources/imap/changeitemtask.cpp
index 1a5e969..242e202 100644
--- a/resources/imap/changeitemtask.cpp
+++ b/resources/imap/changeitemtask.cpp
@@ -34,7 +34,6 @@

 #include "imapflags.h"
 #include "uidnextattribute.h"
-#include "collectionflagsattribute.h"

 ChangeItemTask::ChangeItemTask( ResourceStateInterface::Ptr resource, QObject 
*parent )
   : ResourceTask( DeferIfNoSession, resource, parent ), m_session( 0 ), 
m_oldUid( 0 ), m_newUid( 0 )
@@ -67,7 +66,7 @@ void ChangeItemTask::doStart( KIMAP::Session *session )

     job->setMailBox( mailBox );
     job->setContent( msg->encodedContent( true ) );
-    job->setFlags( fromAkonadiFlags( item().flags().toList() ) );
+    job->setFlags( fromAkonadiToSupportedImapFlags( item().flags().toList() ) 
);

     connect( job, SIGNAL(result(KJob*)),
              this, SLOT(onAppendMessageDone(KJob*)) );
@@ -105,19 +104,7 @@ void ChangeItemTask::onPreStoreSelectDone( KJob *job )

 void ChangeItemTask::triggerStoreJob()
 {
-  QList<QByteArray> flags = fromAkonadiFlags( item().flags().toList() );
-  Akonadi::CollectionFlagsAttribute *flagAttr = 
item().parentCollection().attribute<Akonadi::CollectionFlagsAttribute>();
-  // the server does not support arbitrary flags, so filter out those it can't 
handle
-  if ( flagAttr && !flagAttr->flags().isEmpty() && 
!flagAttr->flags().contains( "\\*" ) ) {
-    for ( QList< QByteArray >::iterator it = flags.begin(); it != flags.end(); 
) {
-      if ( flagAttr->flags().contains( *it ) ) {
-        ++it;
-      } else {
-        kDebug() << "Server does not support flag" << *it;
-        it = flags.erase( it );
-      }
-    }
-  }
+  QList<QByteArray> flags = fromAkonadiToSupportedImapFlags( 
item().flags().toList() );

   KIMAP::StoreJob *store = new KIMAP::StoreJob( m_session );

diff --git a/resources/imap/resourcetask.cpp b/resources/imap/resourcetask.cpp
index a41e884..1de07f3 100644
--- a/resources/imap/resourcetask.cpp
+++ b/resources/imap/resourcetask.cpp
@@ -25,6 +25,7 @@

 #include <KDE/KLocale>

+#include "collectionflagsattribute.h"
 #include "imapflags.h"
 #include "sessionpool.h"
 #include "resourcestateinterface.h"
@@ -347,6 +348,26 @@ void ResourceTask::showInformationDialog( const QString 
&message, const QString
   m_resource->showInformationDialog( message, title, dontShowAgainName );
 }

+QList<QByteArray> ResourceTask::fromAkonadiToSupportedImapFlags( const 
QList<QByteArray> &flags ) const
+{
+  QList<QByteArray> imapFlags = fromAkonadiFlags( flags );
+
+  const Akonadi::CollectionFlagsAttribute *flagAttr = 
collection().attribute<Akonadi::CollectionFlagsAttribute>();
+  // the server does not support arbitrary flags, so filter out those it can't 
handle
+  if ( flagAttr && !flagAttr->flags().isEmpty() && 
!flagAttr->flags().contains( "\\*" ) ) {
+    for ( QList< QByteArray >::iterator it = imapFlags.begin(); it != 
imapFlags.end(); ) {
+      if ( flagAttr->flags().contains( *it ) ) {
+        ++it;
+      } else {
+        kDebug() << "Server does not support flag" << *it;
+        it = imapFlags.erase( it );
+      }
+    }
+  }
+
+  return imapFlags;
+}
+
 QList<QByteArray> ResourceTask::fromAkonadiFlags( const QList<QByteArray> 
&flags )
 {
   QList<QByteArray> newFlags;
diff --git a/resources/imap/resourcetask.h b/resources/imap/resourcetask.h
index f2bfed0..69c1a64 100644
--- a/resources/imap/resourcetask.h
+++ b/resources/imap/resourcetask.h
@@ -125,7 +125,12 @@ protected:
   const QChar separatorCharacter() const;
   void setSeparatorCharacter( const QChar &separator );

+  QList<QByteArray> fromAkonadiToSupportedImapFlags( const QList<QByteArray> 
&flags ) const;
+
   static QList<QByteArray> toAkonadiFlags( const QList<QByteArray> &flags );
+
+private:
+
   static QList<QByteArray> fromAkonadiFlags( const QList<QByteArray> &flags );

 private slots:
--
1.8.4

++++++ 0002-Disconnect-session-pool-manually-in-ImapResource-des.patch ++++++
>From 9406e45979a0b363b0262845c452dcd35dacb397 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Vr=C3=A1til?= <[email protected]>
Date: Tue, 1 Oct 2013 12:12:19 +0200
Subject: [PATCH 2/2] Disconnect session pool manually in ImapResource
 destructor

Otherwise the pool is disconnected when destroyed from QObject destructor.
Disconnecting while there's a task pending in ResourceScheduler leads to
calling QObject::invokeMethod() on the same QObject, which crashes, because
some of it's data has been already destroyed.

BUG: 325443
FIXED-IN: 4.11.3
---
 resources/imap/imapresource.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/resources/imap/imapresource.cpp b/resources/imap/imapresource.cpp
index 3506d3b..10acaab 100644
--- a/resources/imap/imapresource.cpp
+++ b/resources/imap/imapresource.cpp
@@ -175,6 +175,12 @@ ImapResource::ImapResource( const QString &id )

 ImapResource::~ImapResource()
 {
+  // Disconnect and destroy the pool now, otherwise it will be called from 
QObject
+  // destructor and at that point ResourceBase and most of other stuff is 
already
+  // destroyed, which causes a crash
+  m_pool->disconnect();
+  delete m_pool;
+
   delete m_bodyCheckSession;
 }

--
1.8.4


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to