void HelpPlugin::openHelpPage(const QString& url)
{
- activateHelpMode();
- if (m_helpEngine->findFile(url).isValid())
+ if (m_helpEngine->findFile(url).isValid()) {
+ activateHelpMode();
m_centralWidget->setSource(url);
- else {
- QDesktopServices::openUrl(QLatin1String("http://doc.trolltech.com/latest/")
- + url.mid(url.lastIndexOf('/') + 1));
+ } else {
+ // local help not installed, resort to external web help
+ QString urlPrefix;
+ if (url.startsWith("qthelp://com.nokia.qtcreator")) {
+ urlPrefix = QString::fromLatin1("http://doc.trolltech.com/qtcreator-%1.%2/")
+ .arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR);
+ } else {
+ urlPrefix = QLatin1String("http://doc.trolltech.com/latest/");
+ }
+ QDesktopServices::openUrl(urlPrefix + url.mid(url.lastIndexOf('/') + 1));
}
}