[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/wizards
From:       David Faure <faure () kde ! org>
Date:       2005-05-30 20:14:58
Message-ID: 1117484098.002060.6694.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 419895 by dfaure:

Fix kolabwizard creating multiple identities with the same name \
(https://intevation.de/roundup/kolab/issue767). First identity is still called \
"Kolab" (since most people only have one kolab account), after that they're called \
after the hostname, and "hostname 2", "hostname 3" in case of duplicates. (proko2 \
branch backport)


 M  +13 -1     kmailchanges.cpp  


--- trunk/KDE/kdepim/wizards/kmailchanges.cpp #419894:419895
@@ -208,7 +208,19 @@
   KPIM::IdentityManager identityManager;
   if ( !identityManager.allEmails().contains( mEmail ) ) {
     // Not sure how to name the identity. First one is "Default", next one \
                mAccountName, but then...
-    KPIM::Identity& identity = identityManager.newFromScratch( mAccountName );
+    // let's use the server name after that.
+    QString accountName = mAccountName;
+    const QStringList identities = identityManager.identities();
+    if ( identities.find( accountName ) != identities.end() ) {
+      accountName = mServer;
+      int i = 2;
+      // And if there's already one, number them
+      while ( identities.find( accountName ) != identities.end() ) {
+        accountName = mServer + " " + QString::number( i++ );
+      }
+    }
+
+    KPIM::Identity& identity = identityManager.newFromScratch( accountName );
     identity.setFullName( mRealName );
     identity.setEmailAddr( mEmail );
     identityManager.commit();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic