-- Forward port of

SVN commit 883206 by pradeepto:

 -- Fixing wrong default name when renaming IMAP ressources. Only enabled for kolab or scalix resources. Making a dcop call from korg to kmail to change the subresource name so that the change is reflected across both the apps. And also using kmailrc for persistence.
   kolab/Issue 2908.

  ( adapted to dbus from dcop )


svn path=/branches/kdepim/enterprise4/kdepim/; revision=887109
wilder-work
Pradeepto Bhattacharya 18 years ago
parent 49b28d61c7
commit f994cffe8b
  1. 22
      kmailicalifaceimpl.cpp
  2. 4
      kmailicalifaceimpl.h
  3. 4
      org.kde.kmail.groupware.xml

@ -76,6 +76,8 @@ using KMail::AccountManager;
using namespace KMail;
QMap<QString, QString> *KMailICalIfaceImpl::mSubResourceUINamesMap = new QMap<QString, QString>;
// Local helper methods
static void vPartMicroParser( const QString& str, QString& s );
static void reloadFolderTree();
@ -665,6 +667,10 @@ static int dimapAccountCount()
static QString subresourceLabelForPresentation( const KMFolder * folder )
{
if( KMailICalIfaceImpl::getResourceMap()->contains( folder->location() ) ) {
return folder->label();
}
QString label = folder->prettyUrl();
QStringList parts = label.split( QChar('/') );
// In the common special case of some other user's folder shared with us
@ -1636,6 +1642,18 @@ KMFolder* KMailICalIfaceImpl::findResourceFolder( const QString& resource )
return 0;
}
void KMailICalIfaceImpl::changeResourceUIName( const QString &folderPath, const QString &newName )
{
kDebug() << "Folder path " << folderPath << endl;
KMFolder *f = findResourceFolder( folderPath );
if ( f ) {
KMailICalIfaceImpl::getResourceMap()->insert( folderPath, newName );
kmkernel->folderMgr()->renameFolder( f, newName );
KConfigGroup configGroup( kmkernel->config(), "Resource UINames" );
configGroup.writeEntry( folderPath, newName );
}
}
/****************************
* The config stuff
*/
@ -1935,6 +1953,10 @@ void KMailICalIfaceImpl::readConfig()
mNotes->location(), mNotes->label(), true, false );
}
KConfig *config = kmkernel->config();
KConfigGroup cf = config->group("Resource UINames");
*KMailICalIfaceImpl::mSubResourceUINamesMap = cf.entryMap();
reloadFolderTree();
if ( justEnabled ) {

@ -236,6 +236,7 @@ public:
// See CachedImapJob::slotPutMessageResult
bool isResourceQuiet() const;
void setResourceQuiet(bool q);
static QMap<QString, QString>* getResourceMap() { return mSubResourceUINamesMap; }
public slots:
/* (Re-)Read configuration file */
@ -249,6 +250,7 @@ public slots:
// Called when a folder is made readonly or readwrite, or renamed,
// or any other similar change that affects the resources
void slotFolderPropertiesChanged( KMFolder* folder );
void changeResourceUIName( const QString &folderPath, const QString &newName );
private slots:
void slotRefreshFolder( KMFolder* );
@ -370,7 +372,7 @@ private:
QMap<quint32, bool> mTheUnGetMes;
QMap<QString, QString> mPendingUpdates;
QMap<QString, bool> mInTransit;
static QMap<QString, QString> *mSubResourceUINamesMap;
};
#endif // KMAILICALIFACEIMPL_H

@ -110,5 +110,9 @@
<arg type="b" direction="out"/>
<arg name="resource" type="s" direction="in"/>
</method>
<method name="changeResourceUIName">
<arg name="folderPath" type="s" direction="in"/>
<arg name="newName" type="s" direction="in"/>
</method>
</interface>
</node>

Loading…
Cancel
Save