rpms/kdepim/devel kdepim-4.2.1-imap.patch, NONE, 1.1 kdepim.spec, 1.208, 1.209
Than Ngo
than at fedoraproject.org
Wed Mar 4 21:33:16 UTC 2009
Author: than
Update of /cvs/extras/rpms/kdepim/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5302
Modified Files:
kdepim.spec
Added Files:
kdepim-4.2.1-imap.patch
Log Message:
upstream patch, speed up folder syncing
kdepim-4.2.1-imap.patch:
--- NEW FILE kdepim-4.2.1-imap.patch ---
Index: kmail/kmfoldercachedimap.cpp
===================================================================
--- kmail/kmfoldercachedimap.cpp (Revision 935084)
+++ kmail/kmfoldercachedimap.cpp (Revision 935085)
@@ -202,7 +202,8 @@
/*mHoldSyncs( false ),*/
mFolderRemoved( false ),
mRecurse( true ),
- mStatusChangedLocally( false ), mAnnotationFolderTypeChanged( false ),
+ mStatusChangedLocally( false ),
+ mAnnotationFolderTypeChanged( false ),
mIncidencesForChanged( false ), mPersonalNamespacesCheckDone( true ),
mQuotaInfo(), mAlarmsBlocked( false ),
mRescueCommandCount( 0 ),
@@ -303,18 +304,22 @@
KMFolderMaildir::readConfig();
mStatusChangedLocally = group.readEntry( "StatusChangedLocally", false );
+ QStringList uidsChanged = group.readEntry( "UIDStatusChangedLocally", QStringList() );
+ foreach( const QString &uid, uidsChanged ) {
+ mUIDsOfLocallyChangedStatuses.append( uid.toUInt() );
+ }
mAnnotationFolderTypeChanged = group.readEntry( "AnnotationFolderTypeChanged", false );
mIncidencesForChanged = group.readEntry( "IncidencesForChanged", false );
if ( mImapPath.isEmpty() ) {
mImapPathCreation = group.readEntry("ImapPathCreation");
}
- QStringList uids = group.readEntry( "UIDSDeletedSinceLastSync", QStringList() );
+ QStringList delUids = group.readEntry( "UIDSDeletedSinceLastSync" , QStringList() );
#if MAIL_LOSS_DEBUGGING
kDebug( 5006 ) << "READING IN UIDSDeletedSinceLastSync: " << folder()->prettyUrl() << endl << uids;
#endif
- for ( QStringList::iterator it = uids.begin(); it != uids.end(); ++it ) {
- mDeletedUIDsSinceLastSync.insert( (*it).toULong(), 0);
+ for ( QStringList::iterator it = delUids.begin(); it != delUids.end(); it++ ) {
+ mDeletedUIDsSinceLastSync.insert( (*it).toULong(), 0);
}
}
@@ -331,7 +336,14 @@
configGroup.writeEntry( "NoContent", mNoContent );
configGroup.writeEntry( "ReadOnly", mReadOnly );
configGroup.writeEntry( "FolderAttributes", mFolderAttributes );
- configGroup.writeEntry( "StatusChangedLocally", mStatusChangedLocally );
+
+ // StatusChangedLocally is always false, as we use UIDStatusChangedLocally now
+ configGroup.writeEntry( "StatusChangedLocally", false );
+ QStringList uidsToWrite;
+ foreach( const ulong uid, mUIDsOfLocallyChangedStatuses ) {
+ uidsToWrite.append( QString::number( uid ) );
+ }
+ configGroup.writeEntry( "UIDStatusChangedLocally", uidsToWrite );
if ( !mImapPathCreation.isEmpty() ) {
if ( mImapPath.isEmpty() ) {
configGroup.writeEntry( "ImapPathCreation", mImapPathCreation );
@@ -953,12 +965,13 @@
// Upload flags, unless we know from the ACL that we're not allowed
// to do that or they did not change locally
if ( mUserRights <= 0 || ( mUserRights & KMail::ACLJobs::WriteFlags ) ) {
- if ( mStatusChangedLocally ) {
+ if ( !mUIDsOfLocallyChangedStatuses.isEmpty() || mStatusChangedLocally ) {
uploadFlags();
break;
}
- } else if ( mUserRights & KMail::ACLJobs::WriteSeenFlag ) {
- if ( mStatusChangedLocally ) {
+ }
+ else if ( mUserRights & KMail::ACLJobs::WriteSeenFlag ) {
+ if ( !mUIDsOfLocallyChangedStatuses.isEmpty() || mStatusChangedLocally ) {
uploadSeenFlags();
break;
}
@@ -1425,6 +1438,10 @@
// Either not a valid message or not one that is on the server yet
continue;
}
+ if ( mUIDsOfLocallyChangedStatuses.indexOf( msg->UID() ) < 0 && !mStatusChangedLocally ) {
+ // This message has not had its status changed locally
+ continue;
+ }
QString flags = KMFolderImap::statusToFlags( msg->status(), mPermanentFlags );
// Collect uids for each typem of flags.
@@ -1468,6 +1485,11 @@
// Either not a valid message or not one that is on the server yet
continue;
+ if ( mUIDsOfLocallyChangedStatuses.indexOf( msg->UID() ) < 0 && !mStatusChangedLocally ) {
+ // This message has not had its status changed locally
+ continue;
+ }
+
if ( msg->status().isOld() || msg->status().isRead() )
seenUids.append( msg->UID() );
else
@@ -1525,13 +1547,21 @@
void KMFolderCachedImap::setStatus( int idx, const MessageStatus &status, bool toggle )
{
KMFolderMaildir::setStatus( idx, status, toggle );
- mStatusChangedLocally = true;
+ const KMMsgBase *msg = getMsgBase( idx );
+ Q_ASSERT( msg );
+ if ( msg )
+ mUIDsOfLocallyChangedStatuses.append( msg->UID() );
}
void KMFolderCachedImap::setStatus( QList<int> &ids, const MessageStatus &status, bool toggle )
{
KMFolderMaildir::setStatus( ids, status, toggle );
- mStatusChangedLocally = true;
+ foreach( const int id, ids ) {
+ const KMMsgBase *msg = getMsgBase( id );
+ Q_ASSERT( msg );
+ if ( msg )
+ mUIDsOfLocallyChangedStatuses.append( msg->UID() );
+ }
}
/* Upload new folders to server */
@@ -1888,7 +1918,8 @@
} else {
if ( lastSet ) { // always true here (this comes from online-imap...)
mContentState = imapFinished;
- mStatusChangedLocally = false; // we are up to date again
+ mUIDsOfLocallyChangedStatuses.clear(); // we are up to date again
+ mStatusChangedLocally = false;
}
}
serverSyncInternal();
Index: kmail/kmfoldercachedimap.h
===================================================================
--- kmail/kmfoldercachedimap.h (Revision 935084)
+++ kmail/kmfoldercachedimap.h (Revision 935085)
@@ -627,12 +627,18 @@
bool mFolderRemoved;
bool mRecurse;
+ /**
+ * UIDs added by setStatus. Indicates that the client has changed
+ * the status of those mails. The mail flags for changed mails will be
+ * uploaded to the server, overwriting the server's notion of the status
+ * of the mails in this folder.
+ */
+ QList<ulong> mUIDsOfLocallyChangedStatuses;
+
/**
- Set to true by setStatus. Indicates that the client has changed
- the status of at least one mail. The mail flags will therefore be
- uploaded to the server, overwriting the server's notion of the status
- of the mails in this folder.
- */
+ * Same as above, but uploads the flags of all mails, even if not all changed.
+ * Only still here for config compatibility.
+ */
bool mStatusChangedLocally;
/**
Index: kdepim.spec
===================================================================
RCS file: /cvs/extras/rpms/kdepim/devel/kdepim.spec,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -r1.208 -r1.209
--- kdepim.spec 27 Feb 2009 12:41:03 -0000 1.208
+++ kdepim.spec 4 Mar 2009 21:32:45 -0000 1.209
@@ -6,7 +6,7 @@
Summary: PIM (Personal Information Manager) applications
Epoch: 6
Version: 4.2.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Group: Applications/Productivity
@@ -14,6 +14,8 @@
Source0: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/%{name}-%{version}.tar.bz2
Patch0: kdepim-4.1.80-libqgpgme-link-fix.patch
# upstream patches
+Patch100: kdepim-4.2.1-imap.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Provides: kdepim4 = %{version}-%{release}
@@ -92,6 +94,7 @@
%patch0 -p1 -b .libqgpgme-link-fix
# upstream patches
+%patch100 -p0 -b .imap
%build
mkdir -p %{_target_platform}
@@ -181,6 +184,9 @@
%changelog
+* Wed Mar 04 2009 Than Ngo <than at redhat.com> - 4.2.1-2
+- upstream patch, speed up folder syncing
+
* Fri Feb 27 2009 Than Ngo <than at redhat.com> - 4.2.1-1
- 4.2.1
More information about the fedora-extras-commits
mailing list