Commit 97c50fce authored by Dawit Alemayehu's avatar Dawit Alemayehu
Browse files

Do not provide "http://www" completion when the typed in text contains any kind

of white space.

BUG: 129620
FIXED-IN: 4.6.5
REVIEW: 101552
(cherry picked from commit 3f8f8d1d)
parent 02edd1c5
......@@ -5201,15 +5201,26 @@ static QString hp_tryPrepend( const QString& s )
{
if (s.isEmpty() || s[0] == QLatin1Char('/') || s[0] == QLatin1Char('~'))
return QString();
bool containsSpace = false;
for( int pos = 0;
pos < s.length() - 2; // 4 = ://x
++pos )
{
++pos ) {
if( s[ pos ] == ':' && s[ pos + 1 ] == '/' && s[ pos + 2 ] == '/' )
return QString();
if( !s[ pos ].isLetter() )
break;
if( s[pos].isSpace() ) {
containsSpace = true;
break;
}
}
if (containsSpace || s.at(s.length()-1).isSpace()) {
return QString();
}
return ( s.startsWith( "www." ) ? "http://" : "http://www." ) + s;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment