[kdepim-runtime] pull in a few upstream patches
Rex Dieter
rdieter at fedoraproject.org
Fri Feb 8 15:35:56 UTC 2013
commit 0061dfefb2ae2ecd807b9f552fff1324dd4667c0
Author: Rex Dieter <rdieter at math.unl.edu>
Date: Fri Feb 8 09:35:42 2013 -0600
pull in a few upstream patches
0002-Verify-if-we-can-write-open-file.patch | 63 +++++++++++++
...gs-when-config-changed.-Fix-create-bookma.patch | 51 +++++++++++
...175-Akonadi-Browser-Bookmarks-are-shown-a.patch | 28 ++++++
0005-Set-dbus.patch | 26 ++++++
...-Collection.id-is-not-always-available-an.patch | 95 ++++++++++++++++++++
kdepim-runtime.spec | 20 ++++-
6 files changed, 280 insertions(+), 3 deletions(-)
---
diff --git a/0002-Verify-if-we-can-write-open-file.patch b/0002-Verify-if-we-can-write-open-file.patch
new file mode 100644
index 0000000..49580ee
--- /dev/null
+++ b/0002-Verify-if-we-can-write-open-file.patch
@@ -0,0 +1,63 @@
+From 976eb57ce1230da84ce3b82e6b778c009020975d Mon Sep 17 00:00:00 2001
+From: Montel Laurent <montel at kde.org>
+Date: Tue, 5 Feb 2013 13:23:41 +0100
+Subject: [PATCH 2/7] Verify if we can write/open file
+
+---
+ resources/vcarddir/vcarddirresource.cpp | 32 +++++++++++++++++++-------------
+ 1 file changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/resources/vcarddir/vcarddirresource.cpp b/resources/vcarddir/vcarddirresource.cpp
+index 01afb68..e5d5ded 100644
+--- a/resources/vcarddir/vcarddirresource.cpp
++++ b/resources/vcarddir/vcarddirresource.cpp
+@@ -81,13 +81,16 @@ bool VCardDirResource::loadAddressees()
+ it.next();
+ if ( it.fileName() != "." && it.fileName() != ".." && it.fileName() != "WARNING_README.txt" ) {
+ QFile file( it.filePath() );
+- file.open( QIODevice::ReadOnly );
+- const QByteArray data = file.readAll();
+- file.close();
+-
+- const KABC::Addressee addr = mConverter.parseVCard( data );
+- if ( !addr.isEmpty() ) {
+- mAddressees.insert( addr.uid(), addr );
++ if (file.open( QIODevice::ReadOnly )) {
++ const QByteArray data = file.readAll();
++ file.close();
++
++ const KABC::Addressee addr = mConverter.parseVCard( data );
++ if ( !addr.isEmpty() ) {
++ mAddressees.insert( addr.uid(), addr );
++ }
++ } else {
++ kDebug()<<" file can't be load "<<it.filePath();
+ }
+ }
+ }
+@@ -166,13 +169,16 @@ void VCardDirResource::itemChanged( const Akonadi::Item &item, const QSet<QByteA
+ const QByteArray data = mConverter.createVCard( addressee );
+
+ QFile file( vCardDirectoryFileName( addressee.uid() ) );
+- file.open( QIODevice::WriteOnly );
+- file.write( data );
+- file.close();
++ if (file.open( QIODevice::WriteOnly )) {
++ file.write( data );
++ file.close();
+
+- Item newItem( item );
+- newItem.setRemoteId( addressee.uid() );
+- changeCommitted( newItem );
++ Item newItem( item );
++ newItem.setRemoteId( addressee.uid() );
++ changeCommitted( newItem );
++ } else {
++ kDebug()<<" We can't write in file "<<file.fileName();
++ }
+
+ } else {
+ changeProcessed();
+--
+1.8.1.2
+
diff --git a/0003-Save-settings-when-config-changed.-Fix-create-bookma.patch b/0003-Save-settings-when-config-changed.-Fix-create-bookma.patch
new file mode 100644
index 0000000..afe5aaf
--- /dev/null
+++ b/0003-Save-settings-when-config-changed.-Fix-create-bookma.patch
@@ -0,0 +1,51 @@
+From d1d87f425e98ae7c4159ecdb9594f00e452a0fb0 Mon Sep 17 00:00:00 2001
+From: Montel Laurent <montel at kde.org>
+Date: Tue, 5 Feb 2013 13:42:31 +0100
+Subject: [PATCH 3/7] Save settings when config changed. Fix create bookmark
+ when we path is
+
+not empty
+
+fix crash.
+---
+ resources/localbookmarks/localbookmarksresource.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/resources/localbookmarks/localbookmarksresource.cpp b/resources/localbookmarks/localbookmarksresource.cpp
+index 8166602..302f9f5 100644
+--- a/resources/localbookmarks/localbookmarksresource.cpp
++++ b/resources/localbookmarks/localbookmarksresource.cpp
+@@ -33,6 +33,10 @@ LocalBookmarksResource::LocalBookmarksResource( const QString &id )
+ : ResourceBase( id ), mBookmarkManager( 0 )
+ {
+ new SettingsAdaptor( Settings::self() );
++ const QString fileName = Settings::self()->path();
++ if (!fileName.isEmpty() ) {
++ mBookmarkManager = KBookmarkManager::managerForFile( fileName, name() );
++ }
+ }
+
+ LocalBookmarksResource::~LocalBookmarksResource()
+@@ -74,6 +78,7 @@ void LocalBookmarksResource::configure( WId windowId )
+
+ mBookmarkManager = KBookmarkManager::managerForFile( newFile, name() );
+
++ Settings::self()->writeConfig();
+ synchronize();
+
+ emit configurationDialogAccepted();
+@@ -160,6 +165,11 @@ void LocalBookmarksResource::retrieveCollections()
+ mimeTypes << "application/x-xbel" << Collection::mimeType();
+ root.setContentMimeTypes( mimeTypes );
+
++
++ if (!mBookmarkManager) {
++ mBookmarkManager = KBookmarkManager::managerForFile( Settings::self()->path(), name() );
++ }
++
+ Collection::List list;
+ list << root;
+ list << listRecursive( mBookmarkManager->root(), root );
+--
+1.8.1.2
+
diff --git a/0004-Fix-Bug-299175-Akonadi-Browser-Bookmarks-are-shown-a.patch b/0004-Fix-Bug-299175-Akonadi-Browser-Bookmarks-are-shown-a.patch
new file mode 100644
index 0000000..863ca10
--- /dev/null
+++ b/0004-Fix-Bug-299175-Akonadi-Browser-Bookmarks-are-shown-a.patch
@@ -0,0 +1,28 @@
+From f2e7ddeaff03b2a2063800fcb6990c9193f98438 Mon Sep 17 00:00:00 2001
+From: Montel Laurent <montel at kde.org>
+Date: Tue, 5 Feb 2013 13:51:58 +0100
+Subject: [PATCH 4/7] Fix Bug 299175 - Akonadi (Browser) Bookmarks are shown as
+ unread-emails
+
+FIXED-IN: 4.10.1
+BUG: 299175
+---
+ resources/localbookmarks/localbookmarksresource.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/resources/localbookmarks/localbookmarksresource.cpp b/resources/localbookmarks/localbookmarksresource.cpp
+index 302f9f5..830eaec 100644
+--- a/resources/localbookmarks/localbookmarksresource.cpp
++++ b/resources/localbookmarks/localbookmarksresource.cpp
+@@ -132,7 +132,7 @@ void LocalBookmarksResource::itemRemoved( const Akonadi::Item &item )
+
+ static Collection::List listRecursive( const KBookmarkGroup &parentGroup, const Collection &parentCollection )
+ {
+- const QStringList mimeTypes = QStringList() << "message/rfc822" << Collection::mimeType();
++ const QStringList mimeTypes = QStringList() << "application/x-xbel" << Collection::mimeType();
+
+ Collection::List collections;
+
+--
+1.8.1.2
+
diff --git a/0005-Set-dbus.patch b/0005-Set-dbus.patch
new file mode 100644
index 0000000..e63cd83
--- /dev/null
+++ b/0005-Set-dbus.patch
@@ -0,0 +1,26 @@
+From d90e362f419e08fe2dbc1328d447f26d059c8cba Mon Sep 17 00:00:00 2001
+From: Montel Laurent <montel at kde.org>
+Date: Tue, 5 Feb 2013 14:05:19 +0100
+Subject: [PATCH 5/7] Set dbus
+
+---
+ resources/localbookmarks/localbookmarksresource.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/resources/localbookmarks/localbookmarksresource.cpp b/resources/localbookmarks/localbookmarksresource.cpp
+index 830eaec..d4a4a39 100644
+--- a/resources/localbookmarks/localbookmarksresource.cpp
++++ b/resources/localbookmarks/localbookmarksresource.cpp
+@@ -33,6 +33,9 @@ LocalBookmarksResource::LocalBookmarksResource( const QString &id )
+ : ResourceBase( id ), mBookmarkManager( 0 )
+ {
+ new SettingsAdaptor( Settings::self() );
++ QDBusConnection::sessionBus().registerObject( QLatin1String( "/Settings" ),
++ Settings::self(), QDBusConnection::ExportAdaptors );
++
+ const QString fileName = Settings::self()->path();
+ if (!fileName.isEmpty() ) {
+ mBookmarkManager = KBookmarkManager::managerForFile( fileName, name() );
+--
+1.8.1.2
+
diff --git a/0007-Fix-caching-Collection.id-is-not-always-available-an.patch b/0007-Fix-caching-Collection.id-is-not-always-available-an.patch
new file mode 100644
index 0000000..4e3e4e9
--- /dev/null
+++ b/0007-Fix-caching-Collection.id-is-not-always-available-an.patch
@@ -0,0 +1,95 @@
+From 95f50a6ff11cd1ebcb462a6230e6804938d975d2 Mon Sep 17 00:00:00 2001
+From: Andras Mantia <amantia at kde.org>
+Date: Thu, 7 Feb 2013 13:50:35 +0200
+Subject: [PATCH 7/7] Fix caching: Collection.id is not always available and
+ valid when maildirForCollection is called. Thanks for Guy Maurel who found
+ the bug.
+
+CCMAIL: guy-kde at maurel.de
+REVIEW: 108755
+---
+ resources/maildir/maildirresource.cpp | 24 +++++++++++++++++++-----
+ resources/maildir/maildirresource.h | 6 ++++--
+ 2 files changed, 23 insertions(+), 7 deletions(-)
+
+diff --git a/resources/maildir/maildirresource.cpp b/resources/maildir/maildirresource.cpp
+index df989c1..01a432f 100644
+--- a/resources/maildir/maildirresource.cpp
++++ b/resources/maildir/maildirresource.cpp
+@@ -54,8 +54,9 @@ using namespace Akonadi_Maildir_Resource;
+
+ Maildir MaildirResource::maildirForCollection( const Collection& col )
+ {
+- if ( mMaildirsForCollection.contains( col.id() ) ) {
+- return mMaildirsForCollection.value( col.id() );
++ const QString path = maildirPathForCollection( col );
++ if ( mMaildirsForCollection.contains( path ) ) {
++ return mMaildirsForCollection.value( path );
+ }
+
+ if ( col.remoteId().isEmpty() ) {
+@@ -66,12 +67,12 @@ Maildir MaildirResource::maildirForCollection( const Collection& col )
+ if ( col.parentCollection() == Collection::root() ) {
+ kWarning( col.remoteId() != mSettings->path() ) << "RID mismatch, is " << col.remoteId() << " expected " << mSettings->path();
+ Maildir maildir( col.remoteId(), mSettings->topLevelIsContainer() );
+- mMaildirsForCollection.insert( col.id(), maildir );
++ mMaildirsForCollection.insert( path, maildir );
+ return maildir;
+ }
+ Maildir parentMd = maildirForCollection( col.parentCollection() );
+ Maildir maildir = parentMd.subFolder( col.remoteId() );
+- mMaildirsForCollection.insert( col.id(), maildir );
++ mMaildirsForCollection.insert( path, maildir );
+ return maildir;
+ }
+
+@@ -663,7 +664,8 @@ void MaildirResource::collectionRemoved( const Akonadi::Collection &collection )
+ emit error( i18n( "Failed to delete sub-folder '%1'.", collection.remoteId() ) );
+ }
+
+- mMaildirsForCollection.remove( collection.id() );
++ const QString path = maildirPathForCollection( collection );
++ mMaildirsForCollection.remove( path );
+
+ changeProcessed();
+ }
+@@ -819,5 +821,17 @@ void MaildirResource::fsWatchFileModifyResult(KJob* job)
+ }
+ }
+
++QString MaildirResource::maildirPathForCollection(const Collection& collection) const
++{
++ QString path = collection.remoteId();
++ Akonadi::Collection parent = collection.parentCollection();
++ while ( !parent.remoteId().isEmpty() ) {
++ path.prepend( parent.remoteId() + QLatin1Char('/') );
++ parent = parent.parentCollection();
++ }
++
++ return path;
++}
++
+
+ #include "maildirresource.moc"
+diff --git a/resources/maildir/maildirresource.h b/resources/maildir/maildirresource.h
+index b0c595a..f792b23 100644
+--- a/resources/maildir/maildirresource.h
++++ b/resources/maildir/maildirresource.h
+@@ -87,10 +87,12 @@ class MaildirResource : public Akonadi::ResourceBase, public Akonadi::AgentBase:
+ /** Creates a collection object for the given maildir @p md. */
+ Akonadi::Collection collectionForMaildir( const KPIM::Maildir &md ) const;
+
+- private:
++ QString maildirPathForCollection( const Akonadi::Collection &collection) const;
++
++private:
+ Akonadi_Maildir_Resource::MaildirSettings *mSettings;
+ KDirWatch *mFsWatcher;
+- QHash<Akonadi::Collection::Id, KPIM::Maildir> mMaildirsForCollection;
++ QHash<QString, KPIM::Maildir> mMaildirsForCollection;
+
+ };
+
+--
+1.8.1.2
+
diff --git a/kdepim-runtime.spec b/kdepim-runtime.spec
index 2cd2352..e116f6f 100644
--- a/kdepim-runtime.spec
+++ b/kdepim-runtime.spec
@@ -1,11 +1,11 @@
-%global akonadi_version_min 1.8.0
+%global akonadi_version_min 1.9.0
%global akonadi_version %(pkg-config --modversion akonadi 2>/dev/null || echo %{akonadi_version_min})
Name: kdepim-runtime
Summary: KDE PIM Runtime Environment
Epoch: 1
Version: 4.10.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
URL: http://www.kde.org/
@@ -20,9 +20,14 @@ Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar
# show the Akonadi KCM in System Settings (#565420)
Patch0: kdepim-runtime-4.4.93-show_akonadi_kcm.patch
-## upstream patches
+## upstreamable patches
## upstream patches
+Patch102: 0002-Verify-if-we-can-write-open-file.patch
+Patch103: 0003-Save-settings-when-config-changed.-Fix-create-bookma.patch
+Patch104: 0004-Fix-Bug-299175-Akonadi-Browser-Bookmarks-are-shown-a.patch
+Patch105: 0005-Set-dbus.patch
+Patch107: 0007-Fix-caching-Collection.id-is-not-always-available-an.patch
# nuke ill-advised -devel pkg
Obsoletes: kdepim-runtime-devel < 1:4.7.90-3
@@ -75,6 +80,12 @@ Requires: akonadi%{?_isa} >= %{akonadi_version}
%patch0 -p1 -b .show_akonadi_kcm
+%patch102 -p1 -b .0002
+%patch103 -p1 -b .0003
+%patch104 -p1 -b .0004
+%patch105 -p1 -b .0005
+%patch107 -p1 -b .0007
+
%build
mkdir -p %{_target_platform}
@@ -159,6 +170,9 @@ fi
%changelog
+* Fri Feb 08 2013 Rex Dieter <rdieter at fedoraproject.org> 1:4.10.0-2
+- pull in a few upstream patches
+
* Fri Feb 01 2013 Rex Dieter <rdieter at fedoraproject.org> - 1:4.10.0-1
- 4.10.0
More information about the scm-commits
mailing list