Commit a15e3a3e authored by Christian Kamm's avatar Christian Kamm

QmlJS: Fix QUrl completion with Qt 4.8.

QUrl no longer treats scheme-less urls as local files.

Change-Id: Ie219985d653a692937ff9a5ebbafc455cd3dca13
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent 465d0944
......@@ -856,9 +856,20 @@ bool QmlJSCompletionAssistProcessor::completeFileName(const QString &relativeBas
bool QmlJSCompletionAssistProcessor::completeUrl(const QString &relativeBasePath, const QString &urlString)
{
const QUrl url(urlString);
QString fileName = url.toLocalFile();
if (fileName.isEmpty())
QString fileName;
if (url.isLocalFile()) {
fileName = url.toLocalFile();
// should not trigger completion on 'file://'
if (fileName.isEmpty())
return false;
} else if (url.scheme().isEmpty()) {
// don't trigger completion while typing a scheme
if (urlString.endsWith(QLatin1String(":/")))
return false;
fileName = urlString;
} else {
return false;
}
return completeFileName(relativeBasePath, fileName);
}
......
Markdown is supported
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