summaryrefslogtreecommitdiff
path: root/src/plugins/help
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-02-26 12:18:35 +0100
committerEike Ziller <eike.ziller@digia.com>2014-03-03 17:08:09 +0100
commite4feb5e3267dc2bc42e2d932fa1fdfb9bdd36f42 (patch)
tree2df4e60178098c897c046c00fb03f15e0d32353f /src/plugins/help
parentc4f5bdfbdb9c626c85a6eb00566f620748b428db (diff)
downloadqt-creator-e4feb5e3267dc2bc42e2d932fa1fdfb9bdd36f42.tar.gz
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 <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/help')
-rw-r--r--src/plugins/help/helpplugin.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 840a39e42d..37bb2d2806 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);
+ }
}
}