[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdepim/enterprise/kdepim/kresources/kolab/kcal
From: Sergio Luis Martins <iamsergio () gmail ! com>
Date: 2010-07-05 15:54:26
Message-ID: 20100705155426.2BCAAAC7E2 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1146265 by smartins:
When importing incidences:
Don't ask multiple times which sub-resource to use.
Don't warn multiple times about non-writable resources.
MERGE: See if the bug exists in trunk. But the fix should be different there because \
we don't use kresources there.
Fixes kolab/isseu4445
M +20 -1 resourcekolab.cpp
M +7 -0 resourcekolab.h
--- branches/kdepim/enterprise/kdepim/kresources/kolab/kcal/resourcekolab.cpp \
#1146264:1146265 @@ -573,7 +573,16 @@
}
text += "<br>";
}
+
+ // Lets not warn the user 100 times that there's no writable resource
+ // and not ask 100 times which resource to use
+ if ( !mAddingInProgress || !mLastUsedResources.contains( type ) ) {
subResource = findWritableResource( type, *map, text );
+ mLastUsedResources[type] = subResource;
+ } else {
+ subResource = mLastUsedResources[type];
+ }
+
if ( subResource.isEmpty() ) {
switch( mErrorCode ) {
case NoWritableFound:
@@ -1138,7 +1147,6 @@
return new KABC::LockNull( true );
}
-
Kolab::ResourceMap* ResourceKolab::subResourceMap( const QString& contentsType )
{
if ( contentsType == kmailCalendarContentsType ) {
@@ -1251,4 +1259,15 @@
writeResourceConfig( config, mJournalSubResources );
}
+void ResourceKolab::beginAddingIncidences()
+{
+ mAddingInProgress = true;
+}
+
+void ResourceKolab::endAddingIncidences()
+{
+ mAddingInProgress = false;
+ mLastUsedResources.clear();
+}
+
#include "resourcekolab.moc"
--- branches/kdepim/enterprise/kdepim/kresources/kolab/kcal/resourcekolab.h \
#1146264:1146265 @@ -146,11 +146,16 @@
KABC::Lock* lock();
+ void beginAddingIncidences();
+
+ void endAddingIncidences();
+
signals:
void useGlobalMode();
protected slots:
void slotEmitResourceChanged();
void writeConfig();
+
protected:
/**
* Return list of alarms which are relevant for the current user. These
@@ -238,6 +243,8 @@
*/
QMap< QPair<QString, QString>, QString > mOriginalUID2fakeUID;
+ bool mAddingInProgress;
+ QMap<Kolab::ResourceType,QString> mLastUsedResources;
};
struct TemporarySilencer {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic