forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -874,9 +874,12 @@ void HelpPlugin::activateContext()
|
|||||||
links = HelpManager::linksForIdentifier(m_idFromContext);
|
links = HelpManager::linksForIdentifier(m_idFromContext);
|
||||||
if (links.isEmpty()) {
|
if (links.isEmpty()) {
|
||||||
// Maybe this is already an URL...
|
// Maybe this is already an URL...
|
||||||
QUrl url(m_idFromContext);
|
// Require protocol specifier, otherwise most strings would be 'local file names'
|
||||||
if (url.isValid())
|
if (m_idFromContext.contains(QLatin1Char(':'))) {
|
||||||
links.insert(m_idFromContext, m_idFromContext);
|
QUrl url(m_idFromContext);
|
||||||
|
if (url.isValid())
|
||||||
|
links.insert(m_idFromContext, m_idFromContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user