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

List:       kde-commits
Subject:    KDE_3_2_BRANCH: kdelibs/kdecore
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-03-12 16:28:42
Message-ID: 20040312162842.9597A99A8 () office ! kde ! org
[Download RAW message or body]

CVS commit by waba: 

Don't encode @ in mailto: URL (url and prettyURL)


  M +29 -2     kurl.cpp   1.265.2.3


--- kdelibs/kdecore/kurl.cpp  #1.265.2.2:1.265.2.3
@@ -1264,6 +1264,19 @@ QString KURL::encodedPathAndQuery( int _
      if ( _no_empty_path && tmp.isEmpty() )
         tmp = "/";
+     if (m_iUriMode == Mailto)
+     {
+        int atIndex = tmp.findRev('@');
+        if (atIndex == -1)
+           tmp = encode( tmp, false, encoding_hint );
+        else
+           tmp = encode( tmp.left(atIndex), false, encoding_hint) +
+                 '@' + 
+                 encode( tmp.mid(atIndex+1), false, encoding_hint);
+     }
+     else
+     {
      tmp = encode( tmp, false, encoding_hint );
   }
+  }
 
   // TODO apply encoding_hint to the query
@@ -1509,5 +1522,19 @@ QString KURL::prettyURL( int _trailing )
   }
 
+  if (m_iUriMode == Mailto)
+  {
+     int atIndex = m_strPath.findRev('@');
+     if (atIndex == -1)
+        u += lazy_encode( m_strPath );
+     else
+        u += lazy_encode( m_strPath.left(atIndex) ) +
+             '@' + 
+             lazy_encode( m_strPath.mid(atIndex+1) );
+  }
+  else
+  {
   u += trailingSlash( _trailing, lazy_encode( m_strPath ) );
+  }
+
   if (!m_strQuery_encoded.isNull())
       u += '?' + m_strQuery_encoded;


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

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