From e4feb5e3267dc2bc42e2d932fa1fdfb9bdd36f42 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 26 Feb 2014 12:18:35 +0100 Subject: [PATCH] Fix F1 sometimes opening explorer/finder if documentation is not found It's not sufficient to try to create a QUrl on a string to find out if it is an url, because that automatically treats strings without any special characters as "local file urls". Task-number: QTCREATORBUG-11570 Change-Id: I18071aed5b3fbdd717b045c2f6e3e90385be8584 Reviewed-by: Eike Ziller --- src/plugins/help/helpplugin.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 840a39e42d0..37bb2d28069 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -874,9 +874,12 @@ void HelpPlugin::activateContext() links = HelpManager::linksForIdentifier(m_idFromContext); if (links.isEmpty()) { // Maybe this is already an URL... - QUrl url(m_idFromContext); - if (url.isValid()) - links.insert(m_idFromContext, m_idFromContext); + // Require protocol specifier, otherwise most strings would be 'local file names' + if (m_idFromContext.contains(QLatin1Char(':'))) { + QUrl url(m_idFromContext); + if (url.isValid()) + links.insert(m_idFromContext, m_idFromContext); + } } }