Now that kmail also knows the correct delimiter (from the namespace code) use it

and transfer the correct new folder path to the kioslave.
And make the code that defaults the type of moved uw imap folders actually work :-)
Make sure you also update the imap4 kioslave.

svn path=/branches/KDE/3.5/kdepim/; revision=443851
wilder-work
Carsten Burghardt 21 years ago
parent 05db1a6c0a
commit 9fb3eb0d87
  1. 11
      imapaccountbase.cpp
  2. 18
      kmfolderimap.cpp
  3. 2
      newfolderdialog.cpp
  4. 2
      renamejob.cpp

@ -745,8 +745,13 @@ namespace KMail {
QStringList::Iterator strit;
for ( strit = it.data().begin(); strit != it.data().end(); ++strit )
{
QString ns = *strit;
if ( ns.endsWith("/") || ns.endsWith(".") ) {
// strip delimiter for the comparison
ns = ns.left( ns.length()-1 );
}
// first ignore an empty prefix as it would match always
if ( !(*strit).isEmpty() && path.find( *strit ) != -1 ) {
if ( !ns.isEmpty() && path.find( ns ) != -1 ) {
return (*strit);
}
}
@ -783,9 +788,7 @@ namespace KMail {
QString ImapAccountBase::delimiterForFolder( FolderStorage* storage )
{
QString prefix = namespaceForFolder( storage );
QString delim;
if ( mNamespaceToDelimiter.contains(prefix) )
delim = mNamespaceToDelimiter[prefix];
QString delim = delimiterForNamespace( prefix );
return delim;
}

@ -1614,18 +1614,30 @@ void KMFolderImap::slotGetMessagesResult(KIO::Job * job)
void KMFolderImap::createFolder(const QString &name, const QString& parentPath,
bool askUser)
{
kdDebug(5006) << "KMFolderImap::createFolder - name=" << name << ",parent=" <<
parentPath << ",askUser=" << askUser << endl;
if ( mAccount->makeConnection() != ImapAccountBase::Connected ) {
kdWarning(5006) << "KMFolderImap::createFolder - got no connection" << endl;
return;
}
KURL url = mAccount->getUrl();
QString parent = ( parentPath.isEmpty() ? imapPath() : parentPath );
if ( !parent.endsWith("/") ) {
parent += "/";
if ( parent.endsWith("/") ) {
// strip / (which kmail uses this internally)
parent = parent.left( parent.length()-1 );
}
QString delim = mAccount->delimiterForFolder( this );
if ( delim.isEmpty() ) {
// better be safe
delim = "/";
}
if ( !parent.endsWith(delim) ) {
// add the correct delimiter
parent += delim;
}
QString path = parent + name;
if ( askUser ) {
path += ";INFO=ASKUSER";
path += "/;INFO=ASKUSER";
}
url.setPath( path );

@ -249,7 +249,7 @@ void NewFolderDialog::slotOk()
QString imapPath, parent;
if ( mNamespacesComboBox ) {
// create folder with namespace
parent = mNamespacesComboBox->currentText();
parent = anAccount->addPathToNamespace( mNamespacesComboBox->currentText() );
imapPath = anAccount->addPathToNamespace( parent ) + fldName;
}
KMFolderImap* newStorage = static_cast<KMFolderImap*>( newFolder->storage() );

@ -125,7 +125,7 @@ void RenameJob::execute()
this, SLOT( slotMoveMessages() ) );
KMFolderImap* imapFolder =
static_cast<KMFolderImap*>(mNewParent->owner()->storage());
imapFolder->createFolder( mNewName, false );
imapFolder->createFolder( mNewName, QString::null, false );
} else if ( mNewParent->type() == KMDImapDir )
{
KMFolderCachedImap* newStorage = static_cast<KMFolderCachedImap*>(mNewFolder->storage());

Loading…
Cancel
Save