Do not switch to help mode if we launch a browser to show the help.

Also, find the help pages for Creator on the web properly.

Reviewed-By: kh
This commit is contained in:
Daniel Molkentin
2009-06-10 17:38:45 +02:00
parent f4fa0fd770
commit 130064e0f8

View File

@@ -769,12 +769,19 @@ void HelpPlugin::openHelpPage(const QUrl& url)
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));
}
}